mirror of
git://f0xx.org/android_cast
synced 2026-07-29 06:18:42 +03:00
docs mostly
This commit is contained in:
43
docs/_pdf_build/build_all_docs_pdf.py
Normal file
43
docs/_pdf_build/build_all_docs_pdf.py
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Build docs/<name>.pdf for every docs/*.md (top-level only, not _pdf_build/)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
DOCS = ROOT / "docs"
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
|
||||
from md_to_pdf import build_pdf_from_markdown # noqa: E402
|
||||
|
||||
SUBTITLE = {
|
||||
"20260602_REVERSE_SSH_proposals_summary.md": "Generated from markdown — rev. 1–3 + appendices WG test/production",
|
||||
"GIT_FLOW.md": "Branches, next, release — from markdown",
|
||||
"REMOTE_ACCESS_IMPL.md": "WireGuard v1 — implementation and deploy",
|
||||
"REMOTE_ACCESS_VALIDATION.md": "Linux CLI validation — device sim + E2E",
|
||||
"INFRA.md": "Production topology — FE, BE, ports",
|
||||
}
|
||||
|
||||
|
||||
def main() -> int:
|
||||
md_files = sorted(DOCS.glob("*.md"))
|
||||
if not md_files:
|
||||
print("No markdown files in docs/", file=sys.stderr)
|
||||
return 1
|
||||
ok = 0
|
||||
for md in md_files:
|
||||
out = md.with_suffix(".pdf")
|
||||
subtitle = SUBTITLE.get(md.name, f"From {md.name}")
|
||||
try:
|
||||
build_pdf_from_markdown(md, out, doc_subtitle=subtitle)
|
||||
ok += 1
|
||||
except Exception as e:
|
||||
print(f"FAIL {md.name}: {e}", file=sys.stderr)
|
||||
print(f"Built {ok}/{len(md_files)} PDFs under docs/")
|
||||
return 0 if ok == len(md_files) else 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -16,7 +16,7 @@ def build_pdf() -> None:
|
||||
build_pdf_from_markdown(
|
||||
SOURCE_MD,
|
||||
OUT_PDF,
|
||||
doc_subtitle="Generated from markdown — rev. 1 + rev. 2 + rev. 3 (2026-06-02)",
|
||||
doc_subtitle="Generated from markdown — rev. 1–3 + Appendix 1 (WG test) + Appendix 2 (WG production)",
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user