Class: Neo4j::AsciidoctorExtensions::InlineHighlighter::SrcInlineMacro

Inherits:
Extensions::InlineMacroProcessor
  • Object
show all
Defined in:
lib/neo4j/asciidoctor/extensions/inline_highlighter_rouge/extension.rb

Overview

Apply syntax highlighting on src inline macro:

Usage:

# src:cypher[MATCH (c:Customer ‘ABCCO’) RETURN c.BOUGHT.productName]

Instance Method Summary collapse

Instance Method Details

#process(parent, target, attrs) ⇒ Object



55
56
57
58
# File 'lib/neo4j/asciidoctor/extensions/inline_highlighter_rouge/extension.rb', line 55

def process(parent, target, attrs)
  new_text = InlineHighlighter.highlight_code(target, attrs[:content], parent.document)
  create_inline_pass parent, %(<code class="rouge">#{new_text}</code>), attrs
end