From da9f8de0e34c5798289bd519a9a1b88103f8bbcb Mon Sep 17 00:00:00 2001 From: Tim Head Date: Mon, 8 Apr 2019 07:51:30 +0200 Subject: [PATCH 1/2] Update recommonmark ocnfiguration In new versions of SPhinx the way we were configuring the recommonmark extension has become deprecated. This switches us to the new way of configuring it. --- docs/source/conf.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index db48d094..534ee7b6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -21,8 +21,6 @@ # import sys # sys.path.insert(0, os.path.abspath('.')) -# For conversion from markdown to html -import recommonmark.parser # -- General configuration ------------------------------------------------ @@ -35,6 +33,7 @@ import recommonmark.parser # ones. extensions = ['sphinx.ext.extlinks', 'sphinxcontrib.autoprogram', + 'recommonmark', ] extlinks = { @@ -46,10 +45,6 @@ extlinks = { # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] -# source parser -source_parsers = { - '.md': 'recommonmark.parser.CommonMarkParser', -} from recommonmark.transform import AutoStructify From cbb375e1568d39d9562609a93e7a32c86b7ed322 Mon Sep 17 00:00:00 2001 From: Tim Head Date: Mon, 8 Apr 2019 07:52:25 +0200 Subject: [PATCH 2/2] Black-ify the sphinx configuration code --- docs/source/conf.py | 88 ++++++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 40 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 534ee7b6..2c2ea871 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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"]