class Metanorma::Standoc::PlantUMLBlockMacro

Public Instance Methods

abort(parent, reader, attrs, msg) click to toggle source
# File lib/metanorma/standoc/macros_plantuml.rb, line 95
def abort(parent, reader, attrs, msg)
  warn msg
  attrs["language"] = "plantuml"
  create_listing_block parent, reader.source,
                       (attrs.reject { |k, _v| k == 1 })
end
process(parent, reader, attrs) click to toggle source
# File lib/metanorma/standoc/macros_plantuml.rb, line 102
def process(parent, reader, attrs)
  PlantUMLBlockMacroBackend.plantuml_installed?
  filename = PlantUMLBlockMacroBackend.generate_file(parent, reader)
  through_attrs = PlantUMLBlockMacroBackend.generate_attrs attrs
  through_attrs["target"] = filename
  create_image_block parent, through_attrs
rescue StandardError => e
  abort(parent, reader, attrs, e.message)
end