Class: Asciidoctor::Diagram::DiagramInlineMacroProcessor
- Inherits:
-
Extensions::InlineMacroProcessor
- Object
- Extensions::InlineMacroProcessor
- Asciidoctor::Diagram::DiagramInlineMacroProcessor
show all
- Includes:
- DiagramProcessor
- Defined in:
- lib/asciidoctor-diagram/diagram_processor.rb
Overview
Base class for diagram inline macro processors.
Direct Known Subclasses
AsciiToSvgInlineMacroProcessor, BarcodeInlineMacroProcessor, BpmnInlineMacroProcessor, BytefieldInlineMacroProcessor, D2InlineMacroProcessor, DbmlInlineMacroProcessor, DiagramsInlineMacroProcessor, DitaaInlineMacroProcessor, DpicInlineMacroProcessor, ErdInlineMacroProcessor, GnuplotInlineMacroProcessor, GraphvizInlineMacroProcessor, GraphvizPyInlineMacroProcessor, LilypondInlineMacroProcessor, MemeInlineMacroProcessor, MermaidInlineMacroProcessor, MscInlineMacroProcessor, NomnomlInlineMacroProcessor, PenroseInlineMacroProcessor, PikchrInlineMacroProcessor, PlantUmlInlineMacroProcessor, SaltInlineMacroProcessor, ShaapeInlineMacroProcessor, SmcatInlineMacroProcessor, SvgBobInlineMacroProcessor, SymbolatorInlineMacroProcessor, SyntraxInlineMacroProcessor, TikZInlineMacroProcessor, UmletInlineMacroProcessor, VegaInlineMacroProcessor, WavedromInlineMacroProcessor
Constant Summary
Asciidoctor::Diagram::DiagramProcessor::IMAGE_PARAMS, Asciidoctor::Diagram::DiagramProcessor::TEXT_FORMATS
Class Method Summary
collapse
Instance Method Summary
collapse
included
Class Method Details
.inherited(subclass) ⇒ Object
414
415
416
|
# File 'lib/asciidoctor-diagram/diagram_processor.rb', line 414
def self.inherited(subclass)
subclass.name_positional_attributes ['format']
end
|
Instance Method Details
#apply_target_subs(parent, target) ⇒ Object
418
419
420
421
422
423
424
|
# File 'lib/asciidoctor-diagram/diagram_processor.rb', line 418
def apply_target_subs(parent, target)
if target
parent.normalize_system_path(parent.sub_attributes(target, :attribute_missing => 'warn'))
else
nil
end
end
|
#create_source(parent, target, attributes) ⇒ FileSource
Creates a FileSource using target as the file name.
451
452
453
|
# File 'lib/asciidoctor-diagram/diagram_processor.rb', line 451
def create_source(parent, target, attributes)
FileSource.new(self, parent, apply_target_subs(parent, target), attributes)
end
|
#generate_block ⇒ Object
426
|
# File 'lib/asciidoctor-diagram/diagram_processor.rb', line 426
alias_method(:generate_block,:process)
|
#process(parent, reader_or_target, attributes) ⇒ Object
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
|
# File 'lib/asciidoctor-diagram/diagram_processor.rb', line 428
def process(parent, reader_or_target, attributes)
block = generate_block(parent, reader_or_target, attributes)
attrs = block.attributes.dup
target = attrs.delete('target')
attrs.delete('subs')
if block.context == :image
create_inline(parent, :image, nil, :type => 'image', :target => target, :attributes => attrs)
else
create_inline(parent, :quoted, block.source, :type => :monospaced, :attributes => attrs)
end
end
|
444
445
446
|
# File 'lib/asciidoctor-diagram/diagram_processor.rb', line 444
def supported_formats(converter)
converter.supported_formats.reject { |f| TEXT_FORMATS.include?(f) }
end
|