Skip to content

Adding docs and examples to github pages#88

Merged
birkholz-cubert merged 10 commits into
mainfrom
feature/add_existing_docs_and_examples
Jun 3, 2026
Merged

Adding docs and examples to github pages#88
birkholz-cubert merged 10 commits into
mainfrom
feature/add_existing_docs_and_examples

Conversation

@birkholz-cubert
Copy link
Copy Markdown
Collaborator

@birkholz-cubert birkholz-cubert commented May 26, 2026

Summary

Migrates the documentation site from cuvis.doc into this repo and publishes it to GitHub Pages, with versioned docs, generated API reference, and an LLM-readable index.

  • Docs + examples migrated from cuvis.doc.
  • Versioned docs via mike — a v*.*.* tag publishes that version (aliased latest); pushes to main publish a dev build.
  • API reference — C/C++ generated from the headers via mkdoxy (Doxygen), Python via mkdocstrings (static/griffe; allow_inspection: false is deliberate — importing cuvis exits without the installed SDK).
  • Example pages generated from the Python notebooks.
  • llms.txt / llms-full.txt index via mkdocs-llmstxt.

CI / review hardening (added on this branch)

  • Docs build check workflow runs mkdocs build --strict on PRs, and a strict build also runs before each mike deploy — broken links / missing generated pages now fail CI instead of publishing.
  • Shared concurrency group across the nightly + versioned deploys so they can't race each other's push to gh-pages.
  • Examples overview reworded to match the generated output (Python-only pages).
  • _parse_notebook no longer drops a notebook's trailing markdown cell; added parser/macro tests.
  • content.code.annotationcontent.code.annotate typo fix.
  • Home page added to the llms.txt index; description clarified.

Maintainer follow-ups

  • After merge: once the first mike deploy creates the gh-pages branch, switch Settings → Pages → Deploy from branch: gh-pages / (root). The site currently publishes from a Pages Actions build, so flipping before gh-pages exists would 404 the live site.
  • Keep allow_inspection: false in the mkdocstrings config.

Publishing a versioned doc release

git tag vX.Y.Z && git push origin vX.Y.Z triggers deploy-docs-versioned.yml, which builds and publishes that version as latest (same tag-driven pattern as cuvis-ai). Pushes to main keep the dev build current.

- Add `.github/workflows/deploy-docs.yml`: two-job pipeline (build with
  `uv run mkdocs build --strict` → upload Pages artifact → deploy via
  `actions/deploy-pages@v4`). Triggers on push to main with path
  filters plus `workflow_dispatch`.
- Add `site_url: https://cubert-hyperspectral.github.io/cuvis.sdk/` to
  `mkdocs.yml` so Material emits the correct sitemap and absolute
  OG/canonical links.

To go live: Settings → Pages → Source → "GitHub Actions", then push
any docs change or run the workflow manually.
@birkholz-cubert birkholz-cubert requested a review from nghorbani June 1, 2026 15:21
- Add a strict mkdocs build check on PRs and before each mike deploy so broken
  links or missing generated pages fail CI instead of publishing a broken site.
- Serialize nightly and versioned deploys with a shared concurrency group to
  avoid racing pushes to gh-pages.
- Correct the Examples overview: the generated example pages are Python-only.
- Keep trailing prose in notebook-derived pages (_parse_notebook now flushes a
  final markdown-only section) and add tests covering it.
- Fix mkdocs feature flag typo: content.code.annotation -> content.code.annotate.
@nghorbani
Copy link
Copy Markdown
Contributor

One config note for the Python API reference: please keep allow_inspection: false in the mkdocstrings handler. Importing the cuvis package calls sys.exit(1) when the CUVIS env var isn't set, and it loads a compiled extension — so letting mkdocstrings import it would abort the docs build. Static (griffe) resolution is what we want here, and the classes referenced in api/python.md all resolve via the package's __init__ re-exports.

Re: GitHub Pages — the source switch to the gh-pages branch has to wait until the first mike deploy actually creates that branch (i.e. after this lands on main); flipping Settings → Pages to "Deploy from branch: gh-pages" before then would 404 the live site. Same for setting a default version (mike set-default) — it operates on gh-pages, so it only applies once that branch exists.

nghorbani added 2 commits June 3, 2026 10:46
Add index.md to the mkdocs-llmstxt sections so the overview page is in the
generated llms.txt / llms-full.txt, and reword the description to say the index
covers the guide and Python API (the C/C++ reference stays browsable on the
site). The generated mkdoxy pages are deliberately not listed so the strict
build keeps no dependency on plugin ordering.
The Unreleased section logged the rebrand and the CI/review fixes but not the
headline change this branch makes: migrating the docs site into the repo with
mike versioning, mkdoxy/mkdocstrings API reference, notebook example pages, and
the llms.txt index.
Copy link
Copy Markdown
Contributor

@nghorbani nghorbani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. Reviewed the docs/CI migration and the example-page generator.

Fixes pushed on the branch: strict-build gate (PR check + before each mike deploy), shared deploy concurrency, examples-overview wording (Python-only), the _parse_notebook trailing-cell drop (with tests), the content.code.annotate typo, and the Home page added to the llms.txt index.

One post-merge step remains for a maintainer: once the first mike deploy creates gh-pages, switch Settings → Pages to deploy from that branch (flipping before it exists would 404 the live site). And please keep allow_inspection: false in the mkdocstrings config. LGTM.

@birkholz-cubert birkholz-cubert merged commit 62860e2 into main Jun 3, 2026
1 check passed
@nghorbani nghorbani deleted the feature/add_existing_docs_and_examples branch June 3, 2026 10:55
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.

2 participants