Class: Asciidoctor::Standoc::PlantUMLBlockMacro

Inherits:
Extensions::BlockProcessor
  • Object
show all
Defined in:
lib/asciidoctor/standoc/macros.rb

Instance Method Summary collapse

Instance Method Details

#abort(parent, reader, attrs, msg) ⇒ Object



243
244
245
246
247
248
# File 'lib/asciidoctor/standoc/macros.rb', line 243

def abort(parent, reader, attrs, msg)
  # TODO: Abort should really raise an error
  warn msg
  attrs["language"] = "plantuml"
  create_listing_block parent, reader.source, attrs.reject { |k, v| k == 1 }
end

#process(parent, reader, attrs) ⇒ Object



250
251
252
253
254
255
256
257
258
# File 'lib/asciidoctor/standoc/macros.rb', line 250

def process(parent, reader, attrs)
  PlantUMLBlockMacroBackend.plantuml_installed? or
    return abort(parent, reader, attrs, "PlantUML not installed")
  filename = PlantUMLBlockMacroBackend.generate_file(parent, reader) or
    return abort(parent, reader, attrs, "Failed to process PlantUML")
  through_attrs = PlantUMLBlockMacroBackend.generate_attrs attrs
  through_attrs["target"] = filename
  create_image_block parent, through_attrs
end