ddfreyne changed the topic of #nanoc to: 3.6.4 (may 29th) | 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
louquillio has quit [Remote host closed the connection]
louquillio has joined #nanoc
alerante has quit [Remote host closed the connection]
<bobthecow> ddfreyne: remember how i was complaining about timezone issues with nanoc, and things recompiling every time I traveled?
<bobthecow> added this to lib/default.rb: ENV['TZ'] = 'America/Los_Angeles'
<bobthecow> wheee!
yogsototh has joined #nanoc
bobthecow has quit [Remote host closed the connection]
bobthecow has joined #nanoc
bobthecow has joined #nanoc
yogsototh1 has joined #nanoc
yogsototh has quit [Ping timeout: 246 seconds]
VitamineD has quit [Ping timeout: 264 seconds]
yogsototh has joined #nanoc
yogsototh1 has quit [Ping timeout: 246 seconds]
VitamineD has joined #nanoc
<darix> bobthecow: your notebook adapts your timezone while travelling?
<bobthecow> yeah.
<bobthecow> darix: http://i.0x7f.us/time.png
superkulak has joined #nanoc
superkulak has quit [Client Quit]
superkulak has joined #nanoc
bobthecow has quit [Remote host closed the connection]
VitamineD has quit [Ping timeout: 264 seconds]
superkulak has quit [Quit: Sto andando via]
<Evolution> hmm, how does one create a table of contents for markdown with either rdiscount or kramdown?
<Evolution> I can't seem to find anything in the docs on doing it.
<Evolution> and neither kramdown or rdiscount syntax docs mention it that I can see.
alerante has joined #nanoc
alerante_ has joined #nanoc
alerante has quit [Ping timeout: 240 seconds]
jugglinmike has joined #nanoc
alerante_ has quit [Read error: Connection reset by peer]
alerante has joined #nanoc
<ddfreyne> Evolution: For a single page?
<ddfreyne> Evolution: you could run kramdown/rdiscount/whatever first, and then have a filter that takes the content, parses it with nokogiri, finds all the headers and generates a toc from them, and then prepends that to the content
<ddfreyne> def run(content, params={}) ; toc_for(content) + content ; end # <---- pseudocode
<Evolution> ddfreyne: yeah. I'm trying that, however it's not operating as expected.
<Evolution> I'm using the add_toc.rb from nanoc's lib/filters
<Evolution> then in my Rules file I have filter :rdiscount \n filter :add_toc
<Evolution> I have that in site/lib/filters/add_toc.rb
<darix> Evolution: didnt one of those libraries already support building a toc
<darix> zenspider mentioned something like that
<darix> if i recall correctly it was kramdown
<Evolution> darix: if I'm reading that right, I just need to use kramdown, and then in my page have {:toc} ?
<darix> looks like that for me
<Evolution> hmmm. seems I have to create a list as well?
<darix> i have no idea. never used it. just kept it in mind when zenspider mentioned it
<Evolution> ah, rock. got it I think.
<Evolution> yep. that works.
<Evolution> thanks for the hints darix
pepijndevos has quit [Ping timeout: 240 seconds]
tantalum has joined #nanoc
alerante has quit [Remote host closed the connection]
VitamineD has joined #nanoc
<Evolution> So, is it possible use a directory full of partials or similar and have them all included in one page?
<Evolution> for example, a directory foo, full of files like _name.erb. and have a file at the same level as the directory... foo.erb that will include all the content from the dir?
<jachymko> perhaps something along the lines of <% @site.layouts['/foo/'].children.each do |i| %><%= render i.identifier %><% end %>
<Evolution> jachymko: yeah. something along those lines might work out rather well.
pepijndevos has joined #nanoc
<Evolution> jachymko: forgive me please as I'm still learning. would it be possible to combine that with item info? for example @item[:author] ?
<jachymko> what exactly are you trying to accomplish?
<jachymko> to list all articles written by an author?
<jachymko> i wouldn't use partial layouts for that
<jachymko> <% @site.items.select { |i| i[:author] == 'foo' }.each do |i| %><%= i.compiled_content %><% end %>
<Evolution> jachymko: I'm redoing the centos.org project page using nanoc (and ditching xoops)
<Evolution> since sponsors are a large part of distribution, I'm trying to do up a sponsors page that breaks various sponsors out into groups. (probably by country)
<jachymko> well the question is whether you want to render *items* or *partial layouts*
<Evolution> I'd rather have that page dynamic though and pull in from partials.
<jachymko> it sounds to me like you should have an item for every sponsor, not a partial
<jachymko> s/every/each
<Evolution> right. it would be an item per sponsor. I'm trying to include/group them all in a single page as well
<Evolution> by country.
<jachymko> there are two options:
<jachymko> Item#compiled_content
<jachymko> and content_for helper
<Evolution> I was thinking I'd toss a sponsor_name.erb in /sponsors/ with a sponsors.erb, and then iterate through them. that way if I add one, I'm just adding a single file, not messing with a giant thing
<Evolution> could you elaborate a bit on those options please?
<jachymko> i would create a content/sponsors/foo.markdown (or .whatever) page for every sponsor
<Evolution> right.
<Evolution> that's what I'd intended so far.
<Evolution> but then creating a list of that, by :country in a sponsors.erb or sponsors.md or whatever is where I'm stuck
<jachymko> and then put the following code in the content/sponsors.erb: https://gist.github.com/jachymko/6583366
<jachymko> compiled_content returns the output before any layouts, i think
<jachymko> if you want some layouts applied and some not, just pop a "snapshot :foo" in the compilation rule, and then item.compiled_content(:snapshot => :foo) and you'll get the content as it were at that point
<jachymko> the other option is the content_for helper, described here: http://nanoc.ws/docs/api/Nanoc/Helpers/Capturing.html
<jachymko> that would be better in case you wanted to have completely different content on the /sponsors page from what would be on the individual sponsor's pages
<Evolution> jachymko: I'll check that out.
<Evolution> thanks
<jachymko> you're welcome!
<Evolution> mostly I was thinking I'd keep the individual sponsor pages hidden, with info in the header area. then use that as variables to loop through
<Evolution> but you've given me some good ideas
<Evolution> thanks
bghost has joined #nanoc
bghost has quit [Remote host closed the connection]
bghost has joined #nanoc
Rym has joined #nanoc
bghost has quit [Read error: Connection reset by peer]
Rym has quit [Ping timeout: 264 seconds]
Rym has joined #nanoc
<tantalum> Hi Everybody
<tantalum> I have a bunch of jquery files I use and they are named jquery.plugin.etc.js
<tantalum> I've placed them under content/js/
<tantalum> the problem I'm having is that nanoc will error out saying that there are 35 content files for /js/jquery/;
<tantalum> Is there some way around this without having to rename all the javascript files?
<Evolution> tantalum: tell nanoc to not process them during compile?
<tantalum> Evolution: How?
<Evolution> in your Rules file, put something like->
<Evolution> compile '/js/*' do
<Evolution> #not a damned thing
<Evolution> end
<Evolution> assuming everything in there is something you don't want touched.
<tantalum> Evolution: I set allow_periods_in_identifiers: to true in nanoc.yaml
yogsototh has quit [Remote host closed the connection]
Rym has left #nanoc [#nanoc]
Rym_ has joined #nanoc
jugglinmike has quit [Quit: Leaving.]
Rym has joined #nanoc
Rym_ has quit [Ping timeout: 240 seconds]
tantalum has left #nanoc [#nanoc]