ddfreyne changed the topic of #nanoc to: 3.7.0 (June 8th) | web http://nanoc.ws/ | repo http://bit.ly/XE6e3G | issues http://bit.ly/VfXaSV | forum http://ho.io/n-discuss | irclog http://irclog.whitequark.org/nanoc
ics has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jugglinmike has quit [Quit: Leaving.]
ics has joined #nanoc
alerante has quit [Remote host closed the connection]
alerante has joined #nanoc
alerante has quit [Ping timeout: 255 seconds]
ics has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ics has joined #nanoc
prxq has joined #nanoc
alerante has joined #nanoc
alerante has quit [Ping timeout: 260 seconds]
ics has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alerante has joined #nanoc
alerante has quit [Ping timeout: 252 seconds]
alerante has joined #nanoc
alerante has quit [Ping timeout: 244 seconds]
VitamineD has quit [Quit: Computer has gone to sleep.]
VitamineD has joined #nanoc
VitamineD has quit [Remote host closed the connection]
VitamineD has joined #nanoc
alerante has joined #nanoc
FernandoBasso has joined #nanoc
jugglinmike has joined #nanoc
<FernandoBasso> I installed nanoc-toolbox but I get "NameError: uninitialized constant Nanoc::Toolbox".
<FernandoBasso> I had to add it to my Gemfile...
<FernandoBasso> So, I am trying to figure out how to use nanoc-toolbox to generate a TOC. Where should I place this line: <%= toc_for(@item, :collection_class => "nav nav-list toc") %> ?
<FernandoBasso> I am trying to place it my page.md, but the generated pate just prints that line verbatim.
<FernandoBasso> s:pate:page:
<guardian> I want to have an integer that increments each time I invoke a helper
<guardian> apart from a global variable, any idea?
<bobthecow> FernandoBasso: if it's printing out <%= ... type things verbatim, that means you're not running the ERB filter on your item.
<bobthecow> add `filter :erb` somewhere in your compile rules.
<bobthecow> guardian: to what end?
<guardian> bobthecow: I have <%= tabs '/_tab1/', '/_tab2/' %>
<guardian> bobthecow: this is a helper that generates tabs, for twitter bootstrap
<guardian> bobthecow: I need to be able to have <%= tabs '/_tab1/', '/_tab2/' %> twice in the same file
<guardian> bobthecow: and the hrefs and ids generated to differ
<FernandoBasso> guardian: That was the problem. Now, it doesn't generate the toc, though.
<guardian> bobthecow: so each time tabs() is invoked, I want to increment an integer, ideally I want that per item but I guess that's not easily feasible since you can't attach metadata to items while compiling
<FernandoBasso> Well, it didn't earlier either...
<FernandoBasso> I have followed these instructions: https://github.com/aadlani/nanoc-toolbox/wiki/Navigation-Helper#table-of-contenthttps://github.com/aadlani/nanoc-toolbox/wiki/Navigation-Helper#table-of-content
<FernandoBasso> Oops.
<FernandoBasso> Also, I am not sure about 'this method is expecting nested div with "section" class'
<guardian> FernandoBasso: I find this nanoc-toolbox toc_for misleading
<guardian> FernandoBasso: as it expects a specific markup
<FernandoBasso> guardian: Is there an alternative?
<guardian> FernandoBasso: this is my toc helper: http://pastebin.com/LHaqWdpD
<guardian> FernandoBasso: to be used with this _toc.haml partial: http://pastebin.com/WynJgc2h
<guardian> FernandoBasso: and this is an excerpt of my default.haml layout that inserts the toc in a page: http://pastebin.com/qwcNSRb5
<guardian> FernandoBasso: provided as is, I'm uber busy and won't be able to support you on this :/
<FernandoBasso> guardian: :)
<FernandoBasso> No problem. Thanks a lot for the assistance.
VitamineD has quit [Ping timeout: 240 seconds]
ics has joined #nanoc
cDlm has joined #nanoc
<bobthecow> guardian: i'd store a global / class var in your helper with item identifier mapped counters.
<bobthecow> then you'd have per-item counters, but they wouldn't be modifying the item.
<bobthecow> see the memoize helper for how it's doing that.
<bobthecow> FernandoBasso: i've used (and been happy with) jquery tocify.
<bobthecow> it's client side, but it does the job :)
<guardian> bobthecow: http://pastebin.com/rrwraGgc
<guardian> bobthecow: I had to init the hash to -1 because I guess it goes through the helper when computing dependencies
<guardian> bobthecow: I should confirm that with ddfreyne
<bobthecow> yeah, he'd know better than me. but that's about what i'd do.
<guardian> so yeah if I add puts to my tabs() helper printing @item.identifier, which is the identifier of the item calling the helper, then an item that uses the tab() helper twice gets 3 outputs
<bobthecow> interesting.
<bobthecow> oh, does that item have a <%= foo.compiled_content %> call or something?
<bobthecow> if it does, it could be that it started rendering that item, then hit a dependency on something that wasn't yet compiled, then had to finish it off later.
<guardian> yep that's the purpose of tabs, getting the compiled content of the partial items
<guardian> that's likely what's happening
<guardian> ddfreyne: I have a helper that takes the compiled_content of another item
<guardian> ddfreyne: when that other item isn't compiled already, which exception can I catch?
<guardian> ddfreyne: I want to catch the exception, act, then rethrow
alerante has quit [Remote host closed the connection]
jugglinmike has quit [Ping timeout: 248 seconds]
<ddfreyne> guardian: What do you want to act on precisely?
<ddfreyne> (It should not need to be caught)
jugglinmike has joined #nanoc
jugglinmike has quit [Read error: Connection reset by peer]
FernandoBasso has quit [Quit: WeeChat 0.4.3]
alerante has joined #nanoc
<guardian> ddfreyne: http://pastebin.com/rrwraGgc
<guardian> ddfreyne: I want a different integer id every time tabs() is called from an item
<guardian> ddfreyne: this helper generates tab markup for twitter bootstrap
<guardian> ddfreyne: if item /foo/ calls tabs('/_tab1/', '/_tab2/') then it's possible /_tab1/ or /_tab2/ are not compiled yet
<guardian> ddfreyne: yet @site.tab_id_cache['/foo/'] would be incremented
<guardian> ddfreyne: that's a small detail
<guardian> ddfreyne: so in my case if /_tab1/ is not yet compiled I don't want to increment @site.tab_id_cache['/foo/']
ics has quit [Ping timeout: 255 seconds]
ics has joined #nanoc