closure2wbs is a cli tool for converting a list of closure tables to a WBS structure for PlantUML or Mermaid. Currently, the tool assumes a JSON file input, and outputs to file.
Warning
This cli tool is not thoroughly tested!
Assuming you have cargo
setup:
cargo install --git https://github.com/stefafafan/closure2wbs
Try --help
$ closurewbs --help
A cli tool to convert closure tables to a WBS representation.
Usage: closure2wbs [OPTIONS]
Options:
-f, --format <FORMAT> [default: plantuml]
-i, --input <INPUT> [default: input.json]
-o, --output <OUTPUT> [default: output.txt]
-h, --help Print help
-V, --version Print version
Prepare a json file like following:
[
{
"ancestor": "A",
"descendant": "A",
"depth": 0
},
{
"ancestor": "A",
"descendant": "B",
"depth": 1
},
{
"ancestor": "A",
"descendant": "C",
"depth": 1
},
{
"ancestor": "A",
"descendant": "D",
"depth": 2
},
{
"ancestor": "A",
"descendant": "E",
"depth": 2
},
{
"ancestor": "B",
"descendant": "B",
"depth": 0
},
{
"ancestor": "B",
"descendant": "D",
"depth": 1
},
{
"ancestor": "B",
"descendant": "E",
"depth": 1
},
{
"ancestor": "C",
"descendant": "C",
"depth": 0
}
]
Run the cli tool.
closure2wbs --input input.json --output out.puml --format plantuml
out.puml
contents will be like as the following.
@startwbs
* A
** B
*** D
*** E
** C
@endwbs
Mermaid output is supported as well:
closure2wbs --input input.json --output out.mmd --format mermaid
flowchart TD
A --> B
B --> D
B --> E
A --> C