MkDocs documentation templates with mkdocs-macros-plugin for Jinja2 variable substitution.
plex-guide/— Plex server user guide templatedocs/index.md— templatized guide with{{ variable }}referencesmain.py— mkdocs-macros hook:contact_card()macro + frontmatter resolutionmkdocs.sample.yml— sample config (users copy tomkdocs.yml, which is gitignored)setup.sh— interactive setup scriptrequirements.txt— minimal pip dependencies (mkdocs pinned to v1)
plans/,runbooks/— future template directories
mkdocs.sample.yml— users copy tomkdocs.ymlto prevent PII leaks.mkdocs.ymlis gitignored.- Variables — defined in
extra:section ofmkdocs.yml, referenced as{{ variable_name }}in markdown - Conditional sections —
{% if has_feature %}...{% endif %}for optional content - markdownlint — Jinja2 inside tables requires disabling MD055/MD056/MD060;
{% if %}before---requires disabling MD003
-
Build: use a venv or Docker, never system-wide pip
cd plex-guide python3 -m venv .venv .venv/bin/pip install -r requirements.txt cp mkdocs.sample.yml mkdocs.yml .venv/bin/mkdocs build -
Lint:
npx markdownlint-cli2 "**/*.md"andshellcheck plex-guide/setup.sh -
CI runs markdownlint, shellcheck, yamllint on all PRs
-
GitHub Pages deploys from GHA workflow (plex guide at
/plex/subpath)
main.py provides a contact_card() macro with bot-protected contact info:
- Values are base64-encoded at build time, decoded by JS at runtime
- Inline CSS styles the card (border, rounded corners, dividers, preferred badge)
- Supported types:
email,phone,signal_url,signal_username,telegram,discord,whatsapp,imessage signal_usernameanddiscordrender as plain text (no clickable link)telegram→t.me/,whatsapp→wa.me/,imessage→sms:,phone→tel:noscriptfallback shows values without JS decoding
- This is a public repo — no local paths, infrastructure refs, or personal config
- All scripts must pass
shellcheckwith no warnings - All markdown must pass
markdownlint-cli2with the repo's.markdownlint.yaml - New variables must be added to:
mkdocs.sample.yml,setup.sh,README.mdvariable reference - New contact types must be added to:
main.py(JS decoder +_build_href+_display_value),mkdocs.sample.yml - Conditional sections must toggle cleanly (no empty sections or broken refs when disabled)
- MkDocs pinned to v1 (
>=1.6,<2) — v2 removes plugin system with no migration path