All Projects → edoburu → sphinxcontrib-django

edoburu / sphinxcontrib-django

Licence: Apache-2.0 license
This is a sphinx extension which improves the documentation of Django apps.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to sphinxcontrib-django

sphinx rtd dark mode
Adds a toggleable dark mode to the Read the Docs theme for Sphinx.
Stars: ✭ 29 (-21.62%)
Mutual labels:  sphinx, sphinx-doc, sphinx-extension
sphinx-rest-cheatsheet
A compact cheat sheet for writing documentation string for Sphinx, with focus on Python.
Stars: ✭ 17 (-54.05%)
Mutual labels:  sphinx, docstrings
emojicodes
An extension to use emoji codes in your Sphinx documentation! 😍
Stars: ✭ 39 (+5.41%)
Mutual labels:  sphinx, sphinx-extension
panda3d-docs
Sphinx documentation for Panda3D
Stars: ✭ 37 (+0%)
Mutual labels:  sphinx, sphinx-doc
sphinxcontrib-programoutput
Sphinx extension for capturing program output
Stars: ✭ 29 (-21.62%)
Mutual labels:  sphinx, sphinx-extension
sphinx-server
Sphinx documentation Docker image with Python server and support for PlantUML and more.
Stars: ✭ 62 (+67.57%)
Mutual labels:  sphinx, sphinx-doc
matlabdomain
A Sphinx extension for documenting Matlab code
Stars: ✭ 34 (-8.11%)
Mutual labels:  sphinx, sphinx-extension
openapi
OpenAPI (fka Swagger) spec renderer for Sphinx.
Stars: ✭ 78 (+110.81%)
Mutual labels:  sphinx, sphinx-extension
sphinx-wavedrom
A sphinx extension that allows including wavedrom diagrams by using its text-based representation
Stars: ✭ 26 (-29.73%)
Mutual labels:  sphinx, sphinx-extension
sphobjinv
Toolkit for manipulation and inspection of Sphinx objects.inv files
Stars: ✭ 53 (+43.24%)
Mutual labels:  sphinx, sphinx-doc
sphinxcontrib-hdl-diagrams
Sphinx Extension which generates various types of diagrams from Verilog code.
Stars: ✭ 37 (+0%)
Mutual labels:  sphinx, sphinx-extension
sphinx-revealjs
Presentation builder for Pythonista
Stars: ✭ 56 (+51.35%)
Mutual labels:  sphinx, sphinx-extension
sphinx-toolbox
Box of handy tools for Sphinx 🧰 📔
Stars: ✭ 55 (+48.65%)
Mutual labels:  sphinx, sphinx-extension
autodoc pydantic
Seamlessly integrate pydantic models in your Sphinx documentation.
Stars: ✭ 60 (+62.16%)
Mutual labels:  sphinx, sphinx-extension
sphinx-codeautolink
Automatic links from code examples to reference documentation
Stars: ✭ 41 (+10.81%)
Mutual labels:  sphinx, sphinx-extension
sphinx-hoverxref
Sphinx extension to show tooltips with content embedded when hover a reference.
Stars: ✭ 77 (+108.11%)
Mutual labels:  sphinx, sphinx-extension
restbuilder
A Sphinx builder/writer to output reStructuredText (rst) files
Stars: ✭ 25 (-32.43%)
Mutual labels:  sphinx-doc, sphinx-extension
gui-python-gtk
Repositório criado para documentar e centralizar conteúdos, dicas, tutoriais e exemplos de código sobre a construção de interfaces com a linguagem de programação Python (PyGObject) e o toolkit gráfico Gtk 4.
Stars: ✭ 85 (+129.73%)
Mutual labels:  sphinx, sphinx-doc
MapServer-documentation
Source repository for the MapServer documentation, for the live website. Please submit pull requests to the 'main' branch.
Stars: ✭ 29 (-21.62%)
Mutual labels:  sphinx, sphinx-doc
sphinx-theme
(Deprecated) Make Sphinx docs look like MDN
Stars: ✭ 27 (-27.03%)
Mutual labels:  sphinx, sphinx-doc
GitHub Workflow Status PyPi Code coverage Black Code Style GitHub license Documentation Status

logo

sphinxcontrib-django

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:)

Installation

Install the package via pip:

pip install sphinxcontrib-django

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_django to installed extensions
extensions = [
    "sphinxcontrib_django",
]

# Configure the path to the Django settings module
django_settings = "myapp.settings"

Optionally, you can include the table names of your models in their docstrings with:

# Include the database table names of Django models
django_show_db_tables = True

Advanced Usage

If you want to run custom code which depends on Django, e.g. to monkeypatch your application during documentation build, you might run into an ImproperlyConfigured exception:

Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

Therefore, this Sphinx extension emits the event django-configured after django.setup() is finished, so you can run your code the following way in conf.py:

def patch_django(app):
    """
    Your custom code here
    """

def setup(app):
    app.connect("django-configured", patch_django)

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

The documentation is automatically deployed to Read the Docs.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].