ddfreyne changed the topic of #nanoc to: 3.6.7 (dec 9th) | 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
pavelkunc has quit [Quit: Leaving.]
kourier has joined #nanoc
louquillio has quit [Remote host closed the connection]
louquillio has joined #nanoc
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alerante has joined #nanoc
alerante has quit [Ping timeout: 260 seconds]
jugglinmike has quit [Quit: Leaving.]
alerante has joined #nanoc
alerante has joined #nanoc
alerante has quit [Changing host]
alerante has quit [Read error: Operation timed out]
alerante has joined #nanoc
alerante has quit [Remote host closed the connection]
kourier has quit [Quit: leaving]
kourier has joined #nanoc
kourier has quit [Client Quit]
kourier has joined #nanoc
kourier has quit [Quit: leaving]
kourier has joined #nanoc
kourier has quit [Quit: leaving]
alerante has joined #nanoc
alerante has quit [Ping timeout: 260 seconds]
relix has joined #nanoc
alerante has joined #nanoc
alerante has quit [Ping timeout: 252 seconds]
pavelkunc has joined #nanoc
<guardian> morning
<guardian> what's the current state of fenced code blocks with nanoc?
<ddfreyne> guardian: Kramdown has support for it, but the syntax is ~~~ ruby instead of ```ruby
<ddfreyne> guardian: Alternatively, you can use the github markdown parser if you want
<guardian> no kramdown is fine
<guardian> I'll use that
<guardian> also, I was browsing nanoc sites sources on github
<guardian> and I guess I said it already, I totally don't get people using nanoc + sprockets
<guardian> to me, that totally misses the point of nanoc
<ddfreyne> Heh :)
<guardian> also, countless of nanoc starter kits
<guardian> they're just noise
<guardian> exploring nanoc.ws and the tutorial and maybe listing 1 or 2 noteworthy sites would help new users better than those half assed starter kits
<ddfreyne> Some of them are broken, too
<ddfreyne> the nanoc3_blog one does not compile out of the box, because it tries to modify attributes during compilation
<guardian> yeah
<guardian> I will open source mine :)
<guardian> for great justice
<guardian> I'm sure bobthecow has many gems to reveal as well! :)
<guardian> well not that my blog is so awesome it's the only source worth looking at. but it's easy to follow which helper does what etc. and it's concrete, not some empty starter kit from which mistakes just wait to happen
<guardian> and I'm sure others sites are alike, at some point nvie.com had it's nanoc source published. it's a well constructed nanoc site as well
<ddfreyne> Ahh, I never saw nvie's source code
<guardian> I was having a look at developer.github.com src. I'm not so fan of their lib/resources.rb
<guardian> it's not so clear how things come into place
<guardian> it feels like you would put all your content into lib/content.rb and then have a erb inject content into posts :)
<ddfreyne> Yeah, it is a bit odd, but it does help with the DRY aspect
<ddfreyne> Their deployment strategy is weir too.
<guardian> do you know why people do this inside their Rules file?
narq has joined #nanoc
<guardian> they wrap Compass.add_project_configuration 'compass/config.rb' inside a boolean guard
<ddfreyne> guardian: Hmmm... I imagine that means they somehow get a "constant already defined" error
<ddfreyne> Not sure why they would, though
<guardian> also, I see there's a stock :colorize_syntax filter from nanoc helpers, but afaik Kramdown integrates with coderay. Which way do you recommend?
<ddfreyne> guardian: I personally prefer my own colorize_syntax but I guess it does not really matter
<guardian> ok
<guardian> really I don't get the reason for LOADED_COMPASS_CONFIG
<guardian> tried to remove it in the few sites I found doing that
<guardian> nothing wrong happens
<ddfreyne> I don't really understand either
<narq> hey guys, I'm trying to run the nanoc tutorial but it fails on "file is not valid US-ASCII". I googled an apparently need to add encoding: utf-8 to my nanoc.yaml, but that doesn't seem to have helped. any ideas?
<ddfreyne> narq: The encoding: utf-8 should be inside the data source configuration
<guardian> bobthecow, ddfreyne: about auto-generating a menu from parent/children hierarchy and a two digits prefix in the identifier to model ordering of items at the same depth in the menu -- I implemented it, in the end it's a mess
<guardian> bobthecow, ddfreyne: it complicates naming identifiers and referring to items by identifier much. In the end, I'll resort to a sidebar/menu partial layout where the ul/li soup defining the menu is updated by hand
<guardian> bobthecow, ddfreyne: doesn't feel that cumbersome, it's more future proof, more flexible and less magical
<narq> ddfreyne: thanks, that worked great, although the output has strange characters after Loading site data and compiling site, like a lowercase A with a carat, followed by a veritical bar
<ddfreyne> narq: What OS are you using?
<ddfreyne> OS/distro
<ddfreyne> The output is harmless in any case, but that is UTF-8
<ddfreyne> guardian: +1 for manually generating the site map I think
<narq> ddfreyne: i'm using fedora
<guardian> ddfreyne: you call it "site map"? I would have thought people call that "menu", sitemap being too close to what you feed search engines with :)
<ddfreyne> site map/menu/navigation etc
<ddfreyne> guardian: Maybe… http://stoneship.org/sitemap/ :)
<guardian> yeah anyways, what readers get to see has to be controlled manually
<guardian> because different sections may need different display depth in the menu
<guardian> and in the end, with something programmatic you end up redoing drupal's menu system mess, with item weight etc :)
<ddfreyne> Yeah
<ddfreyne> Although I imagine that if you have a site with lot sof pages, you would want some checks to make sure that all child pages are in the menu etc
<guardian> maybe
pavelkunc has quit [Quit: Leaving.]
VitamineD has quit [Quit: VitamineD]
VitamineD has joined #nanoc
alerante has joined #nanoc
<guardian> ddfreyne: I was having a look at nanoc.ws src, why do you have <h1><%= @item[:title] || content_for(@item, :title )%></h1> in the default layout?
<guardian> ddfreyne: I'm surprised by the use of capturing for titles
<ddfreyne> guardian: Hmm... I use it in <% content_for :title do %><%= @item[:name] %> <%= @item[:type].capitalize %><% end %> in layouts/{autodoc,commands}.erb
<ddfreyne> guardian: But I guess it is not necessary
<ddfreyne> guardian: It is rather convoluted :)
<guardian> :)
<guardian> I like the capturing for details nav
<guardian> I'm stealing it for my current project at work: documenting our SDK
<ddfreyne> the restructure-docs branch is better: https://github.com/nanoc/nanoc.ws/tree/feature/restructured-docs
<guardian> do you consider it being best practice?
<ddfreyne> guardian: content_for can make the flow hard to follow
<ddfreyne> So I try to avoid it when possible
<guardian> but I don't have a better idea to populate the sidebar depending on the current page. I exactly the same need as you have with nanoc's documentation
<ddfreyne> guardian: Yup
<ddfreyne> guardian: I use a {{TOC}} thing on the nanoc web site which is kinda ugly too
<ddfreyne> Couldn't be bothered yet to make it nice and streamlined though
* ddfreyne blushes
<guardian> also, I had a question: how would you achieve this: "if item.md makes use of <%= audio 'some-file.mp3' %> (audio helper launched trough erb), then inject audio.js javascript at the end of layout"
<ddfreyne> That is probably fixable with capturing
<ddfreyne> guardian: Oh, that is hard
<guardian> I thought {{TOC}} was from kramdown but now that you mention it, it's {:toc} http://kramdown.gettalong.org/converter/html.html#toc -- {:toc} is probably what I would use
<ddfreyne> It]s basically a placeholder
<guardian> but why do it yourself if kramdown can do it? <-- that's the question I'm asking myself
<ddfreyne> guardian: I possibly could... but I do not always use kramdown everywhere
<guardian> also, it seems that nothing makes use of {{TOC}} anymore in nanoc.ws
<ddfreyne> guardian: It is in the layout file
<guardian> I mean no item has {{TOC}}, at least that's what grep says
<ddfreyne> That is true
<ddfreyne> guardian: Ignore it. It's icky :)
<ddfreyne> (could be done in ERB easily... not sure what made me do it this way)
<guardian> ok
<guardian> and about my audio helper stuff?
<guardian> option 1)
<ddfreyne> guardian: I'd create a filter that parses the HTML and checks whether you use any audio player features, and if so, add the javascript file to the HTML
<guardian> in preprocess, regex match the use of erb+audio helper, add attribute
<guardian> options 2)
<guardian> ??? something based on capturing?
<guardian> yeah yeah well parsing the HTML, why not, that means it has to be one of the last filters right? has to happen after markdown -> html filter
<ddfreyne> guardian: yes
<ddfreyne> And after the layout
<guardian> also *I could* just stuff the js needed for audio into my all.js (all js concatenated and minified) because that wouldn't grow the size too much I think :) but it's the opportunity to solve the puzzle :p
<ddfreyne> Using a filter is the cleanest way
<ddfreyne> Although not the fastest i guess
<guardian> yeah not the fastest
<guardian> or I could use an attribute... :has_audio
<guardian> the same way you have :is_dynamic in nanoc.ws :) I fail to see a case where you don't want to always filter by erb, seems so useful
<ddfreyne> I guess
<ddfreyne> I could probably simplify that site a lot
<guardian> that's worth it imho
<guardian> it serves as a nice example
<guardian> it has many sub problems and the fact that it's nanoc.ws gives your official stance on each of them
<ddfreyne> Yeah
<guardian> how does nanoc interface with sass? can nanoc make use of https://github.com/hcatlin/sassruby ?
jugglinmike has joined #nanoc
<gnufied> yep
<gnufied> not necessarily sassruby lib
<gnufied> but nanoc works well with sass
<gnufied> all you need is:
<gnufied> compile '/assets/stylesheets/*' do
<gnufied> filter :sass, syntax: :scss
<gnufied> filter :relativize_paths, :type => :css
<gnufied> end
<gnufied> reltivize_paths is totally my local setup and will not be required everywhere
<guardian> anyone having an opinion between foundation and bootstrap?
alerante has quit [Remote host closed the connection]
<guardian> ddfreyne: I think you have a nanoc example to integrate bootstrap (or was it compass only?) - do you have one for foundation?
idarya has joined #nanoc
VitamineD has quit [Ping timeout: 264 seconds]
idarya has quit [Ping timeout: 272 seconds]
<jugglinmike> Can anyone explain how enabling the "allow_periods_in_identifiers" configuration setting could "break the site"? https://github.com/nanoc/nanoc/blob/9b58936e31c00aeb7589b6abb88cf4f2ed73eb5b/lib/nanoc/data_sources/filesystem_unified.rb#L73
<jugglinmike> It seems like *disabling* it is actually the riskier option, since it could cause items for distinct files to collide
<guardian> ddfreyne: using @ to denote an instance variable in a helper implemented as a plain function, that doesn't make much sense right? which is the class that evaluates lib/*.rb in which those "instance variables" end up being?
pavelkunc has joined #nanoc
VitamineD has joined #nanoc
alerante has joined #nanoc
alerante has quit [Ping timeout: 264 seconds]
pavelkunc has quit [Quit: Leaving.]
pavelkunc has joined #nanoc
<guardian> re
pavelkunc has quit [Quit: Leaving.]
feromonkoles has joined #nanoc
feromonkoles has quit [Remote host closed the connection]
<guardian> is there a way to access a nanoc helper / @config from sass content?
pavelkunc has joined #nanoc
proffessour has joined #nanoc
<guardian> that is, evaluating ruby from sass
godoval has joined #nanoc
pavelkunc has quit [Quit: Leaving.]
pavelkunc has joined #nanoc
alerante has joined #nanoc
alerante has quit [Changing host]
alerante has joined #nanoc
godoval has quit [Ping timeout: 246 seconds]
proffessour has quit [Ping timeout: 260 seconds]
alerante has quit [Ping timeout: 264 seconds]
pavelkunc has quit [Quit: Leaving.]
sislab has joined #nanoc
vasskon has joined #nanoc
<bobthecow> guardian: your conversation with everyone else was tl;dr, but you could go back to what i said about defining menu structure in yaml somewhere.
<bobthecow> put identifiers in a giant nested hash, organize them however you want.
<bobthecow> it's at least one step better than <ol><li> in a partial.
<guardian> in a .yaml file maybe then?
<bobthecow> yeah. or in yaml frontmatter for another item, if you have one where it makes sense.
<bobthecow> e.g. if you have an archive item or something?
<guardian> not sure. but well also, a haml partial isn't that ugly
vasskon has quit [K-Lined]
sislab has quit [K-Lined]
<guardian> bobthecow: do you happen to know whether there's a way to access nanoc helpers or variables from sass? that would be helpful to avoid settings duplication
empost has joined #nanoc
<bobthecow> guardian: what do you mean?
<guardian> from within scss, access @config[;something]
<guardian> I guess I should have a second look at how the sass filter injects stuff
<guardian> that could be a way
<guardian> I think I understood one can extend sass and provide "functions", in which case that could be a way to bridge sass and nanoc
<guardian> but on that last idea I'm not quite sure :)
empost has quit [K-Lined]
<dkm> guardian: it might help to provide an example of what you are trying to do
<dkm> one solution that comes to mind is us a nanoc filter
<dkm> scss is content, just like any other
<guardian> for instance, my ruby images helper has max_width and max_height parameters I put in site's config. I redefine those variables within my scss content, with the same values
<guardian> that's duplication
FunkyPenguin has quit [Quit: No Ping reply in 180 seconds.]
FunkyPenguin has joined #nanoc
<dkm> guardian: one solution that comes to mind is generate a Nanoc::Item in the preprocess stage that assembles a scss file defining all the constants from the config
<dkm> then include that file in your other scss files
jugglinmike has quit [Quit: Leaving.]
<dkm> or, maybe simpler, just create the scss file normally and put some erb in it to pull data from @config, then in the Rules just run it through the :erb filter before :scss
<guardian> ah yeah
<guardian> in fact
<guardian> the second idea
<guardian> I once had it
<guardian> forgot about it, and now that you mention it I'm recalling it :)
<dkm> yeah, I think for just pulling in constants that probably makes the most sense
louquillio has quit [Remote host closed the connection]
alerante has joined #nanoc
alerante has quit [Ping timeout: 272 seconds]