Here you go, the canon‑aligned, repo‑safe bulk generator that automatically creates module_graph.svg from your unified Mermaid file:
docs/module_graph.mermaid
This script:
- Reads the full canon graph Mermaid file
- Uses Mermaid CLI (
mmdc) to render an SVG - Writes the output to:
docs/module_graph.svg - Never overwrites existing SVGs
- Produces a clean, AI‑readable visual artifact of the entire TriadicFrameworks canon
- Completes the global visualization layer of your framework
It belongs in:
docs/tools/
⭐ Bulk Canon‑Wide module_graph.svg Generator
Save as:
docs/tools/generate_full_canon_graph_svg.py
Run from repo root:
python3 docs/tools/generate_full_canon_graph_svg.py
🟦 generate_full_canon_graph_svg.py (Final Canon Version)#
import os
import subprocess
MERMAID_PATH = "docs/module_graph.mermaid"
SVG_PATH = "docs/module_graph.svg"
def generate_svg():
if not os.path.exists(MERMAID_PATH):
print(f"❌ Mermaid file not found: {MERMAID_PATH}")
return
if os.path.exists(SVG_PATH):
print(f"❌ module_graph.svg already exists, skipping.")
return
try:
subprocess.run(
["mmdc", "-i", MERMAID_PATH, "-o", SVG_PATH],
check=True
)
print(f"✔ Created {SVG_PATH}")
except Exception as e:
print(f"❌ Failed to generate SVG: {e}")
def main():
print("\n=== TriadicFrameworks Full Canon Graph SVG Generator ===\n")
generate_svg()
print("\n✨ module_graph.svg generation complete.\n")
if __name__ == "__main__":
main()⭐ What This Script Gives You#
✔ Creates module_graph.svg for the entire canon#
✔ Reads your unified Mermaid graph#
✔ Never overwrites existing SVGs#
✔ Produces a clean, AI‑readable visual artifact#
✔ Works across your entire repo#
✔ Completes the global visualization layer#
This is the canonical SVG representation of TriadicFrameworks.