Debian Codegraph @

docs/conf.py

raw
1 # -*- coding: utf-8 -*-
2 """django-downloadview documentation build configuration file."""
3
4 import re
5
6 import importlib.metadata
7
8 # Minimal Django settings. Required to use sphinx.ext.autodoc, because
9 # django-downloadview depends on Django...
10 from django.conf import settings
11
12 settings.configure(
13 DATABASES={}, # Required to load ``django.views.generic``.
14 )
15
16
17 # -- General configuration ----------------------------------------------------
18
19 # Extensions.
20 extensions = [
21 "sphinx.ext.autodoc",
22 "sphinx.ext.autosummary",
23 "sphinx.ext.doctest",
24 "sphinx.ext.coverage",
25 "sphinx.ext.intersphinx",
26 ]
27
28 # Add any paths that contain templates here, relative to this directory.
29 templates_path = ["_templates"]
30
31 # The suffix of source filenames.
32 source_suffix = ".txt"
33
34 # The encoding of source files.
35 source_encoding = "utf-8"
36
37 # The master toctree document.
38 master_doc = "index"
39
40 # General information about the project.
41 project = "django-downloadview"
42 project_slug = re.sub(r"([\w_.-]+)", "-", project)
43 copyright = "2012-2015, Benoît Bryon"
44 author = "Benoît Bryon"
45 author_slug = re.sub(r"([\w_.-]+)", "-", author)
46
47 # The version info for the project you're documenting, acts as replacement for
48 # |version| and |release|, also used in various other places throughout the
49 # built documents.
50
51 # The full version, including alpha/beta/rc tags.
52 release = importlib.metadata.version("django-downloadview")
53 # The short X.Y version.
54 version = ".".join(release.split(".")[:2])
55
56 # The language for content autogenerated by Sphinx. Refer to documentation
57 # for a list of supported languages.
58 language = "en"
59
60 # List of patterns, relative to source directory, that match files and
61 # directories to ignore when looking for source files.
62 exclude_patterns = ["_build"]
63
64 # The name of the Pygments (syntax highlighting) style to use.
65 pygments_style = "sphinx"
66
67
68 # -- Options for HTML output --------------------------------------------------
69
70 # The theme to use for HTML and HTML Help pages. See the documentation for
71 # a list of builtin themes.
72 html_theme = "alabaster"
73
74 # Add any paths that contain custom static files (such as style sheets) here,
75 # relative to this directory. They are copied after the builtin static files,
76 # so a file named "default.css" will overwrite the builtin "default.css".
77 html_static_path = []
78
79 # Custom sidebar templates, maps document names to template names.
80 html_sidebars = {
81 "**": ["globaltoc.html", "relations.html", "sourcelink.html", "searchbox.html"],
82 }
83
84 # Output file base name for HTML help builder.
85 htmlhelp_basename = "{project}doc".format(project=project_slug)
86
87
88 # -- Options for sphinx.ext.intersphinx ---------------------------------------
89
90 intersphinx_mapping = {
91 "python": ("https://docs.python.org/3", None),
92 "django": (
93 "https://docs.djangoproject.com/en/3.1/",
94 "https://docs.djangoproject.com/en/3.1/_objects/",
95 ),
96 "requests": ("https://requests.readthedocs.io/en/master/", None),
97 }
98
99
100 # -- Options for LaTeX output -------------------------------------------------
101
102 latex_elements = {}
103
104 # Grouping the document tree into LaTeX files. List of tuples
105 # (source start file, target name, title, author, documentclass
106 # [howto/manual]).
107 latex_documents = [
108 (
109 "index",
110 "{project}.tex".format(project=project_slug),
111 "{project} Documentation".format(project=project),
112 author,
113 "manual",
114 ),
115 ]
116
117
118 # -- Options for manual page output -------------------------------------------
119
120 # One entry per manual page. List of tuples
121 # (source start file, name, description, authors, manual section).
122 man_pages = [
123 ("index", project, "{project} Documentation".format(project=project), [author], 1)
124 ]
125
126
127 # -- Options for Texinfo output -----------------------------------------------
128
129 # Grouping the document tree into Texinfo files. List of tuples
130 # (source start file, target name, title, author,
131 # dir menu entry, description, category)
132 texinfo_documents = [
133 (
134 "index",
135 project_slug,
136 "{project} Documentation".format(project=project),
137 author,
138 project,
139 "One line description of project.",
140 "Miscellaneous",
141 ),
142 ]