trulia / hologram

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

Improve structure and semantics of output #219

Open chris-canipe opened 9 years ago

chris-canipe commented 9 years ago

It would be great if individual sections were sectioned in the output. It would improve the structure and semantics while offering better ways to scope CSS or JS.

For example, the markup of this page takes the general form of...

  1. Heading (<h1>)
  2. Content (<p>, etc.)
  3. Heading (<h1>)
  4. Content (<p>, etc.)

...and I propose a sectioned approach like:

  1. Section (<section>)
    1. Heading (<h1>)
    2. Content (<p>, etc.)
  2. Section (<section>)
    1. Heading (<h1>)
    2. Content (<p>, etc.)
lifeiscontent commented 9 years ago

even better, allow for a custom template to wrap around the generated content

rishabh-ink commented 9 years ago

This is possible by using a custom renderer. See the example_markdown_renderer on how to customize the output. You also need to set the custom_markdown property to point to your custom renderer file in the Hologram config file.

wilson-huynh-webjet commented 8 years ago

Sorry I'm new to this. I tried the example_markdown_renderer.rb and get error: " uninitialized constant ExampleMarkdownRenderer::Pygments (NameError)" Can you please tell me if I miss any thing?

ffoodd commented 8 years ago

May I ask for help in this too?

I don't see anything like headings in the example renderer you're linking too, but only code example blocks. Am I missing something?

Thanks :)

rishabh-ink commented 8 years ago

@wilson-huynh-webjet @ffoodd Sorry for the delayed reply; didn't see the notification. In a theme that I created for Hologram, voxel-hologram, I was able to wrap each code snippet and example in a custom wrapper element. Please see markup_example_template.html.erb.

The file name, markup_example_template, is used by the HTML renderer in Hologram. See the section Creating a YAML config file.

Please share a link to your repo where you're trying this out. I'll be able to understand your problem better and help out. Thanks!