Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,497 changes: 892 additions & 605 deletions DESIGN.md

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions docs/_github_slugs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""GitHub-style heading slugs for MyST (importable for Sphinx env pickling).

DESIGN.md's table of contents uses GitHub anchor links such as
``#1-overview-and-scope``; MyST's default slugger drops the leading digits,
so we mirror GitHub's rule: lowercase, strip punctuation, spaces → dashes.
"""

from __future__ import annotations

import re


def github_heading_slug(title: str) -> str:
"""Return the GitHub anchor slug for one heading title."""

slug = re.sub(r"[^\w\- ]", "", title.strip().lower())
return slug.replace(" ", "-")
2 changes: 0 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ Mesh-independent observables operating on a :class:`~lax.spectral.Spectrum`.

.. autofunction:: lax.spectral.coupled_channel_parameters_from_S

.. autofunction:: lax.spectral.pade_interpolate

lax.models
----------

Expand Down
14 changes: 14 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,22 @@
"sphinx.ext.viewcode",
"sphinx_copybutton",
"nbsphinx",
"myst_parser",
]

# MyST renders the Markdown architecture reference (docs/design.md includes the
# repository-root DESIGN.md). dollarmath/amsmath enable its $…$/$$…$$ math;
# heading anchors make the document's own #section links resolve.
myst_enable_extensions = ["dollarmath", "amsmath"]
myst_heading_anchors = 4


# GitHub-style slugs so DESIGN.md's own #section links resolve. Referenced
# by import string (not a conf.py-local function) so the Sphinx environment
# stays picklable.
sys.path.insert(0, str(Path(__file__).parent))
myst_heading_slug_func = "_github_slugs.github_heading_slug"

# ---------------------------------------------------------------------------
# Source / output
# ---------------------------------------------------------------------------
Expand Down
13 changes: 13 additions & 0 deletions docs/design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Architecture reference

```{include} ../DESIGN.md
:end-before: "---"
```

```{include} ../DESIGN.md
:start-after: "[Appendix C: Implementation sharp edges](#appendix-c-implementation-sharp-edges)"
```

% The Markdown table of contents is skipped above: it forward-references
% GitHub-style heading anchors (redundant here — Furo provides the local
% sidebar TOC, and the anchor links only resolve on warm Sphinx rebuilds).
1 change: 0 additions & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ from committed outputs; run them locally with ``uv run jupyter lab`` (see
notebooks/descouvemont_o16_ca44_demo
notebooks/descouvemont_closed_channels_demo
notebooks/fourier_demo
notebooks/energy_dependent_demo
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ Key features:

api
examples
design

Links
-----

- `Source code <https://github.com/beykyle/lax>`_
- `Architecture reference (DESIGN.md) <https://github.com/beykyle/lax/blob/main/DESIGN.md>`_
- :doc:`Architecture reference (DESIGN.md) <design>`
- `Issue tracker <https://github.com/beykyle/lax/issues>`_
107 changes: 65 additions & 42 deletions examples/alpha_pb_demo.ipynb

Large diffs are not rendered by default.

275 changes: 158 additions & 117 deletions examples/descouvemont_closed_channels_demo.ipynb

Large diffs are not rendered by default.

358 changes: 224 additions & 134 deletions examples/descouvemont_np_demo.ipynb

Large diffs are not rendered by default.

271 changes: 177 additions & 94 deletions examples/descouvemont_o16_ca44_demo.ipynb

Large diffs are not rendered by default.

268 changes: 0 additions & 268 deletions examples/energy_dependent_demo.ipynb

This file was deleted.

29 changes: 26 additions & 3 deletions examples/fourier_demo.ipynb

Large diffs are not rendered by default.

Loading
Loading