Black-ify the sphinx configuration code

pull/640/head
Tim Head 2019-04-08 07:52:25 +02:00
rodzic da9f8de0e3
commit cbb375e156
1 zmienionych plików z 48 dodań i 40 usunięć

Wyświetl plik

@ -31,28 +31,26 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.extlinks',
'sphinxcontrib.autoprogram',
'recommonmark',
]
extensions = ["sphinx.ext.extlinks", "sphinxcontrib.autoprogram", "recommonmark"]
extlinks = {
'issue': ('https://github.com/jupyter/repo2docker/issues/%s', 'Issue #'),
'pr': ('https://github.com/jupyter/repo2docker/pull/%s', 'PR #'),
'user': ('https://github.com/%s', '@'),
"issue": ("https://github.com/jupyter/repo2docker/issues/%s", "Issue #"),
"pr": ("https://github.com/jupyter/repo2docker/pull/%s", "PR #"),
"user": ("https://github.com/%s", "@"),
}
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]
from recommonmark.transform import AutoStructify
def setup(app):
app.add_stylesheet('custom.css') # may also be a URL
app.add_config_value('recommonmark_config', {
'auto_toc_tree_section': 'Contents',
}, True)
app.add_stylesheet("custom.css") # may also be a URL
app.add_config_value(
"recommonmark_config", {"auto_toc_tree_section": "Contents"}, True
)
app.add_transform(AutoStructify)
@ -60,15 +58,15 @@ def setup(app):
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = ['.rst', '.md']
source_suffix = [".rst", ".md"]
# The master toctree document.
master_doc = 'index'
master_doc = "index"
# General information about the project.
project = 'repo2docker'
copyright = '2019, Project Jupyter'
author = 'Project Jupyter'
project = "repo2docker"
copyright = "2019, Project Jupyter"
author = "Project Jupyter"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@ -76,18 +74,21 @@ author = 'Project Jupyter'
#
# The short X.Y version.
import repo2docker
version = repo2docker.__version__
# The full version, including alpha/beta/rc tags.
release = version
from repo2docker.buildpacks.conda import CondaBuildPack
default_python = CondaBuildPack.major_pythons['3']
default_python = CondaBuildPack.major_pythons["3"]
rst_prolog = """
.. |default_python| replace:: **Python {default_python}**
.. |default_python_version| replace:: {default_python}
""".format(default_python=default_python)
""".format(
default_python=default_python
)
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@ -102,14 +103,14 @@ language = None
exclude_patterns = []
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# repo2docker Logo
html_logo = '_static/images/repo2docker.svg'
html_favicon = '_static/images/favicon.ico'
html_logo = "_static/images/repo2docker.svg"
html_favicon = "_static/images/favicon.ico"
# -- Options for HTML output ----------------------------------------------
@ -117,7 +118,8 @@ html_favicon = '_static/images/favicon.ico'
# a list of builtin themes.
#
import alabaster_jupyterhub
html_theme = 'alabaster_jupyterhub'
html_theme = "alabaster_jupyterhub"
html_theme_path = [alabaster_jupyterhub.get_html_theme_path()]
# Theme options are theme-specific and customize the look and feel of a theme
@ -129,13 +131,15 @@ html_theme_path = [alabaster_jupyterhub.get_html_theme_path()]
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_sidebars = { '**': ['globaltoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html'] }
html_static_path = ["_static"]
html_sidebars = {
"**": ["globaltoc.html", "relations.html", "sourcelink.html", "searchbox.html"]
}
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'repo2dockerdoc'
htmlhelp_basename = "repo2dockerdoc"
# -- Options for LaTeX output ---------------------------------------------
@ -144,15 +148,12 @@ latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
@ -162,8 +163,13 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'repo2docker.tex', 'repo2docker Documentation',
'Project Jupyter', 'manual'),
(
master_doc,
"repo2docker.tex",
"repo2docker Documentation",
"Project Jupyter",
"manual",
)
]
@ -171,10 +177,7 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'repo2docker', 'repo2docker Documentation',
[author], 1)
]
man_pages = [(master_doc, "repo2docker", "repo2docker Documentation", [author], 1)]
# -- Options for Texinfo output -------------------------------------------
@ -183,13 +186,18 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'repo2docker', 'repo2docker Documentation',
author, 'repo2docker', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"repo2docker",
"repo2docker Documentation",
author,
"repo2docker",
"One line description of project.",
"Miscellaneous",
)
]
# -- Options for Epub output ----------------------------------------------
# Bibliographic Dublin Core info.
@ -208,4 +216,4 @@ epub_copyright = copyright
# epub_uid = ''
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
epub_exclude_files = ["search.html"]