]> git.madduck.net Git - etc/vim.git/blob - docs/conf.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

d56737384525537a4c0edda56f8ef57bb30fb203
[etc/vim.git] / docs / conf.py
1 # -*- coding: utf-8 -*-
2 #
3 # Configuration file for the Sphinx documentation builder.
4 #
5 # This file does only contain a selection of the most common options. For a
6 # full list see the documentation:
7 # http://www.sphinx-doc.org/en/stable/config
8
9 # -- Path setup --------------------------------------------------------------
10
11 # If extensions (or modules to document with autodoc) are in another directory,
12 # add these directories to sys.path here. If the directory is relative to the
13 # documentation root, use os.path.abspath to make it absolute, like shown here.
14 #
15 from pathlib import Path
16 import string
17
18 from pkg_resources import get_distribution
19
20 CURRENT_DIR = Path(__file__).parent
21
22
23 def make_pypi_svg(version: str) -> None:
24     template: Path = CURRENT_DIR / "_static" / "pypi_template.svg"
25     target: Path = CURRENT_DIR / "_static" / "pypi.svg"
26     with open(str(template), "r", encoding="utf8") as f:
27         svg: str = string.Template(f.read()).substitute(version=version)
28     with open(str(target), "w", encoding="utf8") as f:
29         f.write(svg)
30
31
32 # -- Project information -----------------------------------------------------
33
34 project = "Black"
35 copyright = "2018-Present, Łukasz Langa and contributors to Black"
36 author = "Łukasz Langa and contributors to Black"
37
38 # Autopopulate version
39 # The version, including alpha/beta/rc tags, but not commit hash and datestamps
40 release = get_distribution("black").version.split("+")[0]
41 # The short X.Y version.
42 version = release
43 for sp in "abcfr":
44     version = version.split(sp)[0]
45
46 make_pypi_svg(release)
47
48
49 # -- General configuration ---------------------------------------------------
50
51 # If your documentation needs a minimal Sphinx version, state it here.
52 needs_sphinx = "3.0"
53
54 # Add any Sphinx extension module names here, as strings. They can be
55 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
56 # ones.
57 extensions = [
58     "sphinx.ext.autodoc",
59     "sphinx.ext.intersphinx",
60     "sphinx.ext.napoleon",
61     "myst_parser",
62 ]
63
64 # If you need extensions of a certain version or higher, list them here.
65 needs_extensions = {"myst_parser": "0.13.7"}
66
67 # Add any paths that contain templates here, relative to this directory.
68 templates_path = ["_templates"]
69
70 # The suffix(es) of source filenames.
71 # You can specify multiple suffix as a list of string:
72 source_suffix = [".rst", ".md"]
73
74 # The master toctree document.
75 master_doc = "index"
76
77 # The language for content autogenerated by Sphinx. Refer to documentation
78 # for a list of supported languages.
79 #
80 # This is also used if you do content translation via gettext catalogs.
81 # Usually you set "language" from the command line for these cases.
82 language = None
83
84 # List of patterns, relative to source directory, that match files and
85 # directories to ignore when looking for source files.
86 # This pattern also affects html_static_path and html_extra_path .
87
88 exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
89
90 # The name of the Pygments (syntax highlighting) style to use.
91 pygments_style = "sphinx"
92
93 # We need headers to be linkable to so ask MyST-Parser to autogenerate anchor IDs for
94 # headers up to and including level 3.
95 myst_heading_anchors = 3
96
97 # Prettier support formatting some MyST syntax but not all, so let's disable the
98 # unsupported yet still enabled by default ones.
99 myst_disable_syntax = [
100     "myst_block_break",
101     "myst_line_comment",
102     "math_block",
103 ]
104
105 # -- Options for HTML output -------------------------------------------------
106
107 # The theme to use for HTML and HTML Help pages.  See the documentation for
108 # a list of builtin themes.
109 #
110 html_theme = "alabaster"
111
112 html_sidebars = {
113     "**": [
114         "about.html",
115         "navigation.html",
116         "relations.html",
117         "searchbox.html",
118     ]
119 }
120
121 html_theme_options = {
122     "show_related": False,
123     "description": "“Any color you like.”",
124     "github_button": True,
125     "github_user": "psf",
126     "github_repo": "black",
127     "github_type": "star",
128     "show_powered_by": True,
129     "fixed_sidebar": True,
130     "logo": "logo2.png",
131 }
132
133
134 # Add any paths that contain custom static files (such as style sheets) here,
135 # relative to this directory. They are copied after the builtin static files,
136 # so a file named "default.css" will overwrite the builtin "default.css".
137 html_static_path = ["_static"]
138
139 # Custom sidebar templates, must be a dictionary that maps document names
140 # to template names.
141 #
142 # The default sidebars (for documents that don't match any pattern) are
143 # defined by theme itself.  Builtin themes are using these templates by
144 # default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
145 # 'searchbox.html']``.
146 #
147 # html_sidebars = {}
148
149
150 # -- Options for HTMLHelp output ---------------------------------------------
151
152 # Output file base name for HTML help builder.
153 htmlhelp_basename = "blackdoc"
154
155
156 # -- Options for LaTeX output ------------------------------------------------
157
158 # Grouping the document tree into LaTeX files. List of tuples
159 # (source start file, target name, title,
160 #  author, documentclass [howto, manual, or own class]).
161 latex_documents = [
162     (
163         master_doc,
164         "black.tex",
165         "Documentation for Black",
166         "Łukasz Langa and contributors to Black",
167         "manual",
168     )
169 ]
170
171
172 # -- Options for manual page output ------------------------------------------
173
174 # One entry per manual page. List of tuples
175 # (source start file, name, description, authors, manual section).
176 man_pages = [(master_doc, "black", "Documentation for Black", [author], 1)]
177
178
179 # -- Options for Texinfo output ----------------------------------------------
180
181 # Grouping the document tree into Texinfo files. List of tuples
182 # (source start file, target name, title, author,
183 #  dir menu entry, description, category)
184 texinfo_documents = [
185     (
186         master_doc,
187         "Black",
188         "Documentation for Black",
189         author,
190         "Black",
191         "The uncompromising Python code formatter",
192         "Miscellaneous",
193     )
194 ]
195
196
197 # -- Options for Epub output -------------------------------------------------
198
199 # Bibliographic Dublin Core info.
200 epub_title = project
201 epub_author = author
202 epub_publisher = author
203 epub_copyright = copyright
204
205 # The unique identifier of the text. This can be a ISBN number
206 # or the project homepage.
207 #
208 # epub_identifier = ''
209
210 # A unique identification for the text.
211 #
212 # epub_uid = ''
213
214 # A list of files that should not be packed into the epub file.
215 epub_exclude_files = ["search.html"]
216
217
218 # -- Extension configuration -------------------------------------------------
219
220 autodoc_member_order = "bysource"
221
222 # -- Options for intersphinx extension ---------------------------------------
223
224 # Example configuration for intersphinx: refer to the Python standard library.
225 intersphinx_mapping = {"https://docs.python.org/3/": None}