New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hologram always assumes ERB files should be executed #123
Comments
Ah thanks for the info. We might be able to handle this using some config flags. I'll think about this for a little while and see if we can get a point release with a fix this week, Config idea for now:
By default we would not process erb files, but if the config flag is set we will process everything that is not listed in the excludes list. |
You could also probably add an
Then test it with |
Went with:
|
Went with:
|
1 similar comment
Went with:
|
Hey, thanks for taking care of this. |
NP! Sorry for the triple comment, not sure what I was doing when that happened. |
Adding the
In my case, I have |
The problematic code seems to be this: https://github.com/trulia/hologram/blob/master/lib/hologram/doc_parser.rb#L89 Am I correct in understanding that |
This might be a bit tricky to get right, but it appears that as of v1.1.0, Hologram assumes that any ERB file should be executed to generate a page in the style guide.
This probably makes sense if you're using it to generate a sample JSON file to give some JS something to play with, but it breaks Rails assets that use ERB. For instance, one might have a file like
sprites.css.erb
, which is a CSS file that relies on Rails helpers.If any files like this exist in the directory specified by
source
in the yaml config, Hologram will either generate asprites.css
file indestination
directory, or crash if the file needs any Rails helpers.Perhaps Hologram's
DocBuilder
could only callwrite_erb
if the file looks like it's either a straight ERB file, ie:readme.erb
or an html erb file likereadme.html.erb
, and just document the file otherwise.The text was updated successfully, but these errors were encountered: