<ddfreyne>
tom[]: Anyway, the trace you see in crash.log is the full one, even if it says some lines are omitted ;)
VitamineD has quit [Quit: Leaving.]
<tom[]>
ddfreyne: i had been hoping there was more with maybe a clue to the problem
<tom[]>
anyway, i got it sorted
FunkyPenguin has joined #nanoc
forcev has quit [Ping timeout: 240 seconds]
<ddfreyne>
tom[]: What more did you expect to find?
<ddfreyne>
(or want to)
<tom[]>
ddfreyne: hmm. now that i review the stack trace, item 0. does point to the line of my content that had the error. i'm not sure i noticed that yesterday
<tom[]>
that, together with the error message, should have been sufficient.
<tom[]>
for a competent programmer, it would have been
<ddfreyne>
tom[]: The first few lines of the stack trace are enough in 99% of the cases, in my experience. That's why the CLI cuts off after 10 lines
<ddfreyne>
The competent bit is something you said yourself 0:)
<jd_>
I'd like to edit my articles (I guess during preprocess time). I use slim (template engine) and like to automagically add markdown: chunks in between my p tags, so that I can write markdownified paragraphs without ever typing the markdown: prefix
<jd_>
I matched lines correctly, but the preprocessor seems to go in an infinite loop because I File.open and save the articles
<jd_>
is there a good way to do this with nanoc?
<ddfreyne>
jd_: Ahh, the preprocessor is not intended to modify the files on disk, but rather just in memory
<jd_>
yep, I figured it out :p
<jd_>
Am I heading to a pre-preprocessor solution? (grunt/guard/anything)
<jd_>
(on peut parler en français si jamais ^^)
number-six has quit [Remote host closed the connection]
<ddfreyne>
jd_: You can either modify the files in a separate script, or modify the item contents in-memory during preprocess
<jd_>
in memory could be fine actually
<jd_>
a gsub would do then?
<ddfreyne>
jd_: Yup (gsub! probably)
<ddfreyne>
jd_: I don't speak French very well (and this is an English-speaking channel anyway)
<jd_>
(all right, I always assumed you were French)
<ddfreyne>
I am Belgian but speak mostly Dutch (Flemish) and now I live in Berlin and speak English and German most of th etime :P
number-six has joined #nanoc
<jd_>
ok, what would be the best way to access the in memory representation of an article then? I remembered seeing a deprecation message yesterday about the :file attribute
<ddfreyne>
jd_: a Nanoc::Item has .content, .attributes and .identifier that you can change
<jd_>
excellent
<ddfreyne>
.raw_content, rather
<ddfreyne>
(a String)
<ddfreyne>
@items['/moo/'].raw_content = 'ohai'
alerante has quit []
<jd_>
it seems to work pretty well :) just have to figure how to inject \n and \s chars in ruby
<ddfreyne>
jd_: Literal \n or do you mean a newline?
<jd_>
a newline
<ddfreyne>
Not sure what \s is...
<jd_>
no literals
<ddfreyne>
jd_: a double-quoted string that contains \n will have a newline
<ddfreyne>
"foo\nbar" <- foo newline bar
<ddfreyne>
'foo\nbar' <- literal \n
<jd_>
a space (I said \s because that's how I matched them to begin with, but actually, I want to gsub some chunk with another containing both a newline and some spaces)
<jd_>
thank you very much
<ddfreyne>
you're welcome
<jd_>
that's very excellent: Slim markup with markdown paragraphs :)
<jd_>
I like it, thank you ddfreyne and nanoc
alerante has joined #nanoc
VitamineD has joined #nanoc
<ddfreyne>
:)
<bobthecow>
ddfreyne: have you played with Objective-Smalltalk at all?
<ddfreyne>
bobthecow: Nope
<ddfreyne>
I haven't used Cocoa in many years and I'm done with Smalltalk for the time being :P
<jd_>
the guy, momolog, talks about a "filter" keyword in nanoc, but my nanoc (last version) does not know about it
<jd_>
so I wonder if it is something he coded, that is a custom method taking the filter as an argument, or if it was available at some point then deprecated/removed…
number-six has quit [Remote host closed the connection]
<jd_>
In the mean time, I solved my problem by leveraging the engine backing my would-be filter directly in the preprocessor (in my case, Kramdown::Document)
<jd_>
in fact, it's perfect, since I don't want to make an explicit call to that engine/filter to begin with :)
<jd_>
but good to know, thx
<bobthecow>
jd_: yeah, that's the preferred way. the filtering helper works, but it's less nanocy.
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]