]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/black/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:

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