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
<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>
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>
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]