trulia / hologram

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

custom templates #201

Closed cyril-lamotte closed 9 years ago

cyril-lamotte commented 9 years ago

First, "great job" for this project !

Then, I don't understand how to add custom template

I created _colortemplate.html.erb but I don't see how to apply it. Do I need to code in ruby ?

In my Scss code :

/*doc

---
title: Colors
name: brand
category: Colors

---
``html_example_color
#3a65c4
``
*/

Is html_example_color correct ?

gpleiss commented 9 years ago

You need to add some ruby code as well. You should have to create a html_color_renderer.rb in the code_example_renderers folder. See the example here: https://github.com/trulia/hologram#custom-code-example-renderers

In addition, in your scss file, the example should be an html_color_example, not html_example_color.

cyril-lamotte commented 9 years ago

1/ I created _html_colorrenderer.rb :

Hologram::CodeExampleRenderer::Factory.define('color') do
  example_template 'color_template'
end

Is it correct ?

2/ color_template.html.erb

3/ Added comment In SASS :

/*doc
---
title: Colors
name: brand
category: Colors
---
``html_color_example
#3a65c4
``
*/

Where do you think I'm wrong ?

cyril-lamotte commented 9 years ago

Ok it's color_example

/*doc
---
title: Colors
name: brand
category: Colors
---
``color_example
#3a65c4
``
*/