Skip to content

heredoc breaks rocco #40

Closed
nstielau opened this Issue Apr 12, 2011 · 5 comments

3 participants

@nstielau

Hey,

I've looked at this for a while, but don't have a great solution and am moving on. Something as simple as

heredoc <<-EOH
# comment
code
EOH

will break rocco. The 'code' for this section ends up being nil, after the "docs_html.zip(code_html)" runs, and layout.rb breaks with bad nil checks. The simple fix is to do better nil checks in layout.rb, specifically for 'code?' and 'empty?' in the sections method.

@rtomayko
Owner

I've seen this as well. It's a pretty hard problem to solve for the current implementation. We'd almost need a language parsetree to handle it properly.

@nstielau

Yeah, that's about where I got. If the root cause is tough, what do you think about adding better nil checks and printing a warning to stderr? It's a pain that rocco a) breaks when it doesn't need to, and b) leads down a rabbithole to rdiscount's C. I'll make an attempt if you're interested.

p.s. I'm working on something to Rocco-ize a whole Chef repo (http://wiki.opscode.com/display/chef/Chef+Repository), I'm loving the *occo documentation style and tools. Thanks.

@mikewest mikewest was assigned Apr 13, 2011
@mikewest
Collaborator

Breaking things is bad. I also don't have any good ideas about a real solution... That said, I'll take a look at layout.rb right now to see about making things less broken.

@mikewest
Collaborator

I lied. I'll commit a fake solution in a moment. Please test it for me. :)

@nstielau

Hey,
Works for my files that were failing before. Thanks for the fast turnaround. Lemme know if there is anything else I can to do help.

@nstielau nstielau closed this Aug 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.