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.
1 # -*- coding: utf-8 -*-
3 # Configuration file for the Sphinx documentation builder.
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
9 # -- Path setup --------------------------------------------------------------
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.
16 from pathlib import Path
20 from recommonmark.parser import CommonMarkParser
23 CURRENT_DIR = Path(__file__).parent
27 black_py = CURRENT_DIR / '..' / 'black.py'
28 _version_re = re.compile(r'__version__\s+=\s+(?P<version>.*)')
29 with open(str(black_py), 'r', encoding='utf8') as f:
30 version = _version_re.search(f.read()).group('version')
31 return str(ast.literal_eval(version))
34 def make_pypi_svg(version):
35 template = CURRENT_DIR / '_static' / 'pypi_template.svg'
36 target = CURRENT_DIR / '_static' / 'pypi.svg'
37 with open(str(template), 'r', encoding='utf8') as f:
38 svg = string.Template(f.read()).substitute(version=version)
39 with open(str(target), 'w', encoding='utf8') as f:
43 # -- Project information -----------------------------------------------------
46 copyright = '2018, Łukasz Langa and contributors to Black'
47 author = 'Łukasz Langa and contributors to Black'
49 # Autopopulate version
50 # The full version, including alpha/beta/rc tags.
51 release = get_version()
52 # The short X.Y version.
55 version = version.split(sp)[0]
56 make_pypi_svg(release)
59 # -- General configuration ---------------------------------------------------
61 # If your documentation needs a minimal Sphinx version, state it here.
63 # needs_sphinx = '1.0'
65 # Add any Sphinx extension module names here, as strings. They can be
66 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
70 'sphinx.ext.intersphinx',
73 # Add any paths that contain templates here, relative to this directory.
74 templates_path = ['_templates']
77 '.md': CommonMarkParser,
80 # The suffix(es) of source filenames.
81 # You can specify multiple suffix as a list of string:
82 source_suffix = ['.rst', '.md']
84 # The master toctree document.
87 # The language for content autogenerated by Sphinx. Refer to documentation
88 # for a list of supported languages.
90 # This is also used if you do content translation via gettext catalogs.
91 # Usually you set "language" from the command line for these cases.
94 # List of patterns, relative to source directory, that match files and
95 # directories to ignore when looking for source files.
96 # This pattern also affects html_static_path and html_extra_path .
97 exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
99 # The name of the Pygments (syntax highlighting) style to use.
100 pygments_style = 'sphinx'
103 # -- Options for HTML output -------------------------------------------------
105 # The theme to use for HTML and HTML Help pages. See the documentation for
106 # a list of builtin themes.
108 html_theme = 'alabaster'
120 html_theme_options = {
121 'show_related': False,
122 'description': '“Any color you like.”',
123 'github_button': True,
124 'github_user': 'ambv',
125 'github_repo': 'black',
126 'github_type': 'star',
127 'show_powered_by': True,
128 'fixed_sidebar': True,
133 # Add any paths that contain custom static files (such as style sheets) here,
134 # relative to this directory. They are copied after the builtin static files,
135 # so a file named "default.css" will overwrite the builtin "default.css".
136 html_static_path = ['_static']
138 # Custom sidebar templates, must be a dictionary that maps document names
141 # The default sidebars (for documents that don't match any pattern) are
142 # defined by theme itself. Builtin themes are using these templates by
143 # default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
144 # 'searchbox.html']``.
149 # -- Options for HTMLHelp output ---------------------------------------------
151 # Output file base name for HTML help builder.
152 htmlhelp_basename = 'blackdoc'
155 # -- Options for LaTeX output ------------------------------------------------
158 # The paper size ('letterpaper' or 'a4paper').
160 # 'papersize': 'letterpaper',
162 # The font size ('10pt', '11pt' or '12pt').
164 # 'pointsize': '10pt',
166 # Additional stuff for the LaTeX preamble.
170 # Latex figure (float) alignment
172 # 'figure_align': 'htbp',
175 # Grouping the document tree into LaTeX files. List of tuples
176 # (source start file, target name, title,
177 # author, documentclass [howto, manual, or own class]).
179 (master_doc, 'black.tex', 'Documentation for Black',
180 'Łukasz Langa and contributors to Black', 'manual'),
184 # -- Options for manual page output ------------------------------------------
186 # One entry per manual page. List of tuples
187 # (source start file, name, description, authors, manual section).
189 (master_doc, 'black', 'Documentation for Black',
194 # -- Options for Texinfo output ----------------------------------------------
196 # Grouping the document tree into Texinfo files. List of tuples
197 # (source start file, target name, title, author,
198 # dir menu entry, description, category)
199 texinfo_documents = [
200 (master_doc, 'Black', 'Documentation for Black',
201 author, 'Black', 'The uncompromising Python code formatter',
206 # -- Options for Epub output -------------------------------------------------
208 # Bibliographic Dublin Core info.
211 epub_publisher = author
212 epub_copyright = copyright
214 # The unique identifier of the text. This can be a ISBN number
215 # or the project homepage.
217 # epub_identifier = ''
219 # A unique identification for the text.
223 # A list of files that should not be packed into the epub file.
224 epub_exclude_files = ['search.html']
227 # -- Extension configuration -------------------------------------------------
229 # -- Options for intersphinx extension ---------------------------------------
231 # Example configuration for intersphinx: refer to the Python standard library.
232 intersphinx_mapping = {'https://docs.python.org/3/': None}