]> 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:

The site is cleaner without the 'Related' cruft.
[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 import ast
16 from pathlib import Path
17 import re
18
19 from recommonmark.parser import CommonMarkParser
20
21
22 CURRENT_DIR = Path(__file__).parent
23
24
25 def get_version():
26     black_py = CURRENT_DIR / '..' / 'black.py'
27     _version_re = re.compile(r'__version__\s+=\s+(?P<version>.*)')
28     with open(str(black_py), 'r', encoding='utf8') as f:
29         version = _version_re.search(f.read()).group('version')
30     return str(ast.literal_eval(version))
31
32
33 # -- Project information -----------------------------------------------------
34
35 project = 'Black'
36 copyright = '2018, Łukasz Langa and contributors to Black'
37 author = 'Łukasz Langa and contributors to Black'
38
39 # Autopopulate version
40 # The full version, including alpha/beta/rc tags.
41 release = get_version()
42 # The short X.Y version.
43 version = release
44 for sp in 'abcfr':
45     version = version.split(sp)[0]
46
47 # -- General configuration ---------------------------------------------------
48
49 # If your documentation needs a minimal Sphinx version, state it here.
50 #
51 # needs_sphinx = '1.0'
52
53 # Add any Sphinx extension module names here, as strings. They can be
54 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
55 # ones.
56 extensions = [
57     'sphinx.ext.autodoc',
58     'sphinx.ext.intersphinx',
59 ]
60
61 # Add any paths that contain templates here, relative to this directory.
62 templates_path = ['_templates']
63
64 source_parsers = {
65     '.md': CommonMarkParser,
66 }
67
68 # The suffix(es) of source filenames.
69 # You can specify multiple suffix as a list of string:
70 source_suffix = ['.rst', '.md']
71
72 # The master toctree document.
73 master_doc = 'index'
74
75 # The language for content autogenerated by Sphinx. Refer to documentation
76 # for a list of supported languages.
77 #
78 # This is also used if you do content translation via gettext catalogs.
79 # Usually you set "language" from the command line for these cases.
80 language = None
81
82 # List of patterns, relative to source directory, that match files and
83 # directories to ignore when looking for source files.
84 # This pattern also affects html_static_path and html_extra_path .
85 exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
86
87 # The name of the Pygments (syntax highlighting) style to use.
88 pygments_style = 'sphinx'
89
90
91 # -- Options for HTML output -------------------------------------------------
92
93 # The theme to use for HTML and HTML Help pages.  See the documentation for
94 # a list of builtin themes.
95 #
96 html_theme = 'alabaster'
97
98 html_sidebars = {
99     '**': [
100         'about.html',
101         'navigation.html',
102         'relations.html',
103         'sourcelink.html',
104         'searchbox.html'
105     ]
106 }
107
108 html_theme_options = {
109     'show_related': False,
110     'description': '“Any color you like.”',
111     'github_button': True,
112     'github_user': 'ambv',
113     'github_repo': 'black',
114     'github_type': 'star',
115     'show_powered_by': True,
116     'fixed_sidebar': True,
117     'logo': 'logo2.png',
118 }
119
120
121 # Add any paths that contain custom static files (such as style sheets) here,
122 # relative to this directory. They are copied after the builtin static files,
123 # so a file named "default.css" will overwrite the builtin "default.css".
124 html_static_path = ['_static']
125
126 # Custom sidebar templates, must be a dictionary that maps document names
127 # to template names.
128 #
129 # The default sidebars (for documents that don't match any pattern) are
130 # defined by theme itself.  Builtin themes are using these templates by
131 # default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
132 # 'searchbox.html']``.
133 #
134 # html_sidebars = {}
135
136
137 # -- Options for HTMLHelp output ---------------------------------------------
138
139 # Output file base name for HTML help builder.
140 htmlhelp_basename = 'blackdoc'
141
142
143 # -- Options for LaTeX output ------------------------------------------------
144
145 latex_elements = {
146     # The paper size ('letterpaper' or 'a4paper').
147     #
148     # 'papersize': 'letterpaper',
149
150     # The font size ('10pt', '11pt' or '12pt').
151     #
152     # 'pointsize': '10pt',
153
154     # Additional stuff for the LaTeX preamble.
155     #
156     # 'preamble': '',
157
158     # Latex figure (float) alignment
159     #
160     # 'figure_align': 'htbp',
161 }
162
163 # Grouping the document tree into LaTeX files. List of tuples
164 # (source start file, target name, title,
165 #  author, documentclass [howto, manual, or own class]).
166 latex_documents = [
167     (master_doc, 'black.tex', 'Documentation for Black',
168      'Łukasz Langa and contributors to Black', 'manual'),
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 = [
177     (master_doc, 'black', 'Documentation for Black',
178      [author], 1)
179 ]
180
181
182 # -- Options for Texinfo output ----------------------------------------------
183
184 # Grouping the document tree into Texinfo files. List of tuples
185 # (source start file, target name, title, author,
186 #  dir menu entry, description, category)
187 texinfo_documents = [
188     (master_doc, 'Black', 'Documentation for Black',
189      author, 'Black', 'The uncompromising Python code formatter',
190      'Miscellaneous'),
191 ]
192
193
194 # -- Options for Epub output -------------------------------------------------
195
196 # Bibliographic Dublin Core info.
197 epub_title = project
198 epub_author = author
199 epub_publisher = author
200 epub_copyright = copyright
201
202 # The unique identifier of the text. This can be a ISBN number
203 # or the project homepage.
204 #
205 # epub_identifier = ''
206
207 # A unique identification for the text.
208 #
209 # epub_uid = ''
210
211 # A list of files that should not be packed into the epub file.
212 epub_exclude_files = ['search.html']
213
214
215 # -- Extension configuration -------------------------------------------------
216
217 # -- Options for intersphinx extension ---------------------------------------
218
219 # Example configuration for intersphinx: refer to the Python standard library.
220 intersphinx_mapping = {'https://docs.python.org/3/': None}