Class: Metanorma::Standoc::EditorInlineAdmonitionBlock

Inherits:
Asciidoctor::Extensions::Treeprocessor
  • Object
show all
Defined in:
lib/metanorma/standoc/macros_note.rb

Instance Method Summary collapse

Instance Method Details

#process(document) ⇒ Object



55
56
57
58
59
60
61
62
63
64
# File 'lib/metanorma/standoc/macros_note.rb', line 55

def process(document)
  (document.find_by context: :paragraph).each do |para|
    next unless /^EDITOR: /.match? para.lines[0]

    para.set_attr("name", "editorial")
    para.set_attr("caption", "EDITOR")
    para.lines[0].sub!(/^EDITOR: /, "")
    para.context = :admonition
  end
end