<kAworu>
ddfreyne: The thing is that using HTML syntax like <code class="language-ruby"> and then parsing to HTML (as I understand does the default filter) has some issues
<kAworu>
for example, if you have a line like "#include <stdio.h>" then the content will not be successfully parsed by Nogokiri (because '<' and '>' should be escaped as < and >
<guardian>
ddfreyne: "The colorize_syntax filter already has some logic for extracting the language" oh really?
<guardian>
ddfreyne: I have to add e.g. "#!c" or "#!ruby" on top of my code fragments otherwise it doesn't colorize anything
<guardian>
ddfreyne: even the doc for the colorize syntax filter says "The code element should have an indication of the language the code is in"
<kAworu>
guardian: I think that's the logic he's referring to ;)
<guardian>
ddfreyne: so my question is "is there a way to avoid having to specify the language and have it automatically detected?"
kAworu has quit [Remote host closed the connection]
<guardian>
ddfreyne: btw I'm not sure feeding Nokogiri with a markdown document containing HTML blocks/parts is a supported scenario
<ddfreyne>
kAworu: I believe kramdown supports GitHub-style backticks, and it (I believe) sets the correct language-something class.
<ddfreyne>
guardian: if you wanted to automatically detect the language, you could have a filter that grabs the <pre>s, feeds them to some library that detects the language, and adds it.
<ddfreyne>
guardian: I believe GitHub has a library like that, but I don't remember the name.
<ddfreyne>
guardian: Of course, that is not quite going to be the fastest approach...
<ddfreyne>
kAworu: #include <foo> in HTML is invalid anyway... if you have that in Markdown in an indented code block, it will escape the <> for you.
<guardian>
it's github-linguist
<ddfreyne>
kAworu: As for that Stoneship site one... I used to do the syntax coloring by hand, but that's quite a while ago. The nanoc web site uses the #!language construct, which works well
<guardian>
ddfreyne: about that PR for the kramdown filter, forget it. I think I'll switch to a regex to ignore some warnings...
<ddfreyne>
guardian: The kramdown warnings are definitely something I'd like to address, but it might be better to address those within kramdown itself.