1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
import os
import sys
# Add directory containing dummy app to sys.path
sys.path.insert(0, os.path.abspath("."))
project = "sphinx dummy Test"
extensions = [
"sphinxcontrib_django",
"sphinx.ext.graphviz",
"sphinx.ext.inheritance_diagram",
]
# Configure Django settings module
django_settings = "dummy_django_app.settings"
autodoc_use_legacy_class_based = True
nitpicky = True
def patch_django_for_autodoc(app):
"""
Monkeypatch application
"""
from dummy_django_app.models import MonkeyPatched
MonkeyPatched.__doc__ = "Monkeypatched docstring"
def setup(app):
# Run method after Django config is initialized
app.connect("django-configured", patch_django_for_autodoc)
|