Class: Metanorma::Standoc::ToDoInlineAdmonitionBlock

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



17
18
19
20
21
22
23
24
25
26
# File 'lib/metanorma/standoc/macros_note.rb', line 17

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

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