Class: Asciidoctor::Standoc::PlantUMLBlockMacro

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

Instance Method Summary collapse

Instance Method Details

#process(parent, reader, attrs) ⇒ Object



111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/asciidoctor/standoc/macros.rb', line 111

def process(parent, reader, attrs)
  if PlantUMLBlockMacroBackend.plantuml_installed?
    filename = PlantUMLBlockMacroBackend.generate_file parent, reader
    through_attrs = PlantUMLBlockMacroBackend.generate_attrs attrs
    through_attrs["target"] = "plantuml/#{filename}.png"
    create_image_block parent, through_attrs
  else
    warn "PlantUML not installed"
    # attrs.delete(1) : remove the style attribute
    attrs["language"] = "plantuml"
    create_listing_block parent, reader.source, attrs.reject { |k, v| k == 1 }
  end
end