Skip to content

Commit

Permalink
allow for Linewise Rouge formatter
Browse files Browse the repository at this point in the history
Rouge can produce an output with divs around each line. This allows you to select that as an option.
  • Loading branch information
alexkunger committed Feb 6, 2020
1 parent 3430bce commit c6275d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/middleman-syntax/formatters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ def initialize(opts={})
end

@formatter = Rouge::Formatters::HTMLTable.new(@formatter, opts) if opts[:line_numbers]

@formatter = Rouge::Formatters::HTMLLinewise.new(@formatter, class='line-%i') if opts[:line_numbers_div]

if opts.fetch(:wrap, true)
@formatter = Rouge::Formatters::HTMLPygments.new(@formatter, opts.fetch(:css_class, 'codehilite'))
Expand Down

0 comments on commit c6275d2

Please sign in to comment.