Class: MermaidPDFTreeProcessor

Inherits:
Asciidoctor::Extensions::TreeProcessor
  • Object
show all
Defined in:
lib/asciidoctor-mermaid/pdf.rb

Instance Method Summary collapse

Instance Method Details

#process(document) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/asciidoctor-mermaid/pdf.rb', line 8

def process(document)
  document.blocks.map! do |block|
    if block.respond_to?(:blocks) && !block.blocks.empty?
      process(block)
    elsif block.respond_to?(:attributes) &&
         block.attributes['style'] === 'source' &&
         block.attributes['language'] === 'mermaid'
      self.convert_block(block)
    else
      block
    end
  end
  document
end