ddfreyne changed the topic of #nanoc to: 3.8.0 (May 4th) - 4.0.0b4 (June 10th) | 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
jugglinmike has quit [Ping timeout: 265 seconds]
alerante has quit []
stbuehler has quit [Quit: leaving]
stbuehler has joined #nanoc
<ddfreyne> guardian: assigns are { item: …, layouts: …, items: … } etc — they get turned into @item, @config, @layouts used in ERB etc.
<ddfreyne> guardian: I wouldn’t use nanoc for a site that has dynamic content. It could work, but I don’t think it’s the right tool for the job
<ddfreyne> Sinatra + Sequel is still prettty sweet combo :)
<ddfreyne> I’ve been meaning to play around with this: https://github.com/patriciomacadden/hobbit
<nanoc-gh> [nanoc] ddfreyne created item-rep-spec (+1 new commit): http://git.io/vIxR9
<nanoc-gh> nanoc/item-rep-spec f4f06b4 Denis Defreyne: wip
<nanoc-gh> [nanoc] ddfreyne created improve-errors (+1 new commit): http://git.io/vIxur
<nanoc-gh> nanoc/improve-errors 2c47e75 Denis Defreyne: Improve errors
<guardian> ddfreyne: yeah, exactly what I thought
<guardian> ddfreyne: also, getalong has no plans for warnings in kramdown in a near future
<ddfreyne> Did you talk to him?
<guardian> ddfreyne: so I started wondering about having a setting to filter some warnings, but it turns out I don't know whether I should store filters as strings in my nanoc.yaml or as !ruby/regexp
<guardian> ddfreyne: what would you do?
<ddfreyne> guardian: I’d have it as arguments to the :kramdown filter
<guardian> sure
<ddfreyne> Hmm… those might be passed on to kramdown directly though
<guardian> well I have it as arguments to my :kramdown
<guardian> but I also want to be able to :filter kramdown, @config[:kramdown] || {}
<ddfreyne> def run(content, params = {})
<ddfreyne> document = ::Kramdown::Document.new(content, params)
<ddfreyne> Hm.
<guardian> so all in all, what's good solution to store regexps inside yaml ? :)
<ddfreyne> guardian: Yeah, that makes sense. I guess you could edit the :kramdown filter to have both styles (if :config is present, pass that to kramdown, otherwise pass params)
<ddfreyne> guardian: Strings work. You can convert them to regexes using Regexp.new() I believe
<guardian> because right now, in my own kramdown.rb filter I'm reading params[:warning_filters]
<guardian> and it's either a String or an Array of String
<guardian> which in turn I convert to an array of Regexp
<guardian> so that I can filter out from within the loop that prints the warnings
<guardian> or remove_if
<guardian> then again, I'm not sure I'll keep it because:
<guardian> in fact I'm interested in seeing kramdown warnings, when the source markdown content is written by me
<guardian> but I have the following situation
<guardian> all my items are filered by :erb first, then .md files are filtered by :kramdown
<guardian> I have a tabs() helper which I call like this <%= tabs('/_tab1/', /_tab2/') %>
<guardian> this helper inserts tabs from partials (/_tabs1/ is content/_tabs1.md)
<guardian> ultimately, in my _tabs.haml layout, I end up calling item.compiled_content where item is /_tab1/ then /_tab2/
<guardian> and in fact when kramdown converts _tab1.md to an HTML fragment that gets reinjected in the parent .md file, kramdown outputs non self closing <img> and <br> tags
<guardian> which in turn cause warnings because instead of being passed through kramdown, kramdown's XHTML(5) parser complains about non self closing tags
<guardian> see the big picture?
<guardian> so all in all, either I have my own kramdown filter that filters warnings out, OR I do item.compiled_content.gsub(/<((img|br)[^>]*)>/, '<\1/>') in my tabs helper
<guardian> I know regexps are ugly in this case, but it narrows down the problem to what it really is, instead of ultimately eliminating ALL the warnings about non self closing <img> and <br>
<ddfreyne> Yeah, that’s annoying
<ddfreyne> I am not entirely sure how to solve this… I would like kramdown to optionally emit self-closing tags.
<ddfreyne> That’d be ideal
<nanoc-gh> [nanoc] ddfreyne force-pushed improve-errors from 2c47e75 to 5f32ce9: http://git.io/vIxan
<nanoc-gh> nanoc/improve-errors 5f32ce9 Denis Defreyne: Improve errors
<nanoc-gh> [nanoc] ddfreyne force-pushed improve-errors from 5f32ce9 to c0fe0b0: http://git.io/vIxan
<nanoc-gh> nanoc/improve-errors c0fe0b0 Denis Defreyne: Improve errors
<guardian> ddfreyne: in fact, I'm likely wrong putting the blame on Kramdown
<guardian> ddfreyne: Kramdown outputs self closing tags, but my _tabs.haml is the one to blame for un closing tags
<ddfreyne> guardian: kramdown should be able to handle HTML though
<ddfreyne> (I don’t use XHTML)
<nanoc-gh> [nanoc] ddfreyne force-pushed improve-errors from c0fe0b0 to fbd3ea2: http://git.io/vIxan
<nanoc-gh> nanoc/improve-errors fbd3ea2 Denis Defreyne: Improve errors
<guardian> ddfreyne: kramdown's doc says :/
<guardian> Note that the parser basically supports only correct XHTML! However, there are some exceptions. For example, attributes without values (i.e. boolean attributes) are also supported and elements without content like <hr /> can be written as <hr>. If an invalid closing tag is found, it is ignored.
<ddfreyne> Hm.
<ddfreyne> Bah
<guardian> :))
hal_9000 has joined #nanoc
hal_9000_ has quit [Ping timeout: 264 seconds]
jugglinmike has joined #nanoc
<nanoc-gh> [nanoc] ddfreyne deleted improve-errors at fbd3ea2: http://git.io/vIhe5
<nanoc-gh> [nanoc] ddfreyne force-pushed fix-show-rules from 87076d3 to 7db7832: http://git.io/vIheh
<nanoc-gh> nanoc/fix-show-rules b8ab654 Denis Defreyne: Fix show rules (WIP)
<nanoc-gh> nanoc/fix-show-rules 7db7832 Denis Defreyne: Fix things
<travis-ci> nanoc/nanoc/master 1ebbb5e Denis Defreyne: The build passed.
jugglinmike has quit [Ping timeout: 264 seconds]
<nanoc-gh> [nanoc] ddfreyne pushed 1 new commit to master: http://git.io/vIh2k
<nanoc-gh> nanoc/master f0d37cd Denis Defreyne: Update release notes
jugglinmike has joined #nanoc
ndim has quit [Ping timeout: 264 seconds]
ndim has joined #nanoc