Class: Asciidoctor::Diagram::BpmnConverter

Inherits:
Object
  • Object
show all
Includes:
CliGenerator, DiagramConverter
Defined in:
lib/asciidoctor-diagram/bpmn/converter.rb

Instance Method Summary collapse

Methods included from CliGenerator

#generate_file, #generate_file_stdout, #generate_stdin, #generate_stdin_file, #generate_stdin_stdout

Methods included from DiagramConverter

#native_scaling?, #wrap_source

Instance Method Details

#collect_options(source) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/asciidoctor-diagram/bpmn/converter.rb', line 18

def collect_options(source)
  options = {}

  options[:width] = source.attr('width')
  options[:height] = source.attr('height')

  options
end

#convert(source, format, options) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/asciidoctor-diagram/bpmn/converter.rb', line 27

def convert(source, format, options)
  opts = {}

  opts[:width] = options[:width]

  bpmnjs = source.find_command('bpmn-js')
  opts[:height] = options[:height]
  opts[:theme] = options[:theme]
  config = options[:config]
  if config
    opts[:config] = source.resolve_path(config)
  end
  run_bpmnjs(bpmnjs, source, format, opts)
end

#supported_formatsObject



14
15
16
# File 'lib/asciidoctor-diagram/bpmn/converter.rb', line 14

def supported_formats
  [:png, :svg, :pdf, :jpeg]
end