Class: Asciidoctor::Diagram::DiagramBlockMacroProcessor

Inherits:
Extensions::BlockMacroProcessor
  • Object
show all
Includes:
DiagramProcessor
Defined in:
lib/asciidoctor-diagram/diagram_processor.rb

Overview

Base class for diagram block macro processors.

Constant Summary

Constants included from DiagramProcessor

Asciidoctor::Diagram::DiagramProcessor::IMAGE_PARAMS, Asciidoctor::Diagram::DiagramProcessor::TEXT_FORMATS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from DiagramProcessor

included, #process

Class Method Details

.inherited(subclass) ⇒ Object



389
390
391
392
# File 'lib/asciidoctor-diagram/diagram_processor.rb', line 389

def self.inherited(subclass)
  subclass.use_dsl
  subclass.name_positional_attributes ['format']
end

Instance Method Details

#apply_target_subs(parent, target) ⇒ Object



394
395
396
397
398
399
400
# File 'lib/asciidoctor-diagram/diagram_processor.rb', line 394

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.

Returns:



405
406
407
# File 'lib/asciidoctor-diagram/diagram_processor.rb', line 405

def create_source(parent, target, attributes)
  FileSource.new(self, parent, apply_target_subs(parent, target), attributes)
end