- Rust toolchain
- Python 3.10+
- maturin
- fastship>=0.0.11, installed by
pip install -e '.[dev]'
For local development, build and install the extension into your environment:
maturin developship-rs-build builds the distributable wheel. The xhtmlmd command is a Python console script (python/xhtmlmd/__main__.py) over the to_xhtml API; there is no separate Rust binary.
pytest -qAll tests are Python (tests/), run against the built extension; there are no cargo test unit tests.
python tools/gen_docs.py
python tools/gen_docs.py --checkThe Python rewrite API gets edit nodes from the native edit_nodes function. During the block parse, ContainerBuilder records the line ranges of paragraphs, headings, and pipe tables, including those nested in containers. Opaque blocks such as code, raw HTML, block math, and grid tables produce no editable ranges. The inline edit scanner runs only over those ranges and shares the parser's math, code-span, image-destination, and link-label helpers.
Native offsets refer to normalized UTF-8 input. The Python wrapper maps them back to character offsets in the original string, including CRLF input, invokes callbacks in source order, and applies their replacements in reverse order. Edit nodes should be added only for constructs with exact contiguous source ranges; they do not require or imply a source-mapped semantic AST.
Publishing is handled by GitHub Actions in .github/workflows/ci.yml and is triggered by pushing a tag matching v*.
Release flow is: release first, then bump.
- Confirm tests pass:
pytest -q-
Confirm the release version in
Cargo.toml([package].version).pyproject.tomlgets the Python package version from Cargo viadynamic = ["version"]. -
Tag that commit and push the tag:
ship-rs-release- After pushing the release tag, run
ship-rs-bump, commit theCargo.tomlversion bump, and push tomainwithout a tag.
No local wheel build is required for release. CI builds wheels for Linux and macOS, creates a GitHub Release, and publishes to PyPI.