Skip to content

Commit d8a8d57

Browse files
feat: move to mystmd (#792)
* feat(docs): migrate docs site from Jekyll to MyST (JupyterBook 2.0) - Replace Jekyll + just-the-docs with MyST using scientific-python-myst-theme - Add docs/myst.yml with full TOC structure (29 pages across 5 sections) - Add docs/config/scientific-python.yml for book-theme configuration - Add docs/rr-role.mjs custom MyST plugin replacing repo_review.rb Liquid tag - Add docs/assets/css/site.css with SP theme CSS and .rr-btn styles - Convert all Liquid tags: {%rr%}→{rr} role, tabs→tab-set/tab-item, details→{dropdown}, callouts→admonitions, links→relative paths - Inline interactive_repo_review.html as raw html block with Pyodide loading - Move _includes/pyproject.md to _partials/ and update include paths - Update .readthedocs.yaml from Ruby/Jekyll to Node.js/mystmd build - Update .pre-commit-config.yaml for new _partials/ path - Remove all Jekyll infrastructure: Gemfile, _config.yml, _plugins/, _sass/, _includes/, assets/js/tabs.js Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Assisted-by: copilot-cli:claude-sonnet-4.6 * fix: use iframe for repo-review, restore style.md, fix TOC and rr-role - Replace raw HTML block in repo_review.md with {iframe} directive pointing to https://scientific-python.github.io/repo-review/ — the book-theme has no renderer for type:"html" blocks, so raw HTML was rendered as escaped text in the static output; iframe is natively supported - Remove html_head_extra frontmatter from repo_review.md (unsupported by the book-theme, was generating a build warning) - Remove fetch_repo_review_app.sh step from .readthedocs.yaml (no longer needed with external iframe URL) - Simplify rr-role.mjs: remove broken rawHtmlTransform (ran after htmlTransform so type:"html" nodes were never further processed) - Restore style.md (was accidentally emptied by shell redirection in prior session); re-converted from original Jekyll source - Fix myst.yml: add .md extensions to all 29 TOC entries to resolve build warnings about missing file extensions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Assisted-by: cli:claude-sonnet-4.6 * docs: fix post-migration rendering issues - Fix {% rr PP007 %} unconverted liquid tag in _partials/pyproject.md - Remove {% raw %}/{% endraw %} from coverage.md - Fix split note box title in packaging_simple.md - Hide right-sidebar outline on homepage (site.hide_outline) - Fix TOC duplication: use file+children instead of title+children - Add {tableofcontents} to all section index pages (tutorials, guides, principles, patterns) - Add sync:coverage-tool to coverage page tab-sets - Add sync:docs-framework to all Sphinx/MkDocs tab-sets in docs.md - Remove id attribute from rr-btn spans to fix duplicate identifier warnings Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Assisted-by: copilot-cli:claude-sonnet-4.6 * docs: add tab sync, fix implicit refs, update AGENTS.md - Add explicit MyST labels to testing.md headings to fix implicit target warnings (public-interface-tests, project-level-integration-tests, unit-tests, additional-types-of-test-suites, fuzz-tests, end-to-end-tests) - Add sync:publish-method to Trusted Publishing/Token tabs in gha_pure.md and gha_wheels.md (cross-page sync) - Add sync:compiled-backend to Scikit-build-core/Meson-python/Maturin tabs in packaging_compiled.md (4 tab-sets now sync) - Update AGENTS.md: docs site is now MyST (not Jekyll) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Assisted-by: copilot-cli:claude-sonnet-4.6 * docs: fix tab sync keys to use tab names Sync keys must match the tab label, not a group name, so that MyST can identify matching tabs across tab-sets. - docs.md: sphinx, mkdocs - gha_pure.md + gha_wheels.md: trusted-publishing, token - packaging_compiled.md: scikit-build-core, meson-python, maturin - coverage.md was already correct (coverage, pytest-cov) - Update AGENTS.md with correct sync key convention Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Assisted-by: copilot-cli:claude-sonnet-4.6 * chore: move to rumdl instead of prettier Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * fix: broken raw / badges in a few places Assisted-by: CopilotCLI:claude-hauku-4.5 Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * ci: fix readthedocs Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * fix: colorize toml blocks Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * chore: move bun to top level Assisted-by: CopilotCLI:claude-haiku-4.5 Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * docs: use anywidget Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * docs: a few more bits of polish Signed-off-by: Henry Schreiner <henryfs@princeton.edu> Assisted-by: CopilotCLI:GPT-5.4-mini * chore: use webapp package Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * fix: use anywidget Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * style: pre-commit fixes * fix: docs and one more prettier Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * style: pre-commit fixes * fix: rtd error Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * fix: some warnings Assisted-by: OpenCode:glm-5.1 Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * fix: rumld broke ToC Assisted-by: OpenCode:glm-5.1 Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * fix: ensure thebe off Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * Remove HTML head meta tag from myst.yml Remove unnecessary HTML head meta tag from configuration. * fix: scope toml→ini to docs, pin schema-store, add docs CI - Revert the toml→ini fence change in src/sp_repo_review/checks/*.py; those docstrings render in repo-review itself, so the docs-only highlighter workaround (code_fence cog helper) should not leak into the published package. - Restore validate-pyproject-schema-store pin to 2026.04.03 in the repo_review anywidget deps (was unintentionally downgraded). - Add a PR-time MyST build check (reusable-docs.yml) wired into CI via change detection on docs/helpers/package.json/bun.lock/.readthedocs.yaml. - Clarify in AGENTS.md that the ini-for-toml workaround is docs-only. Assisted-by: ClaudeCode:claude-opus-4.8 * fix: restore exact-case id anchor on rr badges Emit a span with an explicit html_id instead of dropping the id or using MyST's identifier/label (which lowercases and de-duplicates). This restores the id="PP007" anchors so repo-review deep-links resolve, preserves their case for the case-sensitive fragment match, and avoids the duplicate identifier warning since badges legitimately repeat across pages. Assisted-by: ClaudeCode:claude-opus-4.8 --------- Assisted-by: ClaudeCode:claude-opus-4.8 Assisted-by: CopilotCLI:claude-hauku-4.5 Assisted-by: CopilotCLI:GPT-5.4-mini Assisted-by: copilot-cli:claude-sonnet-4.6 Signed-off-by: Henry Schreiner <henryfs@princeton.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent cc6c89c commit d8a8d57

62 files changed

Lines changed: 1470 additions & 2148 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,18 @@ jobs:
2525
if: fromJSON(needs.change-detection.outputs.run-rr)
2626
uses: ./.github/workflows/reusable-rr-tests.yml
2727

28+
docs:
29+
needs: change-detection
30+
if: fromJSON(needs.change-detection.outputs.run-docs)
31+
uses: ./.github/workflows/reusable-docs.yml
32+
2833
pass:
2934
if: always()
3035
needs:
3136
- change-detection
3237
- cookie
3338
- rr-tests
39+
- docs
3440
runs-on: ubuntu-latest
3541

3642
steps:
@@ -50,5 +56,11 @@ jobs:
5056
|| '
5157
rr-tests,
5258
'
59+
}} ${{
60+
fromJSON(needs.change-detection.outputs.run-docs)
61+
&& ''
62+
|| '
63+
docs,
64+
'
5365
}}
5466
jobs: ${{ toJSON(needs) }}

.github/workflows/reusable-change-detection.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
run-rr:
99
description: Whether or not run the repo-review tests
1010
value: ${{ jobs.change-detection.outputs.run-rr || false }}
11+
run-docs:
12+
description: Whether or not to build the docs site
13+
value: ${{ jobs.change-detection.outputs.run-docs || false }}
1114

1215
jobs:
1316
change-detection:
@@ -17,6 +20,7 @@ jobs:
1720
outputs:
1821
run-cookie: ${{ steps.cookie-changes.outputs.run-cookie || false }}
1922
run-rr: ${{ steps.rr-changes.outputs.run-rr || false }}
23+
run-docs: ${{ steps.docs-changes.outputs.run-docs || false }}
2024
steps:
2125
- uses: actions/checkout@v6
2226

@@ -63,3 +67,24 @@ jobs:
6367
steps.changed-rr-files.outputs.added_modified_renamed != '[]'
6468
id: rr-changes
6569
run: echo "run-rr=true" >> "${GITHUB_OUTPUT}"
70+
71+
- name: Changed docs-related files
72+
if: github.event_name == 'pull_request'
73+
id: changed-docs-files
74+
uses: Ana06/get-changed-files@v2.3.0
75+
with:
76+
format: "json"
77+
filter: |
78+
.github/workflows/ci.yml
79+
.github/workflows/reusable-docs.yml
80+
docs/**
81+
helpers/**
82+
package.json
83+
bun.lock
84+
.readthedocs.yaml
85+
- name: Set a flag for building the docs
86+
if: >-
87+
github.event_name != 'pull_request' ||
88+
steps.changed-docs-files.outputs.added_modified_renamed != '[]'
89+
id: docs-changes
90+
run: echo "run-docs=true" >> "${GITHUB_OUTPUT}"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Docs
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build:
8+
name: Build MyST site
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 10
11+
steps:
12+
- uses: actions/checkout@v6
13+
14+
- uses: oven-sh/setup-bun@v2
15+
16+
- name: Install dependencies
17+
run: bun install --frozen-lockfile
18+
19+
- name: Build the docs
20+
run: bun run build
21+
22+
- name: Upload built site
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: docs-html
26+
path: docs/_build/html

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ docs/assets/js/repo-review-app.min.js.map
148148
# NodeJS stuff, just in case (developer tooling)
149149
node_modules/
150150
package-lock.json
151-
package.json
152151

153152
# readthedocs
154153
_readthedocs

.pre-commit-config.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ repos:
3232
rev: "v0.15.14"
3333
hooks:
3434
- id: ruff-check
35-
args: ["--fix", "--show-fixes"]
35+
args: ["--fix"]
3636
- id: ruff-format
3737

3838
- repo: https://github.com/pre-commit/pygrep-hooks
@@ -63,8 +63,13 @@ repos:
6363
rev: "v3.8.3"
6464
hooks:
6565
- id: prettier
66-
types_or: [yaml, markdown, html, css, scss, javascript, json]
67-
args: [--prose-wrap=always]
66+
types_or: [yaml, html, css, scss, javascript, json]
67+
68+
- repo: https://github.com/rvben/rumdl-pre-commit
69+
rev: v0.2.0
70+
hooks:
71+
- id: rumdl
72+
args: [--no-exclude] # Disable all exclude patterns
6873

6974
- repo: https://github.com/crate-ci/typos
7075
rev: "v1.46.3"
@@ -92,5 +97,5 @@ repos:
9297
name: Cog the pages
9398
language: python
9499
entry: cog -P -r -I ./helpers
95-
files: "^docs/pages/guides/(packaging_compiled|docs|tasks|gha_basic).md|^copier.yml|^docs/_includes/pyproject.md"
100+
files: "^docs/pages/guides/(packaging_compiled|docs|tasks|gha_basic).md|^copier.yml|^docs/_partials/pyproject.md"
96101
additional_dependencies: [cogapp, cookiecutter, tomlkit]

.readthedocs.yaml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
# .readthedocs.yaml
2-
# Read the Docs configuration file
1+
# Read the Docs configuration file for myst
32
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
43

54
# Required
65
version: 2
76

8-
# Set the version of Python and other tools you might need
97
build:
108
os: ubuntu-24.04
11-
129
tools:
13-
ruby: "3.4"
14-
10+
nodejs: "24"
1511
commands:
16-
- ./helpers/fetch_repo_review_app.sh
17-
- bundle install
18-
- >
19-
JEKYLL_ENV=production bundle exec jekyll build --destination
20-
_readthedocs/html --baseurl $(echo -n "$READTHEDOCS_CANONICAL_URL" | cut
21-
-d '/' -f 4-)
12+
# Install myst
13+
- npm install -g mystmd
14+
# Build the site
15+
- cd docs && myst build --html
16+
# Copy the output to Read the Docs expected location
17+
- mkdir -p $READTHEDOCS_OUTPUT/html/
18+
- cp -r docs/_build/html/. "$READTHEDOCS_OUTPUT/html"
19+
# Clean up build artifacts
20+
- rm -rf docs/_build

.ruby-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

AGENTS.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Agent Guide for scientific-python/cookie
2+
3+
This repo has three distinct concerns: a **cookiecutter/copier template** for
4+
new Python projects (`{{cookiecutter.project_name}}/`), a **repo-review plugin**
5+
(`src/sp_repo_review/`), and a **MyST/MystMD-based developer guide** (`docs/`).
6+
7+
## Key commands
8+
9+
### sp-repo-review (the package)
10+
11+
- Run tests: `uv run pytest` (or `uvx nox -s rr_tests`)
12+
- Run linting (pre-commit via prek): `uvx nox -s rr_lint`
13+
- Run pylint: `uvx nox -s rr_pylint`
14+
- Run the CLI: `uvx nox -s rr_run -- <path>`
15+
- Regenerate README check list via cog: `uvx nox -s readme`
16+
- Build wheel/sdist: `uvx nox -s rr_build`
17+
18+
Important: tests run with `PYTHONWARNDEFAULTENCODING=1`.
19+
20+
### Cookie template validation
21+
22+
The noxfile generates temporary projects for **all 9 backends** × **vcs on/off**
23+
× **3 docs engines** (sphinx/mkdocs/zensical). These are slow.
24+
25+
- `nox -s "tests(hatch)"` — run generated project tests for a single backend
26+
- `nox -s "lint(hatch)"` — run pre-commit (`prek`) on generated project
27+
- `nox -s "dist(hatch)"` — verify build output includes LICENSE
28+
- `nox -s "native(hatch)"` — test hatch/pdm/poetry native test runners
29+
- `nox -s compare_copier` — verify cookiecutter and copier produce identical
30+
files
31+
- `nox -s compare_cruft` — verify cookiecutter and cruft produce identical files
32+
- `nox -s gha_bump` — bump GitHub Actions versions across docs and templates
33+
- `nox -s pc_bump` — bump pre-commit hook versions across docs and templates
34+
35+
## Architecture notes
36+
37+
- **Template directory**: `{{cookiecutter.project_name}}/` contains the
38+
cookiecuttter template. Copier reads `copier.yml`; cookiecutter reads
39+
`cookiecutter.json`. Keep them in sync; `compare_copier` checks this.
40+
- **Entry points**: `sp_repo_review` registers `repo-review`
41+
checks/families/fixtures via `[project.entry-points]` in `pyproject.toml`.
42+
- **Generated docs**: The README check list (line ~300+) is a cog block. Do not
43+
edit it by hand; run `nox -s readme` or cog will fail in CI.
44+
- **Cookie template `.pre-commit-config.yaml`** uses `prek` (a Rust-based
45+
pre-commit alternative), not `pre-commit`.
46+
- **Ruff hook ID**: `.pre-commit-config.yaml` uses `ruff-check` as the hook id
47+
(not `ruff`), for pre-commit 4.x compatibility.
48+
49+
## Style and conventions
50+
51+
- `tool.pytest.ini_options.norecursedirs` excludes
52+
`{{cookiecutter.project_name}}` so pytest does not descend into the template
53+
directory.
54+
- `tool.ruff.extend-exclude` also excludes `\{\{cookiecutter.project_name\}\}`
55+
(double-escaped in TOML).
56+
- `tool.mypy.python_version = "3.10"`; the `sp_repo_review.*` override enforces
57+
`disallow_untyped_defs=True`.
58+
- `tool.pylint.master.ignore-paths` ignores `src/sp_repo_review/_version.py`
59+
(auto-generated by hatch-vcs).
60+
- Ruff selects `ALL` with many ignores; notable: `S101` (assert) and `D`
61+
(docstrings) are globally disabled.
62+
63+
## CI quirks
64+
65+
- CI uses change detection to decide whether to run cookie tests or rr-tests.
66+
Both are required to pass for the `pass` job.
67+
- rr-tests matrix runs on Python 3.10, 3.12, 3.14 across ubuntu/macos/windows.
68+
- Cookie tests reuse the same `reusable-cookie.yml` workflow.
69+
70+
## Docs site (MyST)
71+
72+
- Migrated from Jekyll to [MyST](https://mystmd.org) (JupyterBook 2.0) using the
73+
`scientific-python-myst-theme`.
74+
- Node/Bun-based; from the repo root, run `bun install` then `bun run build` to
75+
build the site.
76+
- Config: `docs/myst.yml` (TOC, project settings),
77+
`docs/config/scientific-python.yml` (theme options).
78+
- Custom plugin: `docs/rr-role.mjs` — provides `{rr}` inline role for
79+
repo-review badge spans.
80+
- Custom CSS: `docs/assets/css/site.css` — only `.rr-btn` badge styling remains.
81+
- Docs pages in `docs/pages/` contain cog blocks that auto-generate config
82+
examples from the template.
83+
- The repo-review interactive page is embedded using an `{anywidget}` directive
84+
(see `docs/pages/guides/repo_review.md`).
85+
- Tab-sets use `:sync: <tab-name>` for cross-page tab synchronization, where the
86+
sync key is the tab label itself (e.g., `sphinx`, `mkdocs`,
87+
`trusted-publishing`, `scikit-build-core`).
88+
- TOML code blocks in the docs use "ini" to get syntax highlighting for now.
89+
This is applied only at the docs layer (the `code_fence` cog helper in
90+
`helpers/cog_helpers.py` rewrites `toml``ini`); do **not** change the `toml`
91+
fences in the `src/sp_repo_review/checks/*.py` docstrings, which are rendered
92+
by repo-review itself, not this site.

Gemfile

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)