Skip to content

docs: mkdocs-material site with auto-generated command reference#14

Merged
jdwit merged 8 commits into
mainfrom
docs/mkdocs-material
May 28, 2026
Merged

docs: mkdocs-material site with auto-generated command reference#14
jdwit merged 8 commits into
mainfrom
docs/mkdocs-material

Conversation

@jdwit
Copy link
Copy Markdown
Owner

@jdwit jdwit commented May 26, 2026

Summary

Add a Material for MkDocs documentation site at `docs/` plus a GitHub Actions workflow that builds on every PR (strict mode) and deploys to `gh-pages` on pushes to `main`.

What is in the site

  • Topic pages mirroring the user journey: index, installation, OAuth setup, multi-channel profiles, bulk video updates, live broadcasts, comments, analytics, API quota.
  • Auto-generated command reference (`docs/reference.md`). A mkdocs `on_pre_build` hook runs `python -m typer ytstudio.main utils docs --name ytstudio` before every build, so the reference cannot drift from `--help`. Generation failures fail the build hard.
  • Material theme features: navigation tabs, instant nav, palette toggle, code copy, content tabs, admonitions, Mermaid diagrams (via `pymdownx.superfences`), and Material icons (via `pymdownx.emoji`).

Workflow

  • `Docs` workflow at `.github/workflows/docs.yml`.
  • PRs trigger a strict build (`mkdocs build --strict`) for early-warning regression detection; no deploy.
  • Pushes to `main` plus `workflow_dispatch` trigger `mkdocs gh-deploy --force --no-history` to the `gh-pages` branch, guarded by `github.ref == 'refs/heads/main'` so dispatch on a feature branch can never publish.
  • Concurrency is scoped per-PR for builds and to a single `deploy` group for main, so two refs can't race to force-push.
  • `uv sync --locked --group docs` keeps CI deterministic.

After merge

Enable GitHub Pages in Settings -> Pages with the source set to Deploy from a branch -> gh-pages -> /(root). The first deploy will create that branch.

Review

Built locally with `uv run mkdocs build --strict` (clean) then reviewed by Codex via the rescue subagent. Findings (2 high, 2 medium, 3 low) all applied; the highs were two docs pages documenting commands that did not match the real CLI surface, which is exactly the failure mode the auto-generated reference exists to prevent for the rest.

Test plan

  • `uv run mkdocs build --strict` -> clean
  • `docs/reference.md` regenerates and matches `ytstudio --help` for each subcommand
  • CI PR build passes
  • After merge: enable Pages source = gh-pages, verify https://jdwit.github.io/ytstudio-cli/ serves

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 26, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedmkdocs-material@​9.7.674100100100100
Addedpymdown-extensions@​10.21.39910010010080
Addedmkdocs@​1.6.181100100100100
Updatedtyper@​0.21.1 ⏵ 0.26.197 -2100100100100

View full report

jdwit added 3 commits May 28, 2026 16:43
New documentation site at docs/ powered by Material for MkDocs:

- Topic pages: index, installation, OAuth setup, multi-channel profiles,
  bulk video updates, live broadcasts, comments, analytics, and an API
  quota cheatsheet.
- Auto-generated command reference via an on_pre_build mkdocs hook that
  runs 'python -m typer ytstudio.main utils docs' so the reference page
  cannot drift from --help. Generation failures fail the build hard.
- Material theme features: navigation tabs + instant nav, light/dark
  palette toggle, code copy, content tabs, admonitions, Mermaid diagrams
  via pymdownx.superfences, and Material icons via pymdownx.emoji.

CI deploy via .github/workflows/docs.yml: strict build on PRs (no
deploy), and 'mkdocs gh-deploy' on push to main (guarded by ref check
and concurrency lock so two refs can't race to force-push gh-pages).
uv sync uses --locked.

pyproject.toml gets a 'docs' dependency group (mkdocs-material,
pymdown-extensions, typer-cli). docs/reference.md and site/ are
gitignored as build artefacts.

Workflow informed by Context7 docs lookup and a Codex review pass. Codex
found 2 high (videos and comments command names did not match the real
CLI), 4 medium/low (hook fail-soft, missing PR guard on deploy, missing
PR build, --locked, missing pymdownx.emoji, analytics quota wording);
all applied.
Newer typer (0.26+) no longer pulls click as a runtime dep, which broke
tests/test_api.py's 'from click.exceptions import Exit' when the docs
group pulled in a typer-cli that bumped typer past the click cutoff.

- Switch the test to 'from typer import Exit'; this is what every other
  caller uses, and typer re-exports Exit for exactly this purpose.
- Drop typer-cli from the docs group: 'python -m typer ytstudio.main
  utils docs' works out of the box on modern typer, no extra package
  needed.
- Cover videos upload (sidecars, dry-run, --max, resume semantics, quota) on
  the videos page and surface it in the home highlights and nav label.
- Document videos list --scheduled filter.
- Replace nonexistent commands in docs: drop ytstudio logout, swap analytics
  top/by-country/by-day for the real overview/video/query/metrics/dimensions,
  use comments --status/--sort instead of --moderation-status/--order.
- Add videos.insert and thumbnails.set to the API quota cheatsheet.
- YouTube-inspired Material palette: black/white primary, red accent, plus
  an extra.css that pins #FF0033 / #212121 / #FFFFFF on both schemes.
- Drop pymdownx.smartsymbols so -- and --- stay as plain hyphens.
- check-yaml: pass --unsafe so mkdocs.yml python tags don't trip pre-commit.
@jdwit jdwit force-pushed the docs/mkdocs-material branch from b84f7c0 to 76aedcf Compare May 28, 2026 15:26
jdwit added 5 commits May 28, 2026 17:34
- index.md: drop misleading "tags" from the search-replace highlight; the
  videos search-replace --field flag only accepts title or description, the
  per-video update command is what handles tags.
- comments.md: document that --sort relevance requires --video (YouTube API
  only honours relevance ordering on a single video).
- docs.yml: include src/ytstudio/** in the PR paths filter so CLI surface
  changes also trigger the strict docs build (the build hook regenerates
  the command reference from the live typer app).
- center readme top section (ascii.png header, badges, tagline) and
  remove sections now covered in mkdocs site; add features list and
  link to docs
- site_name -> ytstudio-cli to match package/repo
- force youtube-red header/tabs in both schemes (slate's more-specific
  rule was overriding the var-based default); footer fixed to yt-black
- rephrase "what it is" and "why it exists" on landing page; drop
  multi-channel mention (plumbing, not a headline feature)
switch from mkdocs gh-deploy (gh-pages branch push) to the modern
actions/upload-pages-artifact + actions/deploy-pages flow. requires the
repo's pages source to be set to "github actions".
@jdwit jdwit merged commit 2318e96 into main May 28, 2026
7 checks passed
@jdwit jdwit deleted the docs/mkdocs-material branch May 28, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant