ProcessGit skatītājs MI stratēģijai
- viewer/MI_strategijas_datukopa.html (+ template.html): pīlāri, visas rīcības, principi un resursi, Par - data/processgit.viewer.json: pppa-mis-*.xml → skatītājs - tools/build_viewer.py Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016679RwmHsuTFfxt26wP6rk
This commit is contained in:
17
tools/build_viewer.py
Normal file
17
tools/build_viewer.py
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python3
|
||||
"""viewer/template.html + data + shēma -> viewer/MI_strategijas_datukopa.html (viena pašpietiekama datne).
|
||||
|
||||
Lietojums: python3 tools/build_viewer.py
|
||||
Ārpus ProcessGit skatītājs rāda iebūvēto datukopu; ProcessGit iframe tas ielādē skatīto datni no repozitorija.
|
||||
"""
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
data = sorted((ROOT / "data").glob("pppa-mis-*.xml"))[-1].read_text(encoding="utf-8")
|
||||
xsd = (ROOT / "schemas" / "mi-strategija-0.1.xsd").read_text(encoding="utf-8")
|
||||
for name, s in (("data", data), ("xsd", xsd)):
|
||||
assert "</script" not in s.lower(), name
|
||||
t = (ROOT / "viewer" / "template.html").read_text(encoding="utf-8")
|
||||
out = t.replace("__XML__", data.strip()).replace("__XSD__", xsd.strip())
|
||||
(ROOT / "viewer" / "MI_strategijas_datukopa.html").write_text(out, encoding="utf-8")
|
||||
print("-> viewer/MI_strategijas_datukopa.html", len(out), "B")
|
||||
Reference in New Issue
Block a user