reformat sphinx config
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parent ba868d6 · Browse files · 1 file·+48 added−47 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+48 added−47 removed
- other:+48 added−47 removed
Provenance
- Commit
0f4c9f1- Tree
ac603f5- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
ba868d6
1 file changed+48 added−47 removed
modified:docs/conf.py+48 added-47 removed
1 from __future__ import print_function2 3-from pallets_sphinx_themes import ProjectLink, get_version3+from pallets_sphinx_themes import get_version4+from pallets_sphinx_themes import ProjectLink5 6 # Project --------------------------------------------------------------7 7-project = 'Flask'8-copyright = '2010 Pallets Team'9-author = 'Pallets Team'10-release, version = get_version('Flask')8+project = "Flask"9+copyright = "2010 Pallets Team"10+author = "Pallets Team"11+release, version = get_version("Flask")12 13 # General --------------------------------------------------------------14 14-master_doc = 'index'15+master_doc = "index"16 extensions = [16- 'sphinx.ext.autodoc',17- 'sphinx.ext.intersphinx',18- 'sphinxcontrib.log_cabinet',19- 'pallets_sphinx_themes',17+ "sphinx.ext.autodoc",18+ "sphinx.ext.intersphinx",19+ "sphinxcontrib.log_cabinet",20+ "pallets_sphinx_themes",21 ]22 intersphinx_mapping = {22- 'python': ('https://docs.python.org/3/', None),23- 'werkzeug': ('http://werkzeug.pocoo.org/docs/', None),24- 'click': ('http://click.pocoo.org/', None),25- 'jinja': ('http://jinja.pocoo.org/docs/', None),26- 'itsdangerous': ('https://pythonhosted.org/itsdangerous', None),27- 'sqlalchemy': ('https://docs.sqlalchemy.org/en/latest/', None),28- 'wtforms': ('https://wtforms.readthedocs.io/en/latest/', None),29- 'blinker': ('https://pythonhosted.org/blinker/', None),23+ "python": ("https://docs.python.org/3/", None),24+ "werkzeug": ("http://werkzeug.pocoo.org/docs/", None),25+ "click": ("http://click.pocoo.org/", None),26+ "jinja": ("http://jinja.pocoo.org/docs/", None),27+ "itsdangerous": ("https://pythonhosted.org/itsdangerous", None),28+ "sqlalchemy": ("https://docs.sqlalchemy.org/en/latest/", None),29+ "wtforms": ("https://wtforms.readthedocs.io/en/latest/", None),30+ "blinker": ("https://pythonhosted.org/blinker/", None),31 }32 33 # HTML -----------------------------------------------------------------34 34-html_theme = 'flask'35+html_theme = "flask"36 html_theme_options = {"index_sidebar_logo": False}37 html_context = {37- 'project_links': [38- ProjectLink('Donate to Pallets', 'https://palletsprojects.com/donate'),39- ProjectLink('Flask Website', 'https://palletsprojects.com/p/flask/'),40- ProjectLink('PyPI releases', 'https://pypi.org/project/Flask/'),41- ProjectLink('Source Code', 'https://github.com/pallets/flask/'),42- ProjectLink('Issue Tracker', 'https://github.com/pallets/flask/issues/'),43- ],38+ "project_links": [39+ ProjectLink("Donate to Pallets", "https://palletsprojects.com/donate"),40+ ProjectLink("Flask Website", "https://palletsprojects.com/p/flask/"),41+ ProjectLink("PyPI releases", "https://pypi.org/project/Flask/"),42+ ProjectLink("Source Code", "https://github.com/pallets/flask/"),43+ ProjectLink("Issue Tracker", "https://github.com/pallets/flask/issues/"),44+ ]45 }46 html_sidebars = {46- 'index': ['project.html', "localtoc.html", 'versions.html', 'searchbox.html'],47- '**': ['localtoc.html', 'relations.html', 'versions.html', 'searchbox.html']47+ "index": ["project.html", "localtoc.html", "versions.html", "searchbox.html"],48+ "**": ["localtoc.html", "relations.html", "versions.html", "searchbox.html"],49 }50 singlehtml_sidebars = {"index": ["project.html", "versions.html", "localtoc.html"]}50-html_static_path = ['_static']51-html_favicon = '_static/flask-icon.png'52-html_logo = '_static/flask-logo-sidebar.png'51+html_static_path = ["_static"]52+html_favicon = "_static/flask-icon.png"53+html_logo = "_static/flask-logo-sidebar.png"54 html_title = "Flask Documentation ({})".format(version)55 html_show_sourcelink = False56 html_domain_indices = False57 58 # LaTeX ----------------------------------------------------------------59 60 latex_documents = [60- (master_doc, 'Flask-{}.tex'.format(version), html_title, author, 'manual'),61+ (master_doc, "Flask-{}.tex".format(version), html_title, author, "manual")62 ]63 latex_use_modindex = False64 latex_elements = {64- 'papersize': 'a4paper',65- 'pointsize': '12pt',66- 'fontpkg': r'\usepackage{mathpazo}',67- 'preamble': r'\usepackage{flaskstyle}',65+ "papersize": "a4paper",66+ "pointsize": "12pt",67+ "fontpkg": r"\usepackage{mathpazo}",68+ "preamble": r"\usepackage{flaskstyle}",69 }70 latex_use_parts = True70-latex_additional_files = ['flaskstyle.sty', 'logo.pdf']71+latex_additional_files = ["flaskstyle.sty", "logo.pdf"]72 73 # Local Extensions -----------------------------------------------------74 74-def github_link(75- name, rawtext, text, lineno, inliner, options=None, content=None76-):75+76+def github_link(name, rawtext, text, lineno, inliner, options=None, content=None):77 app = inliner.document.settings.env.app78 release = app.config.release79- base_url = 'https://github.com/pallets/flask/tree/'79+ base_url = "https://github.com/pallets/flask/tree/"80 81- if text.endswith('>'):82- words, text = text[:-1].rsplit('<', 1)81+ if text.endswith(">"):82+ words, text = text[:-1].rsplit("<", 1)83 words = words.strip()84 else:85 words = None86 87- if release.endswith('dev'):88- url = '{0}master/{1}'.format(base_url, text)87+ if release.endswith("dev"):88+ url = "{0}master/{1}".format(base_url, text)89 else:90- url = '{0}{1}/{2}'.format(base_url, release, text)90+ url = "{0}{1}/{2}".format(base_url, release, text)91 92 if words is None:93 words = url94 95 from docutils.nodes import reference96 from docutils.parsers.rst.roles import set_classes97+98 options = options or {}99 set_classes(options)100 node = reference(rawtext, words, refuri=url, **options)101 return [node], []102 103 104 def setup(app):104- app.add_role('gh', github_link)105+ app.add_role("gh", github_link)