Skip to content

Commit

Permalink
chore: Update .gitignore and README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
FloSch62 committed Jul 16, 2024
1 parent 3adf722 commit bc93b60
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
venv/*
__pycache__
test/*
launch.json
launch.json
lab-examples/**
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
Expand Down Expand Up @@ -92,7 +98,6 @@ python clab2drawio.py -i <input_file.yaml>
```

`-i, --input`: Specifies the path to your input YAML file.
`-o, --output`: Specifies the path for the output drawio file.
Make sure to replace `<input_file.yaml>` 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)
4 changes: 3 additions & 1 deletion docs/clab2drawio.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <path_to_your_yaml_file>
Expand Down Expand Up @@ -139,6 +139,8 @@ Below are some example images of the available custom styles:
</tr>
</table>

**_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).

Expand Down
4 changes: 2 additions & 2 deletions styles/nokia_modern_bright.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bc93b60

Please sign in to comment.