django-categories/doc_src/conf.py

86 lines
2 KiB
Python
Raw Normal View History

2021-12-12 14:05:58 +00:00
"""
Sphinx configuration.
"""
2009-10-06 12:10:13 +00:00
import os
import sys
2021-12-12 14:05:58 +00:00
from datetime import date
from pathlib import Path
2009-10-06 12:10:13 +00:00
2021-12-12 14:05:58 +00:00
project_root = Path("..").resolve()
sys.path.insert(0, str(project_root / "example"))
sys.path.insert(0, str(project_root))
os.environ["DJANGO_SETTINGS_MODULE"] = "example.settings"
2021-12-12 14:05:58 +00:00
# Setup Django
import django # NOQA
2009-10-06 12:10:13 +00:00
2021-12-12 14:05:58 +00:00
django.setup()
2009-10-06 12:10:13 +00:00
2021-12-12 14:05:58 +00:00
import categories # noqa
import categories.urls # noqa
2009-10-06 12:10:13 +00:00
project = "Django Categories"
2021-12-12 14:05:58 +00:00
copyright = f"2010-{date.today():%Y}, Corey Oordt"
2009-10-06 12:10:13 +00:00
2021-12-12 14:05:58 +00:00
version = categories.__version__
release = categories.__version__
2009-10-06 12:10:13 +00:00
2021-12-12 14:05:58 +00:00
# -- General configuration -----------------------------------------------------
2009-10-06 12:10:13 +00:00
2021-12-12 14:05:58 +00:00
extensions = [
"myst_parser",
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx.ext.autosectionlabel",
"sphinx.ext.napoleon",
"sphinx_autodoc_typehints",
"sphinx.ext.coverage",
"sphinx.ext.githubpages",
"sphinxcontrib_django2",
]
autosectionlabel_prefix_document = True
autosectionlabel_maxdepth = 2
autosummary_generate = True
napoleon_attr_annotations = True
napoleon_include_special_with_doc = False
napoleon_include_private_with_doc = True
napoleon_include_init_with_doc = True
myst_enable_extensions = [
"amsmath",
"colon_fence",
"deflist",
"dollarmath",
"linkify",
"replacements",
"smartquotes",
"substitution",
"tasklist",
]
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"django": (
"https://docs.djangoproject.com/en/stable",
"https://docs.djangoproject.com/en/stable/_objects",
),
}
templates_path = ["_templates"]
source_suffix = [".rst", ".md"]
master_doc = "index"
2009-10-06 12:10:13 +00:00
2021-12-12 14:05:58 +00:00
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
pygments_style = "sphinx"
2021-12-12 14:05:58 +00:00
todo_include_todos = False
2009-10-06 12:10:13 +00:00
# -- Options for HTML output ---------------------------------------------------
2021-12-12 14:05:58 +00:00
html_theme = "pydata_sphinx_theme"
html_static_path = ["_static"]
2021-12-12 14:05:58 +00:00
html_css_files = [
"css/custom.css",
2009-10-06 12:10:13 +00:00
]