diff --git a/scripts/build-docs-site.py b/scripts/build-docs-site.py index 69ea586..075e0bc 100755 --- a/scripts/build-docs-site.py +++ b/scripts/build-docs-site.py @@ -7,6 +7,7 @@ defaults to PDF links; index-md.html is the Markdown/HTML index. from __future__ import annotations +import os import shutil import subprocess from concurrent.futures import ThreadPoolExecutor, as_completed @@ -17,6 +18,11 @@ from urllib.parse import unquote ROOT = Path(__file__).resolve().parents[1] SITE = ROOT / "site" CSS = ROOT / "scripts" / "docs-print.css" +# Display label only. Catalog file links are relative so the tree can move hosts. +DOCS_PUBLIC_HOST = os.environ.get("DOCS_PUBLIC_HOST", "zapier.georgelambert.org") +# If set (e.g. https://docs.verae-time.net), PDF annotations become absolute. +# Empty (default) writes path-relative URIs that work on any hostname at site root. +DOCS_PUBLIC_URL = os.environ.get("DOCS_PUBLIC_URL", "").rstrip("/") SECTIONS = [ ( @@ -180,7 +186,7 @@ def render_md(src: Path, html_dest: Path, pdf_dest: Path, title: str) -> str: header.write_text(f"\n", encoding="utf-8") banner.write_text( f'
' - f'