Merge pull request #2912 from pallets/docs-theme
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Update Sphinx conf for recent theme changes
authored by David Lord · committed by GitHub · parents d493e3e, 0f4c9f1 · Browse files · 9 files·+56 added−119 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
9 files+56 added−119 removed
- other:+56 added−119 removed
Provenance
- Commit
19a0a7d- Tree
ac603f5- Author
David Lord <davidism@gmail.com>- Committer
GitHub <noreply@github.com>- Parent 1
d493e3e- Parent 2
0f4c9f1
9 files changed+56 added−119 removed
deleted:docs/_static/flask-favicon.icobinary
A binary file, deleted.
added:docs/_static/flask-icon.pngbinary
A binary file, added.
added:docs/_static/flask-logo-sidebar.pngbinary
A binary file, added.
added:docs/_static/flask-logo.pngbinary
A binary file, added.
deleted:docs/_static/flask.pngbinary
A binary file, deleted.
deleted:docs/_static/logo-full.pngbinary
A binary file, deleted.
deleted:docs/_static/touch-icon.pngbinary
A binary file, deleted.
modified:docs/conf.py+51 added-117 removed
1-# -*- coding: utf-8 -*-1 from __future__ import print_function2 4-import inspect5-import re3+from pallets_sphinx_themes import get_version4+from pallets_sphinx_themes import ProjectLink5 7-from pallets_sphinx_themes import ProjectLink, get_version8-6 # Project --------------------------------------------------------------7 11-project = 'Flask'12-copyright = '2010 Pallets Team'13-author = 'Pallets Team'14-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 18-master_doc = 'index'19-15+master_doc = "index"16 extensions = [21- 'sphinx.ext.autodoc',22- 'sphinx.ext.intersphinx',23- 'sphinxcontrib.log_cabinet',24- 'pallets_sphinx_themes',17+ "sphinx.ext.autodoc",18+ "sphinx.ext.intersphinx",19+ "sphinxcontrib.log_cabinet",20+ "pallets_sphinx_themes",21 ]26-22 intersphinx_mapping = {28- 'python': ('https://docs.python.org/3/', None),29- 'werkzeug': ('http://werkzeug.pocoo.org/docs/', None),30- 'click': ('http://click.pocoo.org/', None),31- 'jinja': ('http://jinja.pocoo.org/docs/', None),32- 'itsdangerous': ('https://pythonhosted.org/itsdangerous', None),33- 'sqlalchemy': ('https://docs.sqlalchemy.org/en/latest/', None),34- 'wtforms': ('https://wtforms.readthedocs.io/en/latest/', None),35- '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 40-html_theme = 'flask'35+html_theme = "flask"36+html_theme_options = {"index_sidebar_logo": False}37 html_context = {42- 'project_links': [43- ProjectLink('Donate to Pallets', 'https://psfmember.org/civicrm/contribute/transact?reset=1&id=20'),44- ProjectLink('Flask Website', 'https://palletsprojects.com/p/flask/'),45- ProjectLink('PyPI releases', 'https://pypi.org/project/Flask/'),46- ProjectLink('Source Code', 'https://github.com/pallets/flask/'),47- ProjectLink(48- 'Issue Tracker', 'https://github.com/pallets/flask/issues/'),49- ],50- 'canonical_url': 'http://flask.pocoo.org/docs/{}/'.format(version),51- 'carbon_ads_args': 'zoneid=1673&serve=C6AILKT&placement=pocooorg',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 = {54- 'index': [55- 'project.html',56- 'versions.html',57- 'carbon_ads.html',58- 'searchbox.html',59- ],60- '**': [61- 'localtoc.html',62- 'relations.html',63- 'versions.html',64- 'carbon_ads.html',65- 'searchbox.html',66- ]47+ "index": ["project.html", "localtoc.html", "versions.html", "searchbox.html"],48+ "**": ["localtoc.html", "relations.html", "versions.html", "searchbox.html"],49 }68-html_static_path = ['_static']69-html_favicon = '_static/flask-favicon.ico'70-html_logo = '_static/flask.png'71-html_additional_pages = {72- '404': '404.html',73-}50+singlehtml_sidebars = {"index": ["project.html", "versions.html", "localtoc.html"]}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 = [79- (master_doc, 'Flask.tex', 'Flask Documentation', 'Pallets Team', 'manual'),61+ (master_doc, "Flask-{}.tex".format(version), html_title, author, "manual")62 ]63 latex_use_modindex = False64 latex_elements = {83- 'papersize': 'a4paper',84- 'pointsize': '12pt',85- 'fontpkg': r'\usepackage{mathpazo}',86- '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 = True89-latex_additional_files = ['flaskstyle.sty', 'logo.pdf']71+latex_additional_files = ["flaskstyle.sty", "logo.pdf"]72 91-# linkcheck ------------------------------------------------------------92-93-linkcheck_anchors = False94-73 # Local Extensions -----------------------------------------------------74 97-def unwrap_decorators():98- import sphinx.util.inspect as inspect99- import functools75 101- old_getargspec = inspect.getargspec102- def getargspec(x):103- return old_getargspec(getattr(x, '_original_function', x))104- inspect.getargspec = getargspec105-106- old_update_wrapper = functools.update_wrapper107- def update_wrapper(wrapper, wrapped, *a, **kw):108- rv = old_update_wrapper(wrapper, wrapped, *a, **kw)109- rv._original_function = wrapped110- return rv111- functools.update_wrapper = update_wrapper112-113-114-unwrap_decorators()115-del unwrap_decorators116-117-118-_internal_mark_re = re.compile(r'^\s*:internal:\s*$(?m)', re.M)119-120-121-def skip_internal(app, what, name, obj, skip, options):122- docstring = inspect.getdoc(obj) or ''123-124- if skip or _internal_mark_re.search(docstring) is not None:125- return True126-127-128-def cut_module_meta(app, what, name, obj, options, lines):129- """Remove metadata from autodoc output."""130- if what != 'module':131- return132-133- lines[:] = [134- line for line in lines135- if not line.startswith((':copyright:', ':license:'))136- ]137-138-139-def github_link(140- name, rawtext, text, lineno, inliner, options=None, content=None141-):76+def github_link(name, rawtext, text, lineno, inliner, options=None, content=None):77 app = inliner.document.settings.env.app78 release = app.config.release144- base_url = 'https://github.com/pallets/flask/tree/'79+ base_url = "https://github.com/pallets/flask/tree/"80 146- if text.endswith('>'):147- 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 152- if release.endswith('dev'):153- url = '{0}master/{1}'.format(base_url, text)87+ if release.endswith("dev"):88+ url = "{0}master/{1}".format(base_url, text)89 else:155- 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):169- app.connect('autodoc-skip-member', skip_internal)170- app.connect('autodoc-process-docstring', cut_module_meta)171- app.add_role('gh', github_link)105+ app.add_role("gh", github_link)modified:docs/index.rst+5 added-2 removed
1 :orphan:2 3+.. rst-class:: hide-header4+5 Welcome to Flask6 ================7 6-.. image:: _static/logo-full.png8+.. image:: _static/flask-logo.png9 :alt: Flask: web development, one drop at a time8- :align: right10+ :align: center11+ :target: https://palletsprojects.com/p/flask/12 13 Welcome to Flask's documentation. Get started with :ref:`installation`14 and then get an overview with the :ref:`quickstart`. There is also a15 more detailed :ref:`tutorial` that shows how to create a small but14 unmodified lines