39 lines
1.7 KiB
Python
39 lines
1.7 KiB
Python
"""Bundle selected, non-secret operator docs for installed web applications.
|
|
|
|
Edit the original Markdown files, then run this script. --check detects drift.
|
|
"""
|
|
import argparse
|
|
import json
|
|
from pathlib import Path
|
|
|
|
ROOT=Path(__file__).resolve().parents[1]
|
|
DOCUMENTS=(
|
|
('user-guide','Verwendung und Funktionsweise','docs/user-guide.md'),
|
|
('linux-deployment','Linux-Installation und Betrieb','docs/linux-deployment.md'),
|
|
('project-configuration','Projekt-, Source-, DB- und Modellkonfiguration','docs/project-configuration.md'),
|
|
('intake-api','Übergabe-API und Rückgaben','docs/intake-api.md'),
|
|
('analysis-worker','Analyseworker und Wiederanlauf','docs/analysis-worker.md'),
|
|
('user-accounts','Benutzerkonten','docs/user-accounts.md'),
|
|
('integration-keys','Integrationsschlüssel','docs/integration-keys.md'),
|
|
('web-console','Weboberfläche im Detail','docs/web-console.md'),
|
|
('capture-worker','Erfassungsworker v0.4','deploy/capture-worker/README.md'),
|
|
)
|
|
TARGET=ROOT/'src/viano_bug_analysis/web/user-manual.json'
|
|
|
|
|
|
def bundle():
|
|
return {'format_version':1,'documents':[{'id':identifier,'title':title,
|
|
'markdown':(ROOT/path).read_text(encoding='utf-8')} for identifier,title,path in DOCUMENTS]}
|
|
|
|
|
|
def main():
|
|
parser=argparse.ArgumentParser(description=__doc__);parser.add_argument('--check',action='store_true');args=parser.parse_args()
|
|
content=json.dumps(bundle(),ensure_ascii=False,indent=2)+'\n'
|
|
if args.check:
|
|
if not TARGET.exists() or TARGET.read_text(encoding='utf-8')!=content:
|
|
parser.exit(1,'User manual is stale; run python scripts/build_user_manual.py\n')
|
|
else:TARGET.write_text(content,encoding='utf-8',newline='\n')
|
|
|
|
|
|
if __name__=='__main__':main()
|