Include code examples to sphinx documentation
Project description
Sphinx Example Includer
Build Sphinx docs for the package's source code and automatically gaenerate .rst files from examples folder for the sphinx documentation
Installation
pip install sphinx_example_includer
Usage
usage: Sphinx Example Includer [-h] [--debug] [--info] [--overwrite] [--files FILES [FILES ...]] [--dest-dir DEST_DIR]
[--toc-fname TOC_FNAME] [--build] [--conf CONF] [--docs-dir DOCS_DIR] [--project-dir PROJECT_DIR]
[--index INDEX]
A Sphinx docs generation tool
options:
-h, --help show this help message and exit
--debug Showing debug messages
--info Showing info messages
--overwrite Overwrite files that already exists
--files FILES [FILES ...]
one or more files to be
--dest-dir DEST_DIR The output directory
--toc-fname TOC_FNAME
The name of the toc file
--build Build Sphinx docs.
--conf CONF The configuration file (e.g., pyproject.toml)
--docs-dir DOCS_DIR The directory of the documentation
--project-dir PROJECT_DIR
The path of the project's code
--index INDEX The name of the index file.
Example
python -m sphinx_example_includer --info --build --project src --files examples/*example*.py --overwrite
How to use it
Assumptions
- You have your example source code in
examples/
- Your code is documented so Sphinx can generate the docs for you.
Generating the docs
- Install the package
sphinx_example_includer
- In the directory of your project (that you want to document), run the command
python -m sphinx_example_includer --build
. Note that the--build
is the flag responsible for generating the docs. You can also specify the directory of your code with the flag--project
. - Include the examples into the docs. This can be done by running the same command with
--files
flag and you can choose multiple files using a pattern as shown in the example above.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sphinx_example_includer-0.3.tar.gz
.
File metadata
- Download URL: sphinx_example_includer-0.3.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e63242d8f77033fae5a27ba784c2ce4cfbd26ee3bcfe797dcdba5f5c9774fdc |
|
MD5 | 3b913685f78d348b9d84725b5327da87 |
|
BLAKE2b-256 | 08e5d8499654a56d4af1ccdb40b93eea2d16fc62af22d7a7df86faf3897078da |
File details
Details for the file sphinx_example_includer-0.3-py3-none-any.whl
.
File metadata
- Download URL: sphinx_example_includer-0.3-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a15ed35204418b1d465f74cd0efa4e28c7f0be37c1017a4a51cdcb73b420767b |
|
MD5 | cdf792fbfeab6fb2f41a7736b3b82c59 |
|
BLAKE2b-256 | 2ec92e33031705dd8cfa259a07f81a96436dbf1d556531b2ef35fa07f96d494e |