Document every repo in Sphinx, catalog PDFs, and verae-ops
Some checks are pending
offline / test (push) Waiting to run
Some checks are pending
offline / test (push) Waiting to run
Add missing package READMEs, expand Sphinx to all runtime modules, publish a LaTeX/PDF README book, and add verae-ops for Docker, Proxmox, VMs, dedicated hardware, and service linking. Catalog defaults to public PDF links for each module README and samples.
This commit is contained in:
parent
5ad3222def
commit
e401635fd6
222 changed files with 4498 additions and 123 deletions
71
scripts/build-readme-latex.py
Normal file
71
scripts/build-readme-latex.py
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Concatenate package READMEs into LaTeX source + colored PDF (WeasyPrint)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
CSS = ROOT / "scripts" / "docs-print.css"
|
||||
OUT = ROOT / "docs" / "sphinx" / "_build" / "latex"
|
||||
REPOS = [
|
||||
"overview",
|
||||
"verae-ops",
|
||||
"zappier",
|
||||
"verae-zapier-middleware",
|
||||
"verae-zapier",
|
||||
"verae-activate",
|
||||
"verae-request-splitter",
|
||||
"verae-archive-worm",
|
||||
"verae-archive-aggregator",
|
||||
"verae-tree-node",
|
||||
"verae-fleet",
|
||||
"verae-zapier-simulator",
|
||||
"zapier-user-docs",
|
||||
"docs-master",
|
||||
"verae-nats-process",
|
||||
]
|
||||
|
||||
|
||||
def main() -> None:
|
||||
OUT.mkdir(parents=True, exist_ok=True)
|
||||
files = [str(ROOT / "packages" / n / "README.md") for n in REPOS if (ROOT / "packages" / n / "README.md").exists()]
|
||||
html = OUT / "verae-zapier-modules.html"
|
||||
pdf = OUT / "verae-zapier-modules.pdf"
|
||||
tex = OUT / "verae-zapier-readmes.tex"
|
||||
hdr = OUT / "hdr.html"
|
||||
hdr.write_text("<style>" + CSS.read_text(encoding="utf-8") + "</style>\n", encoding="utf-8")
|
||||
subprocess.run(
|
||||
[
|
||||
"pandoc",
|
||||
*files,
|
||||
"-o",
|
||||
str(html),
|
||||
"--standalone",
|
||||
"--toc",
|
||||
f"--css={CSS}",
|
||||
"--metadata=title=Verae Time × Zapier — repository READMEs",
|
||||
f"--include-in-header={hdr}",
|
||||
"--syntax-highlighting=breezedark",
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
subprocess.run(["weasyprint", str(html), str(pdf)], check=True)
|
||||
subprocess.run(
|
||||
[
|
||||
"pandoc",
|
||||
*files,
|
||||
"-o",
|
||||
str(tex),
|
||||
"--standalone",
|
||||
"--toc",
|
||||
"--metadata=title=Verae Time × Zapier repository READMEs",
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
print(f"wrote {pdf} ({pdf.stat().st_size} bytes) and {tex}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue