Skip to content

Add GitHub Pages documentation site#8

Merged
YuminosukeSato merged 1 commit into
mainfrom
feat/github-pages-docs
Mar 22, 2026
Merged

Add GitHub Pages documentation site#8
YuminosukeSato merged 1 commit into
mainfrom
feat/github-pages-docs

Conversation

@YuminosukeSato
Copy link
Copy Markdown
Owner

Summary

  • Add a MkDocs Material documentation site deployed to GitHub Pages
  • Tutorial page mirrors the R CausalImpact site structure
  • Plot images are generated in CI from a deterministic script (seed=42), not committed to the repo

What changed

File Purpose
mkdocs.yml MkDocs Material config with 5-page sidebar nav
docs/index.md Tutorial: data creation, analysis, plot, summary, report, raw inferences, covariates, parameters, validity
docs/api.md API reference for CausalImpact, ModelOptions, CausalImpactResults
docs/images/.gitkeep Placeholder for CI-generated plot images
scripts/generate_docs_assets.py Generates causal_impact_plot.png with fixed seed (headless Agg backend)
tests/test_docs_assets.py 9 tests: 5 normal, 3 boundary, 1 error case
.github/workflows/docs.yml CI: Rust build → uv sync → generate assets → mkdocs build --strict → deploy
pyproject.toml Add [docs] optional-dependencies (mkdocs-material, pymdown-extensions)
.gitignore Exclude site/ and docs/images/*.png
uv.lock Lock file updated with docs dependencies

Architecture

Push to main → docs.yml workflow
  ├── Rust build (cargo via maturin)
  ├── uv sync --all-extras
  ├── python scripts/generate_docs_assets.py → docs/images/causal_impact_plot.png
  ├── mkdocs build --strict (catches broken links)
  └── mkdocs gh-deploy --force → gh-pages branch

Test plan

Notes for reviewers

  • docs/index.md embeds actual ci.summary() and ci.report() output captured from a real run (seed=42, niter=1000). These are static code blocks, not dynamically generated.
  • Existing docs (migration-from-r.md, migration-from-tfp.md, compatibility-matrix.md) are included in the nav as-is with no modifications.
  • The workflow only deploys on push to main. PR builds run mkdocs build --strict as a validation step without deploying.

Add a documentation site modeled after the R CausalImpact tutorial.

- mkdocs.yml: MkDocs Material config with sidebar nav (5 pages)
- docs/index.md: tutorial with code examples, plot, summary/report output
- docs/api.md: CausalImpact/ModelOptions/CausalImpactResults reference
- scripts/generate_docs_assets.py: deterministic plot generation (seed=42)
- tests/test_docs_assets.py: 9 tests (normal/boundary/error cases)
- .github/workflows/docs.yml: build + deploy to GitHub Pages on main push
- pyproject.toml: add [docs] optional-dependencies
@YuminosukeSato YuminosukeSato merged commit 9c07e6b into main Mar 22, 2026
14 checks passed
YuminosukeSato added a commit that referenced this pull request Mar 23, 2026
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