HTML::Pipeline::RougeFilter 
Rouge integration for HTML::Pipeline.
This RubyGem requires Ruby 2.0+.
Installation
Add this line to your application's Gemfile:
gem 'html-pipeline-rouge_filter'
And then execute:
$ bundle
Or install it yourself as:
$ gem install html-pipeline-rouge_filter
Usage
require 'html/pipeline'
require 'html/pipeline/rouge_filter'
pipeline = HTML::Pipeline.new [
HTML::Pipeline::MarkdownFilter,
HTML::Pipeline::RougeFilter
]
result = pipeline.call "\n ```ruby\n def foo\n puts \"foo\"\n end\n ```\n\n CODE\n\nputs result[:output]\n".gsub(/^\s*/,'')
Prints (without the linebreaks):
<pre class="highlight highlight-ruby">
<code>
<span class="k">def</span>
<span class="nf">foo</span>
<span class="nb">puts</span>
<span class="s2">"foo"</span>
<span class="k">end</span>
</code>
</pre>
You can specify following options in context hash:
line_numbers: Line numbers will be displayed if set to true.
replace_br: <br> tags in the code will be replaced with new line characters (\n) if set to true.
Contributing
- Fork it ( https://github.com/juanitofatas/html-pipeline-rouge_filter/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request