trulia / hologram

A markdown based documentation system for style guides.

Home Page:http://trulia.github.io/hologram

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Syntax highlighting in Code Blocks without example

philipisik opened this issue · comments

Hi,

is it possible to get html syntax highlighting in a code block without example? Like:

/*doc


title: Title
name: name
category: category


`<div class="html-example"></div>`

*/

commented

@philipisik yes you just need to write a custom renderer or only allow your template to output the code example without the preview.

here's a sass code_example_renderer that I've written.

Hologram::CodeExampleRenderer::Factory.define 'sass' do
  example_template 'sass_example_template'
  table_template 'sass_table_template'
  lexer { Rouge::Lexer.find('sass') }
end

and then in the templates dir I just provide the sass_example_template and the sass_table_template