diff --git a/.gitignore b/.gitignore index f24d6d7..b69978c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ venv/* __pycache__ test/* -launch.json \ No newline at end of file +launch.json +lab-examples/** \ No newline at end of file diff --git a/README.md b/README.md index 5d96967..33c0b8a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ The `clab-io-draw` project unifies two tools, `clab2drawio` and `drawio2clab`. These tools facilitate the conversion between [Containerlab](https://github.com/srl-labs/containerlab) YAML files and Draw.io diagrams, making it easier for network engineers and architects to visualize, document, and share their network topologies. -![Drawio Example](docs/img/drawio1.png) +![Drawio Example](docs/img/modern_dark.png) ## clab2drawio @@ -18,6 +18,12 @@ For more details on `drawio2clab`, including features, constraints for drawing, ## Quick Usage +### Running with Containerlab +```bash +containerlab graph --drawio -t topo.yml +containerlab graph --drawio -t topo.drawio +``` + ### Running with Docker To simplify dependency management and execution, the tools can be run inside a Docker container. Follow these instructions to build and run the tool using Docker. @@ -92,7 +98,6 @@ python clab2drawio.py -i ``` `-i, --input`: Specifies the path to your input YAML file. -`-o, --output`: Specifies the path for the output drawio file. Make sure to replace `` with the path to your .drawio file For more comprehensive guidance, including additional command-line options, please see the Usage section in [clab2drawio.md](docs/clab2drawio.md#usage) diff --git a/docs/clab2drawio.md b/docs/clab2drawio.md index 94f1c3c..1ddbb53 100644 --- a/docs/clab2drawio.md +++ b/docs/clab2drawio.md @@ -78,7 +78,7 @@ Using graph-level helps manage the vertical alignment of nodes in the generated - `--layout`: Specifies the layout of the topology diagram (either `vertical` or `horizontal`). The default layout is `vertical`. -- `--theme`: Specifies the theme for the diagram (`nokia_bright` or `nokia_dark`) or the path to a custom style config file. By default, the `bright` theme is used. Users can also create their own style file and place it in any directory, specifying its path with this option. Feel free to contribute your own styles. +- `--theme`: Specifies the theme for the diagram (`nokia_bright`, `nokia_dark`, or ... ) or the path to a custom style config file. By default, the `bright` theme is used. Users can also create their own style file and place it in any directory, specifying its path with this option. Feel free to contribute your own styles. ```bash python clab2drawio.py --theme nokia_dark -i @@ -139,6 +139,8 @@ Below are some example images of the available custom styles: +**_NOTE:_** drawio diagrams created with default_labels: true, cannot be used by drawio2clab + ### Custom Styles To customize styles, you can edit or copy the `nokia_bright.yaml` configuration file. This file defines the base style, link style, source and target label styles, and custom styles for different types of nodes based on their roles (e.g., routers, switches, servers). diff --git a/styles/nokia_modern_bright.yaml b/styles/nokia_modern_bright.yaml index c650c40..f594a22 100644 --- a/styles/nokia_modern_bright.yaml +++ b/styles/nokia_modern_bright.yaml @@ -26,8 +26,8 @@ connector_height: 4 link_style: "endArrow=none;jumpStyle=gap;" # Style for labels -src_label_style: "rounded=1;whiteSpace=wrap;html=1;fontFamily=Google Sans;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DGoogle%2BSans;arcSize=32;spacing=0;spacingBottom=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#98A2AE;fontSize=6;horizontal=1;" -trgt_label_style: "rounded=1;whiteSpace=wrap;html=1;fontFamily=Google Sans;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DGoogle%2BSans;arcSize=32;spacing=0;spacingBottom=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#98A2AE;fontSize=6;horizontal=1;" +src_label_style: "rounded=1;whiteSpace=wrap;html=1;fontFamily=Google Sans;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DGoogle%2BSans;arcSize=32;spacing=0;spacingBottom=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#98A2AE;fontSize=6;horizontal=1;fontStyle=1" +trgt_label_style: "rounded=1;whiteSpace=wrap;html=1;fontFamily=Google Sans;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DGoogle%2BSans;arcSize=32;spacing=0;spacingBottom=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#98A2AE;fontSize=6;horizontal=1;fontStyle=1" default_labels: false label_offset: 20