A markdown plantuml snippet to image converter pre-commit hook
Generates images from plantuml snippets contained in a markdown file.
The plantuml snippets can be defined as follows:
# Ex 1: A collapsible section with markdown
<details>
<summary>Click to expand!</summary>
```plantuml
@startuml
Hasan -> Bob: 1. Esenlikler Bob cugum
Bob --> Hasan: How are you
Bob --> Alice: Hello Alice
Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
@enduml
```
</details>

# Ex 2: After existing collapsible
```plantuml
@startuml
if (color?) is (<color:red>red) then
:print red;
else
:print not redtest;
@enduml
```

Lorem ipsum dolor.
## `Ex 3:` Without image reference
```plantuml
@startuml
start
if (3. Graphviz installed?) then (yes)
:process all\ndiagrams;
else (no)
:process only
__sequence__ and __activity__ diagrams;
endif
stop
@enduml
```
First you need to install the pre-commit framework. After installing the pre-commit framework, you can define the hook in your .pre-commit-config.yaml
file as follows:
repos:
- repo: https://github.com/entrofi/pre-commit-md-plantuml-converter
rev: v0.0.2-LATEST
hooks:
- id: md_plantuml_converter
args: [--extension=png, --image-dir=./docs/assets/puml, --prefix= ]
- extension: Possible values for the
extension
argument aresvg
,png
andesp
. - image-dir: image directory to save the generated images relative to the markdown file under processing.
- prefix: custom prefix to add the names of the generated image files.