https://github.com/stefafafan/closure2wbs
A cli tool to convert closure tables to a WBS representation (PlantUML or Mermaid).
https://github.com/stefafafan/closure2wbs
cli closure-table mermaid plantuml wbs
Last synced: 4 months ago
JSON representation
A cli tool to convert closure tables to a WBS representation (PlantUML or Mermaid).
- Host: GitHub
- URL: https://github.com/stefafafan/closure2wbs
- Owner: stefafafan
- License: mit
- Created: 2024-11-06T07:44:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-31T06:04:08.000Z (about 1 year ago)
- Last Synced: 2025-04-06T19:05:50.108Z (about 1 year ago)
- Topics: cli, closure-table, mermaid, plantuml, wbs
- Language: Rust
- Homepage:
- Size: 82 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# closure2wbs
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!
## Installation
Assuming you have `cargo` setup:
```sh
cargo install --git https://github.com/stefafafan/closure2wbs
```
## Usage
Try `--help`
```sh
$ closurewbs --help
A cli tool to convert closure tables to a WBS representation.
Usage: closure2wbs [OPTIONS]
Options:
-f, --format [default: plantuml]
-i, --input [default: input.json]
-o, --output [default: output.txt]
-h, --help Print help
-V, --version Print version
```
### Example
Prepare a json file like following:
```json
[
{
"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.
```sh
closure2wbs --input input.json --output out.puml --format plantuml
```
`out.puml` contents will be like as the following.
```pml
@startwbs
* A
** B
*** D
*** E
** C
@endwbs
```
Mermaid output is supported as well:
```sh
closure2wbs --input input.json --output out.mmd --format mermaid
```
```mermaid
flowchart TD
A --> B
B --> D
B --> E
A --> C
```