Improve the Sphinx autodoc for Django classes.
Project description
sphinxcontrib-django2
This is a sphinx extension which improves the documentation of Django apps.
Features
Improvements for the output of Sphinx’s autodoc for Django classes:
List all model and form fields as class parameters
Improve model field representations
Link related and reverse related fields to the referenced class
Hide irrelevant runtime information like declared_fieldsets, fieldsets and Meta from classes
Add information about autogenerated methods
Fix intersphinx mappings to Django modules
Custom text roles to cross-reference the documentations of Django (:setting:, :templatetag:, :templatefilter:, :fieldlookup:) and Sphinx (:event:, :confval:)
This is a fork of sphinxcontrib-django, which seems to be no longer maintained.
Installation
Install the package via pip:
pip install sphinxcontrib-django2
Configuration
Add the following to your Sphinx config file conf.py:
# Add source directory to sys.path
sys.path.insert(0, os.path.abspath("../src"))
# Add sphinxcontrib_django2 to installed extensions
extensions = [
"sphinxcontrib_django2",
]
# Configure the path to the Django settings module
django_settings = "myapp.settings"
Contributing
Pull requests are always welcome!
You can install all requirements of the development setup with the extras dev, test, doc and optional:
python3 -m venv .venv
source .venv/bin/activate
pip install -e .[dev,test,doc,optional]
pre-commit install
Run the tests and generate the coverage report with:
coverage run
coverage html
Build the documentation with:
cd docs
make html
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
Hashes for sphinxcontrib-django2-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96f57fc1844982283a534641d96503d2a72fea8533b0caaf60460683abd9fa39 |
|
MD5 | c0d7654531ef214977310d660fd82c76 |
|
BLAKE2b-256 | 4c8c10f0b84e778b60b6d0f57dce5c417675456bd8ad687c7bdf4c74f0897daf |
Hashes for sphinxcontrib_django2-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03638832b3f5e6938bf2c65b41d05f2603815fdec453e815b3b76649f3630341 |
|
MD5 | ed287d8ecfc0d1b99ca32bbbfc872e78 |
|
BLAKE2b-256 | 16b25564cb6ffdb6d2c608f05b8e92dcecc810300fa6d7e7c74641f41cd4e8b4 |