Skip to content

Commit 8a20789

Browse files
committed
Add plantuml
1 parent 1f0ccc8 commit 8a20789

File tree

8 files changed

+52
-2
lines changed

8 files changed

+52
-2
lines changed

.github/workflows/static.yml

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
run: |
3333
npm install -g @marp-team/marp-cli
3434
python scripts/marp.py
35+
python scripts/plantuml.py
3536
- name: Run python script.
3637
run: |
3738
mkdocs build

docs/demo/diagram/uml.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
marp: true
3+
theme: notebook
4+
---
5+
6+
# Example Diagram
7+
8+
![](uml.png)
9+
10+
<div id="slide_menu" class="grid cards" markdown>
11+
- [:fontawesome-brands-html5: __HTML__ Slides: Slides](uml_slides.html)
12+
- [:fontawesome-solid-file-pdf: __PDF__ Document: Slides](uml_slides.pdf)</div>

docs/demo/diagram/uml.puml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@startuml
2+
Bob -> Alice: Hello!
3+
@enduml

docs/demo/graph/d3.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
marp: false
3+
theme: notebook
4+
---
5+
6+
17
# Example Graph
28

39
## Population by Age
@@ -60,5 +66,6 @@ d3.csv("/static/data/population-by-age.csv", d3.autoType).then(data => {
6066

6167
document.getElementById("d3_container").appendChild(svg.node());
6268
});
69+
</script>
70+
6371

64-
</script>

docs/demo/index.md

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ theme: notebook
2121

2222

2323

24+
25+
26+
27+
28+
2429
<div id="slide_menu" class="grid cards" markdown>
2530
- [:fontawesome-brands-html5: __HTML__ Slides: Slides](index_slides.html)
2631
- [:fontawesome-solid-file-pdf: __PDF__ Document: Slides](index_slides.pdf)</div>

docs/static/css/adjust.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
div.mermaid {
2929
width: unset !important;
3030
width: 100%;
31-
}
31+
}

scripts/plantuml.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import os
2+
import subprocess
3+
4+
import config as cfg
5+
6+
def process_puml_files(base_path):
7+
for root, _, files in os.walk(base_path):
8+
for file in files:
9+
if file.endswith('.puml'):
10+
puml_file = os.path.join(root, file)
11+
generate_graph(puml_file)
12+
13+
def generate_graph(puml_file):
14+
jar_path = './scripts/plantuml/plantuml-mit-1.2024.6.jar'
15+
cmd = ['java', '-jar', jar_path, puml_file]
16+
print("Executing: ", " ".join(cmd))
17+
subprocess.run(cmd, check=True)
18+
19+
# Example usage
20+
print (f"Processing puml files from: {cfg.markdown_source_path}")
21+
process_puml_files(cfg.markdown_source_path)
22+
print ("Done processing puml files")
11.4 MB
Binary file not shown.

0 commit comments

Comments
 (0)