Sha256: 3a39db18cbad18f0246de4bbd97a26bc4de94f64636e7f7e101507b33e49fd1e
Contents?: true
Size: 1.79 KB
Versions: 2
Compression:
Stored size: 1.79 KB
Contents
# CommonMarker+Rouge [](https://rubygems.org/gems/commonmarker-rouge) [](https://travis-ci.org/sandfoxme/commonmarker-rouge) [](https://codeclimate.com/github/sandfoxme/commonmarker-rouge) [](https://codeclimate.com/github/sandfoxme/commonmarker-rouge/coverage) [](https://gemnasium.com/sandfoxme/commonmarker-rouge) A [CommonMarker](https://rubygems.org/gems/commonmarker) wrapper with syntax highlight support by [Rouge](https://rubygems.org/gems/rouge). ## Installation Add these lines to your application's Gemfile: ```ruby gem 'commonmarker-rouge' ``` ## Usage ```ruby # use default CommonMarker class and Rouge::Formatters::HTML formatter CommonMarker::Rouge.render_html(content) # get CommonMarker parsed AST CommonMarker::Rouge.render_doc(content) # pass options to CommonMarker CommonMarker::Rouge.render_html(content, [:SAFE, :SOURCEPOS]) # use custom CommonMarker wrapper (must provide compatible render_doc) CommonMarker::Rouge.render_html(content, cmark_class: CommonMarkerWrapper) # use custom Rouge formatter CommonMarker::Rouge.render_html(content, formatter: Rouge::Formatters::HTMLLinewise) # pass some options to Rouge CommonMarker::Rouge.render_html(content, options: { css_class: 'custom-class' }) ``` ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
commonmarker-rouge-1.3.0 | README.md |
commonmarker-rouge-1.2.0 | README.md |