ddfreyne changed the topic of #nanoc to: 3.6.8 (mar 22th) | 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
relix has joined #nanoc
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
guardian has quit [Read error: Operation timed out]
guardian has joined #nanoc
jugglinmike has quit [Quit: Leaving.]
louquillio has joined #nanoc
bensonshaji has joined #nanoc
<bensonshaji> any way to generate category pages for the post?
<bensonshaji> found few articles on the web, but they seem to dead.... when implemented.
<ddfreyne> bensonshaji: There is a guide for paginating articles on the nanco web site, which even though is not what you want, provides techniques that you can use for implementing category pages
<bensonshaji> ddfreyne, gonna try.... now
<bensonshaji> ddfreyne, my markdown file has a line "categories: linux ruby" when I run nanoc compile I get this error "undefined method `map' for "tech":String" but the same works when I change my markdown file line to
<bensonshaji> categories:
<bensonshaji> - linux
<bensonshaji> - ruby
<bensonshaji> ddfreyne, why is it so?
<ddfreyne> bensonshaji: If you say “categories: linux ruby” then the :categories attribute will be a string "linux ruby"
<ddfreyne> bensonshaji: You can say categories: [ linux, ruby ]
<ddfreyne> Or even categories: [ "linux", "ruby" ] (strings are optionally quoted in YAML)
<bensonshaji> Is there any way I can deal with "categories: linux ruby" ?
<ddfreyne> bensonshaji: You could set up a pre-processor that takes the :categories attribute and splits on \s+
<ddfreyne> @items.each { |i| i[:categories] = i[:categories].split(/\s+/) }
<bensonshaji> ddfreyne, thats exactly what I was looking for... what does that regular expression means?
<ddfreyne> bensonshaji: \s means any space (space, tab, newline, ...) and + means 1 or more occurence
<bensonshaji> ddfreyne, ok thanks a lot for the help.
<travis-ci> [travis-ci] nanoc/nanoc-erector/master 326db81 Denis Defreyne: The build passed.
<travis-ci> [travis-ci] nanoc/nanoc-lftp/master 9bb3469 Denis Defreyne: The build passed.
<bensonshaji> ddfreyne, I just went through this link http://jakoblaegdsmand.com/blog/2013/01/easy-blogging-with-nanoc/ and there this guy has setup preprocess to generate defined pages.
<bensonshaji> Does that method holds good If I have to generate my custom pages by defining? Or does nanoc has any documentation for it?
<ddfreyne> bensonshaji: What do you mean by defining?
<ddfreyne> bensonshaji: The explanation given in that article is nice and up-to-date
<bensonshaji> ddfreyne, defining functions
<bensonshaji> ddfreyne, when i tried to run those helpers I got error like undefined method get_date
<ddfreyne> bensonshaji: Hmm, get_date is never explained in that blog post, interesting
<ddfreyne> Time.parse(@item[:created_at]) is what get_date(@item) returns I believe
<bensonshaji> ddfreyne, let me try that...
<GitHub16> [nanoc-core] ddfreyne pushed 1 new commit to master: http://git.io/SkBQ6g
<GitHub16> nanoc-core/master 49f41ea Denis Defreyne: Rename output_dir to build_dir
<bensonshaji> ddfreyne, that doesn't seem to be working. I get too many undefined methods.
<bensonshaji> ddfreyne, Any documentation for generating new pages for the defined functions?
<travis-ci> [travis-ci] nanoc/nanoc-core/master 49f41ea Denis Defreyne: The build passed.
<ddfreyne> bensonshaji: I think the blog post you linked to is meant to be an overview rather than a reaymade solution
<ddfreyne> bensonshaji: You can roll your own though. To generate items, append a Nanoc::Item instance to @items
<ddfreyne> bensonshaji: e.g. @items << Nanoc::Item.new('some content', { title: 'Blah' }, '/categories/blah/')
<bensonshaji> ddfreyne, ok....
<travis-ci> [travis-ci] nanoc/nanoc-cli/master 02f6e5f Denis Defreyne: The build passed.
relix has joined #nanoc
<bensonshaji> ddfreyne, when I target the output path to "/categories/#{category}" it raises an error undefined method captures of a route which was previously defined.
<bensonshaji> ddfreyne, as per that article it has something like this "/tags/#{tag.to_url}" when I used "to_url" it throws an error again as undefined method
bensonshaji has quit [Ping timeout: 240 seconds]
bensonshaji has joined #nanoc
<travis-ci> [travis-ci] nanoc/nanoc-check/master 3f0df94 Denis Defreyne: The build passed.
<bensonshaji> ddfreyne, any help with that?
<travis-ci> [travis-ci] nanoc/nanoc-check/master 5434aff Denis Defreyne: The build passed.
terinjokes has quit [Ping timeout: 265 seconds]
tom[] has quit [Ping timeout: 265 seconds]
_whitelogger_ has joined #nanoc
<bensonshaji> ddfreyne, when I havent added any preprocess routing works fine.
<bensonshaji> ddfreyne, when I add the preprocessing function the route throws an error
<ddfreyne> bensonshaji: That means there are items with identifiers like /articles/somethingsomething/ that don't have the date in their identifier
<ddfreyne> bensonshaji: So my guess is that you have content/articles/2014-03-22-someslug.md AND that you are generating items like /articles/categories/something/ in the preprocessor
<ddfreyne> Those generated items won't match that regex
tlevine has joined #nanoc
<ddfreyne> So /.../.match(item.identifier) will return nil
<ddfreyne> And you get a no method error for nil
<bensonshaji> ddfreyne, I think so,
<bensonshaji> ddfreyne, should I add another route to match the preprocess function?
<ddfreyne> bensonshaji: That would be my suggestion, yes
<bensonshaji> ddfreyne, but why does the preprocess function depends on the routing of /articles/* ?
<ddfreyne> bensonshaji: Because you specified it... you're generating items with identifiers like "/articles/categories/#{category}"
<bensonshaji> ddfreyne, I am not sure how to route works for content that doesn't exist and yet to be created
<ddfreyne> bensonshaji: Preprocess happens first, then the routing
<ddfreyne> So when routing happens, thos eitems will exist (in memory)
dkm has joined #nanoc
bobthecow has joined #nanoc
<bensonshaji> bensonshaji, page getting generated like this output/articles/categories/["a"]/index.html
<travis-ci> [travis-ci] nanoc/nanoc-deploying/master c987f3a Denis Defreyne: The build passed.
koan_ is now known as koan
bobthecow has quit [Ping timeout: 265 seconds]
bensonshaji has quit [Quit: Leaving]
dkm has quit [Ping timeout: 265 seconds]
bobthecow has joined #nanoc
bobthecow has joined #nanoc
bobthecow has quit [Changing host]
dkm has joined #nanoc
bobthecow has quit [Remote host closed the connection]
bobthecow has joined #nanoc
bobthecow has joined #nanoc
bobthecow has quit [Changing host]
achal_ has joined #nanoc
achal_ is now known as achal
bensonshaji has joined #nanoc
louquillio has quit [Remote host closed the connection]
bensonshaji has quit [Quit: Leaving]
<GitHub43> [nanoc-core] ddfreyne pushed 1 new commit to master: http://git.io/xxA8IQ
<GitHub43> nanoc-core/master 8378dd8 Denis Defreyne: Turn item during recording into view
<GitHub102> [nanoc-core] ddfreyne pushed 1 new commit to master: http://git.io/4m470Q
<GitHub102> nanoc-core/master a816080 Denis Defreyne: Pass #compiled?
<travis-ci> [travis-ci] nanoc/nanoc-core/master 8378dd8 Denis Defreyne: The build passed.
<travis-ci> [travis-ci] nanoc/nanoc-core/master a816080 Denis Defreyne: The build passed.
<GitHub139> [nanoc-core] ddfreyne pushed 1 new commit to master: http://git.io/yrypCQ
<GitHub139> nanoc-core/master 6168be8 Denis Defreyne: Allow #layout with pattern instead of identifier
<ddfreyne> bobthecow: What's your opinion of prefixing private methods with _?
<ddfreyne> To give some context: nanoc 4.0 has item/rep/layout views that expose a specific set of methods
<ddfreyne> Those views are not the item/rep/layouts themselves, because the latter should not be accessed directly
<ddfreyne> But there is a method #resolve that gives the item/rep/layout
<ddfreyne> Now, I’d like to name that method _resolve instead, to make it clear this is not for public usage at all
<travis-ci> [travis-ci] nanoc/nanoc-core/master 6168be8 Denis Defreyne: The build passed.
spader is now known as terinjokes
<travis-ci> [travis-ci] nanoc/nanoc/old-4.x 212e96d Denis Defreyne: The build is still failing.
<GitHub30> [nanoc-core] ddfreyne pushed 1 new commit to master: http://git.io/hH6Ewg
<GitHub30> nanoc-core/master d859c62 Denis Defreyne: Merge changes from nanoc (up to 212e96dd61038cebf5d86bfb69c36bd99de975cb)
VitamineD has left #nanoc [#nanoc]
<GitHub21> [nanoc-core] ddfreyne pushed 1 new commit to master: http://git.io/1w1o4w
<GitHub21> nanoc-core/master 3533a81 Denis Defreyne: Document further changes in NEWS
<travis-ci> [travis-ci] nanoc/nanoc-core/master d859c62 Denis Defreyne: The build passed.
VitamineD has joined #nanoc
<VitamineD> bobthecow: any chance you could post a printable PDF of that git-pretty chart ?
<travis-ci> [travis-ci] nanoc/nanoc-core/master 3533a81 Denis Defreyne: The build passed.
<GitHub69> [nanoc-core] ddfreyne pushed 2 new commits to master: http://git.io/6ysiDg
<GitHub69> nanoc-core/master e2789ba Denis Defreyne: Improve styling
<GitHub69> nanoc-core/master 211d370 Denis Defreyne: Enable HashSyntax cop
<GitHub181> [nanoc-core] ddfreyne pushed 2 new commits to master: http://git.io/hzgN4A
<GitHub181> nanoc-core/master 5c131f1 Denis Defreyne: Remove deleted FavorSprintf cop
<GitHub181> nanoc-core/master 4c8aa51 Denis Defreyne: Disable TrailingComma cop
<travis-ci> [travis-ci] nanoc/nanoc-core/master e2789ba Denis Defreyne: The build passed.
<travis-ci> [travis-ci] nanoc/nanoc-core/master 5c131f1 Denis Defreyne: The build passed.
<GitHub179> [nanoc-core] ddfreyne pushed 3 new commits to master: http://git.io/uR_uiA
<GitHub179> nanoc-core/master 324be2b Denis Defreyne: Improve style
<GitHub179> nanoc-core/master 3ca1f97 Denis Defreyne: Enable Lambda cop
<GitHub179> nanoc-core/master 30138c5 Denis Defreyne: Enable ClassVars cop
<GitHub152> [nanoc-core] ddfreyne pushed 4 new commits to master: http://git.io/d53GrQ
<GitHub152> nanoc-core/master 074f586 Denis Defreyne: Enable AccessModifierIndentation cop
<GitHub152> nanoc-core/master 037d303 Denis Defreyne: Enable RegexpLiteral cop
<GitHub152> nanoc-core/master 27844e0 Denis Defreyne: Enable RescueException cop
<travis-ci> [travis-ci] nanoc/nanoc-core/master 30138c5 Denis Defreyne: The build passed.
<GitHub111> [nanoc-core] ddfreyne pushed 1 new commit to master: http://git.io/UYSG7g
<GitHub111> nanoc-core/master aed8475 Denis Defreyne: Enable MultilineBlockChain cop
<GitHub34> [nanoc-core] ddfreyne pushed 2 new commits to master: http://git.io/EMTZ2A
<GitHub34> nanoc-core/master de20134 Denis Defreyne: Fix almost all remaining style issues
<GitHub34> nanoc-core/master 1426c18 Denis Defreyne: Enable IndentationWidth cop
<VitamineD> ddfreyne: _binding ? didn't you forget a _ there ?
<travis-ci> [travis-ci] nanoc/nanoc-core/master aed8475 Denis Defreyne: The build passed.
<ddfreyne> VitamineD: _binding needs to have a different name because you still need to call the global #binding method
<ddfreyne> Ugly, I know.
<ddfreyne> If you have suggestions, let m eknow
<travis-ci> [travis-ci] nanoc/nanoc-core/master de20134 Denis Defreyne: The build passed.
<VitamineD> the global one is private ?
<ddfreyne> VitamineD: Yes
<VitamineD> alias :binding :private_binding
<VitamineD> def binding() private_binding end # I doubt that actually works :)
<ddfreyne> VitamineD: It's not an instance method but a method on Kernel
<VitamineD> what does that imply ?
<ddfreyne> It means it won't work :)
<VitamineD> at least name it __binding__ then :D
<ddfreyne> THIS IS NOT PYTHON!!1!
<VitamineD> a small gesture to attract new users :)
<GitHub76> [nanoc-core] ddfreyne created feature/atomic-non-loading-store (+1 new commit): http://git.io/WPffIA
<GitHub76> nanoc-core/feature/atomic-non-loading-store 4ec85e9 Denis Defreyne: Add experimental AtomicNonLoadingStore
<travis-ci> [travis-ci] nanoc/nanoc-core/feature/atomic-non-loading-store 4ec85e9 Denis Defreyne: The build failed.
<GitHub131> [nanoc-core] ddfreyne opened pull request #4: Add experimental AtomicNonLoadingStore (master...feature/atomic-non-loading-store) http://git.io/ECLrYg
<ddfreyne> This might help a lot to relieve memory pressure: https://github.com/nanoc/nanoc-core/pull/4/files
<ddfreyne> Makes me wonder why I did not do it this way in the first place.
<ddfreyne> Also not sure how fast PStore is...
achal has quit [Quit: Connection closed for inactivity]
<GitHub56> [nanoc-core] ddfreyne pushed 1 new commit to feature/atomic-non-loading-store: http://git.io/Csu6ew
<GitHub56> nanoc-core/feature/atomic-non-loading-store 7200f57 Denis Defreyne: Ensure tmp filename is either copy or empty
<travis-ci> [travis-ci] nanoc/nanoc-core/feature/atomic-non-loading-store 7200f57 Denis Defreyne: The build was fixed.
<GitHub186> [nanoc-core] ddfreyne pushed 1 new commit to feature/atomic-non-loading-store: http://git.io/ObVC3A
<GitHub186> nanoc-core/feature/atomic-non-loading-store 5b33619 Denis Defreyne: Let CompiledContentCache use new store
VitamineD has left #nanoc [#nanoc]
<ddfreyne> Holy crap, PStore is slow.
<ddfreyne> ± 2 seconds per item.
<ddfreyne> Huh.
<ddfreyne> It's CPU-bound. I'd have expected it to be IO-bound...
<ddfreyne> alright, time to shut down. Seeya!
louquillio has joined #nanoc
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]