sphinx-ape: Build Sphinx Documentation for ApeWorX plugins
Project description
Overview
sphinx-ape is a documentation plugin for the Sphinx framework.
The purpose of this plugin to share code for generating documentation across all ApeWorX repositories.
Dependencies
- python3 version 3.10 up to 3.14.
Install
Install the package from GitHub:
pip install git+https://github.com/ApeWorX/sphinx-ape.git@main
NOTE: Also, you may clone and the package first and install locally.
Try sphinx-ape --help to check if it's installed.
Quick Usage
To use this sphinx plugin, first generate the docs structure (ran from your project directory):
sphinx-ape init .
It will have generated a docs/ folder with some necessary config file in it, along with a quick-start that links to your README.md.
Now, you can begin writing your Sphinx documentation. There are three directories you can place documentation sources in:
userguides/- a directory containing how-to guides for how to use your package.commands/-.rstfiles for thesphinx-clickplugin for CLI-based references.methoddocs/- Autodoc.rstfiles controlling your generated method documentation.
Once you have developed your documentation, ensure you have sphinx-ape installed.
For example, clone this repo and install it using pip install <path/to/sphinx-ape> or install from pypi by doing pip intall sphinx-ape.
After sphinx-ape is installed, build your projects' documentation by doing:
sphinx-ape build <path/to/project>
Most commonly, you will already be in your project's directory, so you will do:
sphinx-ape build .
Then, to view the documentation, run the serve command:
sphinx-ape serve <path/to/project>
# When in directory already
sphinx-ape serve .
To automatically open a browser at the same time as serving, use the --open flag:
sphinx-ape serve . --open
To run your doc-tests, use the sphinx-ape test command:
sphinx-ape test .
Auto-TOC Tree
The sphinx-ape init command creates an index.rst file.
This file represents the table of contents for the docs site.
Any files not included in the TOC are not included in the documentation.
sphinx-ape generates a simple default file with the contents:
.. dynamic-toc-tree::
To customize the files included in the TOC, specify each respective guide-set name (e.g. userguides).
Also use this feature to control the ordering of the guides; otherwise the default is to include all guides in the directory in alphabetized order.
.. dynamic-toc-tree::
:userguides: guide0, guide1, final
You can also specify the guides in a list pattern:
.. dynamic-toc-tree::
:userguides:
- quickstart
- guide0
- guide1
- final
GitHub Action
This GitHub action is meant for building the documentation in both core Ape as well any Ape plugin. The action may also work for regular Python packages with a documentation-strategy similar to Ape.
There are three GitHub events that trigger this action:
-
Push to 'main': we build into 'latest/'. The GitHub action will commit these changes to the 'gh-pages' branch.
-
Release: we copy 'latest/' into the release dir, as well as to 'stable/'. The GitHub action will commit these changes to the 'gh-pages' branch.
-
Pull requests or local development: We ensure a successful build.
GitHub Pages
To set up this action with GitHub pages for the release-workflow to work, first create a branch named gh-pages and push it to GitHub.
Then, delete everything besides a simple README.md, the .gitignore file, and the LICENSE file.
Once that is all pushed, verify on the Pages tab that a site was made for you.
Now, on merges to main and releases, this site should be updated (if you are using the action).
To publish the docs locally, use the publish command:
sphinx-ape publish .
Development
Please see the contributing guide to learn more how to contribute to this project. Comments, questions, criticisms and pull requests are welcomed.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sphinx_ape-0.1.1.tar.gz.
File metadata
- Download URL: sphinx_ape-0.1.1.tar.gz
- Upload date:
- Size: 71.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db54eda34b8a978b71e2565de0b4def85703223bc4c94cb22c4b7a05cfb0c52c
|
|
| MD5 |
4eae9454bd811b49f30642e8d402fd26
|
|
| BLAKE2b-256 |
d414a5d6e7055f03114cd36c9e949b1de8b1d328fae0996a8096532eb67d9cfd
|
Provenance
The following attestation bundles were made for sphinx_ape-0.1.1.tar.gz:
Publisher:
publish.yaml on ApeWorX/sphinx-ape
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_ape-0.1.1.tar.gz -
Subject digest:
db54eda34b8a978b71e2565de0b4def85703223bc4c94cb22c4b7a05cfb0c52c - Sigstore transparency entry: 738480610
- Sigstore integration time:
-
Permalink:
ApeWorX/sphinx-ape@cd8775336e0d7b82f382e96dd929708e833c7f85 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ApeWorX
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@cd8775336e0d7b82f382e96dd929708e833c7f85 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sphinx_ape-0.1.1-py3-none-any.whl.
File metadata
- Download URL: sphinx_ape-0.1.1-py3-none-any.whl
- Upload date:
- Size: 62.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd4afbe2c6ad7438b99a383c76aa9e585ab7f9ef9462a38b186ae144eafe774b
|
|
| MD5 |
e56f0118cfab06de2fcc4c78496f7fa8
|
|
| BLAKE2b-256 |
192e3e48ebc50b3a8eb508fe8032238c86ad0567e40153c70d8eb20167c426bb
|
Provenance
The following attestation bundles were made for sphinx_ape-0.1.1-py3-none-any.whl:
Publisher:
publish.yaml on ApeWorX/sphinx-ape
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_ape-0.1.1-py3-none-any.whl -
Subject digest:
dd4afbe2c6ad7438b99a383c76aa9e585ab7f9ef9462a38b186ae144eafe774b - Sigstore transparency entry: 738480665
- Sigstore integration time:
-
Permalink:
ApeWorX/sphinx-ape@cd8775336e0d7b82f382e96dd929708e833c7f85 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ApeWorX
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@cd8775336e0d7b82f382e96dd929708e833c7f85 -
Trigger Event:
release
-
Statement type: