Module: Asciidoctor::Diagram::Ditaa::DitaaSource
- Defined in:
- lib/asciidoctor-diagram/ditaa/extension.rb
Constant Summary collapse
- OPTIONS =
{ 'scale' => lambda { |o, v| o << '--scale' << v if v }, 'tabs' => lambda { |o, v| o << '--tabs' << v if v }, 'background' => lambda { |o, v| o << '--background' << v if v }, 'antialias' => lambda { |o, v| o << '--no-antialias' if v == 'false' }, 'separation' => lambda { |o, v| o << '--no-separation' if v == 'false'}, 'round-corners' => lambda { |o, v| o << '--round-corners' if v == 'true'}, 'shadows' => lambda { |o, v| o << '--no-shadows' if v == 'false'}, 'debug' => lambda { |o, v| o << '--debug' if v == 'true'}, 'fixed-slope' => lambda { |o, v| o << '--fixed-slope' if v == 'true'}, 'transparent' => lambda { |o, v| o << '--transparent' if v == 'true'} }
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #create_image_metadata ⇒ Object
- #init_ditaa_options(parent, attributes) ⇒ Object
- #should_process?(image_file, image_metadata) ⇒ Boolean
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
49 50 51 |
# File 'lib/asciidoctor-diagram/ditaa/extension.rb', line 49 def @options end |
Instance Method Details
#create_image_metadata ⇒ Object
81 82 83 84 85 |
# File 'lib/asciidoctor-diagram/ditaa/extension.rb', line 81 def = super ['options'] = @options end |
#init_ditaa_options(parent, attributes) ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/asciidoctor-diagram/ditaa/extension.rb', line 64 def (parent, attributes) global_attributes = parent.document.attributes = [] OPTIONS.keys.each do |key| value = attributes.delete(key) || global_attributes["ditaa-option-#{key}"] OPTIONS[key].call(, value) end @options = .join(' ') end |
#should_process?(image_file, image_metadata) ⇒ Boolean
77 78 79 |
# File 'lib/asciidoctor-diagram/ditaa/extension.rb', line 77 def should_process?(image_file, ) super(image_file, ) || ['options'] != @options end |