notParsec / 문서전체 문서

생성 코드·템플릿

build_homeserver.py

design/build_homeserver.py

출처: 현재 작업 폴더 · 원문 다운로드

"""Produce the offline, self-contained home-server architecture explainer."""
from pathlib import Path
root=Path(__file__).resolve().parent
template=(root/'homeserver.template.html').read_text(encoding='utf-8')
assert template.count('__HOME_MODEL__')==1
html=template.replace('__HOME_MODEL__',(root/'homeserver-model.js').read_text(encoding='utf-8'))
(root/'homeserver-architecture.html').write_text(html,encoding='utf-8')
print('Built homeserver-architecture.html')