trulia / hologram

A markdown based documentation system for style guides.
http://trulia.github.io/hologram
Other
2.16k stars 199 forks source link

Templating support instead of polluting CSS with HTML #199

Closed robhrt7 closed 9 years ago

robhrt7 commented 9 years ago

Hi,

Does hologram supports, or plan to support templates include from CSS comments? Like

/*
My example

\```html_example
    @inclute template.hbs
\```
*/

HTML placed in CSS comments is hard to maintain, and easpecially keep up to date, because of you're always forced to copy paste it from real codebase to comments. Also, you don't have any syntax highlight and writing bigger chunks of HTML examples will bloat your CSS.

jdcantrell commented 9 years ago

I don't know if we'll ever support this out of the box. Before we built hologram we had a styleguide system that worked very similar to this, and at that time we decided we wanted our documentation to be as close as possible to the css (mostly to lower the cost of writing new examples). Additionally, we use a pre-processor to strip all comments and whitespace from our css before shipping to production (sass can do this for you, for pure css I'm not sure what tools are available).

All that said, you should be able to achieve this using a custom renderer. At the moment though I don't have an example of one that loads templates.

jdcantrell commented 9 years ago

I am going to close this for now. I'm open to PRs regarding this issue, but I don't think I want to implement it directly in hologram at this point.