class Asciidoctor::RougeExt::Formatters::HTMLLineHighlighter
Public Class Methods
new(delegate, opts)
click to toggle source
# File lib/asciidoctor/rouge_ext.rb, line 22 def initialize delegate, opts @delegate = delegate @lines = opts[:lines] || [] end
Public Instance Methods
stream(tokens) { |include? lineno += 1| ... }
click to toggle source
# File lib/asciidoctor/rouge_ext.rb, line 27 def stream tokens lineno = 0 token_lines tokens do |tokens_in_line| yield (@lines.include? lineno += 1) ? %(<span class="hll">#{@delegate.format tokens_in_line}#{LF}</span>) : %(#{@delegate.format tokens_in_line}#{LF}) end end