Skip to content

Move the documentation from Sphinx to Zensical, refresh the README and its animations - #500

Merged
basnijholt merged 13 commits into
mainfrom
docs/zensical
Oct 15, 2026
Merged

basnijholt merged 13 commits into
mainfrom
docs/zensical

Conversation

@basnijholt

Copy link
Copy Markdown
Member

Description

Replaces the Sphinx/myst-nb documentation with Zensical (the successor of Material for MkDocs), refreshes the README, and re-renders its animations. All existing content is kept, and the old page URLs (/tutorial/tutorial.Learner1D/, /reference/adaptive.runner.Runner/, _static/logo.png, ...) keep working.

Docs build

  • zensical.toml configures the site: light/dark/auto palette based on the logo colors, search, code copy, edit/view links, footer navigation.
  • The executable pages (tutorials, algorithms and examples, benchmarks) live in docs/notebooks/ as jupytext MyST notebooks; the MyST roles and directives were converted to Zensical Markdown (admonitions, autorefs, snippets).
  • docs/build_notebooks.py executes them with nbclient (cached in .notebook_cache/, keyed by the source and library versions) and renders them into docs/ with their outputs embedded: HoloViews/Bokeh plots including HoloMap sliders, ipywidgets (live_info) via saved widget state, Plotly, DataFrames, images, and tracebacks. Each page also gets a downloadable .ipynb. The rendered pages are gitignored.
  • The API reference is rendered from the docstrings with mkdocstrings. docs/griffe_sphinx_refs.py turns the Sphinx-style references in the docstrings (`~adaptive.Runner`) into links at build time, so the library source is untouched.
  • README sections are included in the docs with snippets, so they stay in sync.
  • readthedocs.yml builds with uv and the new docs dependency group: run the notebooks, then zensical build --strict.

Locally:

uv run --group docs python docs/build_notebooks.py
uv run --group docs zensical serve

README and animations

  • docs/make_animations.py renders the README GIFs from real learner runs: 1D and 2D homogeneous versus adaptive sampling, both adding points one at a time, and the LearnerND plot from the "Algorithms and examples" page with a quarter cut away. It also renders the animated logo on the docs home page.
  • README: emoji removed from headings and the feature list, Python 3.11+, fixed learner list (duplicate BalancingLearner, missing SequenceLearner), no more JupyterLab extension install steps, a section on building the docs. The GIFs are referenced via raw.githubusercontent.com/.../main, so they show up on GitHub and PyPI once this is merged.

Removed

Sphinx conf.py, Makefile, templates, the unused RTD theme JS, docs/environment.yml, and the logo notebook/script (folded into make_animations.py).

Checklist

  • Fixed style issues using pre-commit run on all changed files
  • pytest passed — the library is unchanged; the docs tooling tests pass (uv run --group docs pytest docs/ -o addopts="", 22 passed). The full suite has 7 failures in test_to_dataframe that also happen on main with pandas 3.0 (DataSaver.load_dataframe, adaptive/learner/data_saver.py:152).

Also verified: a clean build passes zensical build --strict with no issues, and every page was checked in headless Chromium (light and dark mode, phone width) for rendered plots, widgets, Plotly, tables, working HoloMap sliders, and no console errors.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • (Code) style fix or documentation update
  • This change requires a documentation update

…ell outputs

- Serve from /en/latest/ (site_url) so the 404 page, canonical links, and
  sitemap work on Read the Docs, and build into _site/ because a top-level
  site/ directory breaks setuptools' package discovery for editable installs.
- Point Edit/View on rendered notebook pages to their docs/notebooks/ source.
- Bound zensical, mkdocstrings-python, and panel (avoids a panel pre-release),
  pin the KaTeX and html-manager CDN versions, and key the notebook cache on
  library versions so upgrades re-execute notebooks.
- Keep raw HTML outputs of hidden cells outside <details>, where Markdown
  escaped them, and collapse script-only outputs.
- Strip RST literals in numpy type headers, exclude __pycache__ from the site,
  restore blank lines in code examples, tidy the benchmarks admonitions, and
  fix the logo path in example-notebook.ipynb.
…utput cards

- Remove emoji from all headings, the README feature list, and the ToC summary.
- 1D animation starts from zero points, adds one point per frame at first,
  highlights the point the learner chose last, and uses an off-center peak
  that a homogeneous grid cannot hit by accident.
- 2D animation starts from four points.
- 3D animation shows the isosurface the LearnerND learns, refining from a
  crude blob into a sphere inside a cut-open shell, instead of a point cloud.
- Do not draw a white card in dark mode around the empty HoloViews loader
  output or the live_plot cancel button.
The homogeneous panels drew a fresh evenly spaced grid every frame, so all of
their points moved between frames. Use the same learners with uniform_loss
instead, so both panels only ever add points.
Drop the phase where points accumulate (early meshes looked like crude
blobs), learn 6000 points for a smoother surface, and sway the view so the
cut-away wedge stays visible.
Go back to the original look: the LearnerND plot from the "Algorithms and
examples" page (plotly markers, 5000 points, a quarter cut away) with the
camera orbiting it, rendered with kaleido.
@basnijholt
basnijholt merged commit 61ed359 into main Oct 15, 2026
19 checks passed
@basnijholt
basnijholt deleted the docs/zensical branch October 15, 2026 03:35
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