Contributing¶
Set up a development environment¶
-
Clone the repository. The default branch is
master. -
Create the environment with the package and its development tools (
pytest,pytest-cov,ruff):
Run the tests¶
There is one test file per extension in tests/, for example
tests/test_keys.py and tests/test_md_mako.py, plus
tests/test_version.py and tests/test_issue102_rendering.py. The suite has
163 tests.
With coverage:
Add or change an extension¶
- Put the extension in its own module,
mdx_steroids/<name>.py. - Define options in the extension class as
self.config = {"option": [default, "description"]}and callsuper().__init__(*args, **kwargs)afterwards. - Register processors in
extendMarkdown(self, md)with an explicit priority. Check the priority table so the new processor runs at the right moment relative to the others. - Add a module-level
makeExtension(*args, **kwargs)that returns the extension. - Add
tests/test_<name>.pywith input Markdown and the expected HTML. - Add a page in
src_docs/md/extensions/and list it in thenavofsrc_docs/mkdocs.yml.
New source files start with a this_file: comment that gives their path.
Build the package and the documentation¶
./build.sh # documentation and package
./build.sh docs # documentation only, into docs/
./build.sh package # dist/*.whl and dist/*.tar.gz, then twine check
The documentation source is in src_docs/md/, its configuration in
src_docs/mkdocs.yml. src_docs/build.sh builds it with ProperDocs and the
MaterialX theme in strict mode, so a broken link or any other warning fails the
build. For a live preview that also reloads when files in mdx_steroids/
change:
Do not edit docs/ by hand. The Docs workflow rebuilds it and commits it
after every push to master that changes src_docs/. GitHub Pages serves it at
https://vexy.dev/vexy-python-markdown-steroids/.
Release¶
The version comes from the latest vX.Y.Z git tag through hatch-vcs.
./publish.sh makes a release:
uvx gitnextvercommits pending changes, tags the nextvX.Y.Zand pushes../build.sh packagebuilds the wheel and source distribution.uv publish dist/*uploads them to PyPI. It needsUV_PUBLISH_TOKENor anotheruv publishcredential.
The repository has no CI workflow that uploads to PyPI.
Report a problem¶
Open an issue at https://github.com/vexyart/vexy-python-markdown-steroids/issues with the Markdown input, the extension options and the HTML you got.