Skip to content
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

Syntax highlighting in Code Blocks without example #222

Open
philipisik opened this issue Apr 9, 2015 · 1 comment
Open

Syntax highlighting in Code Blocks without example #222

philipisik opened this issue Apr 9, 2015 · 1 comment

Comments

@philipisik
Copy link

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>`

*/

@lifeiscontent
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants