lutaml / lutaml-uml

UML module for LutaML
2 stars 2 forks source link

lutaml2dotpng script, small fixes #53

Closed w00lf closed 3 years ago

w00lf commented 3 years ago

metanorma/basicdoc-models#17 Script to convert wsd files(plantuml) in to lutaml, fixes lutaml2dotpng script, render data_types/primitives graphviz, support for windows line endings - \r\n

ronaldtse commented 3 years ago

@w00lf can you:

  1. Move lutaml2dotpng code into lutaml command:
    
    lutaml -t dot -o my-lutaml-file.dot my-lutaml-file.lml
    dot -T png my-lutaml-file.dot > my-lutaml-file.png

or just

lutaml -t my-lutaml-file.png --via=dot my-lutaml-file.lml


2. Use the `ruby-graphviz` gem instead of calling `dot` directly?
https://github.com/glejeune/Ruby-Graphviz#synopsis
```ruby
    require 'ruby-graphviz'

    # In this example, hello.dot is :
    #   digraph G {Hello->World;}

    GraphViz.parse( "hello.dot", :path => "/usr/local/bin" ) { |g|
      g.get_node("Hello") { |n|
        n[:label] = "Bonjour"
      }
      g.get_node("World") { |n|
        n[:label] = "Le Monde"
      }
    }.output(:png => "sample.png")

Thanks!

w00lf commented 3 years ago

@w00lf can you:

  1. Move lutaml2dotpng code into lutaml command:
lutaml -t dot -o my-lutaml-file.dot my-lutaml-file.lml
dot -T png my-lutaml-file.dot > my-lutaml-file.png

# or just
lutaml -t my-lutaml-file.png --via=dot my-lutaml-file.lml
  1. Use the ruby-graphviz gem instead of calling dot directly? https://github.com/glejeune/Ruby-Graphviz#synopsis
    require 'ruby-graphviz'

    # In this example, hello.dot is :
    #   digraph G {Hello->World;}

    GraphViz.parse( "hello.dot", :path => "/usr/local/bin" ) { |g|
      g.get_node("Hello") { |n|
        n[:label] = "Bonjour"
      }
      g.get_node("World") { |n|
        n[:label] = "Le Monde"
      }
    }.output(:png => "sample.png")

Thanks!

Removed this script completely, we can use lutaml-uml script instead