Skip to content

Commit

Permalink
Add plantuml
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisCompton committed Oct 1, 2024
1 parent 1f0ccc8 commit 8a20789
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
run: |
npm install -g @marp-team/marp-cli
python scripts/marp.py
python scripts/plantuml.py
- name: Run python script.
run: |
mkdocs build
Expand Down
12 changes: 12 additions & 0 deletions docs/demo/diagram/uml.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
marp: true
theme: notebook
---

# Example Diagram

![](uml.png)

<div id="slide_menu" class="grid cards" markdown>
- [:fontawesome-brands-html5: __HTML__ Slides: Slides](uml_slides.html)
- [:fontawesome-solid-file-pdf: __PDF__ Document: Slides](uml_slides.pdf)</div>
3 changes: 3 additions & 0 deletions docs/demo/diagram/uml.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@startuml
Bob -> Alice: Hello!
@enduml
9 changes: 8 additions & 1 deletion docs/demo/graph/d3.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
marp: false
theme: notebook
---


# Example Graph

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

document.getElementById("d3_container").appendChild(svg.node());
});
</script>


</script>
5 changes: 5 additions & 0 deletions docs/demo/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ theme: notebook








<div id="slide_menu" class="grid cards" markdown>
- [:fontawesome-brands-html5: __HTML__ Slides: Slides](index_slides.html)
- [:fontawesome-solid-file-pdf: __PDF__ Document: Slides](index_slides.pdf)</div>
2 changes: 1 addition & 1 deletion docs/static/css/adjust.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
div.mermaid {
width: unset !important;
width: 100%;
}
}
22 changes: 22 additions & 0 deletions scripts/plantuml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import os
import subprocess

import config as cfg

def process_puml_files(base_path):
for root, _, files in os.walk(base_path):
for file in files:
if file.endswith('.puml'):
puml_file = os.path.join(root, file)
generate_graph(puml_file)

def generate_graph(puml_file):
jar_path = './scripts/plantuml/plantuml-mit-1.2024.6.jar'
cmd = ['java', '-jar', jar_path, puml_file]
print("Executing: ", " ".join(cmd))
subprocess.run(cmd, check=True)

# Example usage
print (f"Processing puml files from: {cfg.markdown_source_path}")
process_puml_files(cfg.markdown_source_path)
print ("Done processing puml files")
Binary file added scripts/plantuml/plantuml-mit-1.2024.6.jar
Binary file not shown.

0 comments on commit 8a20789

Please sign in to comment.