mdc/lib/rendering/renderer.rb
##
# Render an UML inline diagram using an external tool
# @param [String] picture_name name of the picture
# @param [String] contents the embedded UML
# @param [String] type the generated file type (svg, pdf, png)
# @param [String] _width_slide width of the diagram on slides
# @param [String] _width_plain width of the diagram on plain documents
Render an UML inline diagram using an external tool
Render an UML inline diagram using an external tool
def uml(picture_name, contents, _width_slide, _width_plain, type = 'pdf')
      begin
        Dir.mkdir(@temp_dir)
      rescue StandardError
      end
      base_name = picture_name.tr(' ', '_').downcase
      img_file    = "#{@image_dir}/#{base_name}.#{type}"
      uml_file    = "#{@temp_dir}/#{base_name}.uml"
      dot_file    = "#{@temp_dir}/#{base_name}.dot"
      result_file = "#{@result_dir}/#{img_file}"
      File.write(uml_file, contents)
      puts "#{$project_path}/umlifier/bin/main.rb #{uml_file} #{dot_file} #{result_file} #{type}"
      `ruby #{$project_path}/umlifier/bin/main.rb #{uml_file} #{dot_file} #{result_file} #{type}`
      img_file
    end
def uml ( picture_name , contents , _width_slide , _width_plain , type = 'pdf' ) begin Dir . mkdir ( @temp_dir ) rescue StandardError end base_name = picture_name . tr ( ' ' , '_' ) . downcase img_file = "#{@image_dir}/#{base_name}.#{type}" uml_file = "#{@temp_dir}/#{base_name}.uml" dot_file = "#{@temp_dir}/#{base_name}.dot" result_file = "#{@result_dir}/#{img_file}" File . write ( uml_file , contents ) puts "#{$project_path}/umlifier/bin/main.rb #{uml_file} #{dot_file} #{result_file} #{type}" ` ruby  #{ $project_path } /umlifier/bin/main.rb  #{ uml_file } #{ dot_file } #{ result_file } #{ type } ` img_file end
Render an UML inline diagram using an external tool
Render an UML inline diagram using an external tool
# ignored # write uml to file # generate image
picture_name
<not_specific>
contents
<not_specific>
_width_slide
<not_specific>
_width_plain
<not_specific>
type
<not_specific>
<not_specific>
_width_plain width of the diagram on plain documents
_width_plain width of the diagram on plain documents