I don't expect this project to be huge, so feel free to drop an issue or pull request on GitHub to report bugs or suggest features. Running tests and updating documentation before submitting a pull request is appreciated ^^
Install necessary packages in a virtual environment:
$ mkdir venv
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txtRun hatch test in the project's root directory. Tests are located in tests/; carefully modify tests if adding new features. If you are unfamiliar with hatch's tests, here's a brief rundown of how they work:
- Files whose names begin with
file_or end with_fileare automatically detected as test drivers, and within them, functions whose names begin withtest_are run as tests (this is the same behavior aspytestsince that's whathatchuses). - For each test function, the tests to run (i.e. test files) are passed in via a
@parametrizedecorator. - Each test corresponds to a pair of test files: the Markdown input
[name].txtand the expected output[name]_expected.txt. For all tests except for those intests/utils/, these filenames are passed torun_extension_test()intests/tests_utils.py, so it is imperative that they follow this specific filename format.
(These tests also print out any "incorrect" output, so this can be a good way to test work-in-progress changes without having to set up an actual driver.)
Module, class, and function documentation are generated automatically from docstrings by sphinx.ext.autodoc. To update the documentation, simply update the docstrings in the Python source files in src/, and Read the Docs will automatically run Sphinx to regenerate the documentation when I create a new release. Alternatively, to generate the documentation manually for testing, run make html in the docs/ directory and then open docs/_build/html/index.html in a browser.
Docstrings use Google style, although a sprinkle of reStructuredText/Sphinx style is used for things like controlling syntax highlighting on code blocks.