Skip to content
Myr

Merge pull request #3064 from pallets/docs-fix

Before adoption: this commit came in with the history the project adopted, so no landing records it.

fix docs build

authored by David Lord · committed by GitHub · parents 877da63, 8b567fe · Browse files · 4 files+56 added−132 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+56 added−132 removed

  • other:+56 added−132 removed

4 files+56 added−132 removed

modified:docs/conf.py+49 added-120 removed
1# -*- coding: utf-8 -*-2from __future__ import print_function34import inspect5import re4from pallets_sphinx_themes import ProjectLink, get_version57from pallets_sphinx_themes import DocVersion, ProjectLink, get_version86# Project --------------------------------------------------------------711project = 'Flask'12copyright = '2010 Pallets Team'13author = 'Pallets Team'14release, version = get_version('Flask')8project = "Flask"9copyright = "2010 Pallets Team"10author = "Pallets Team"11release, version = get_version("Flask")1213# General --------------------------------------------------------------1418master_doc = 'index'1915master_doc = "index"16extensions = [21 'sphinx.ext.autodoc',22 'sphinx.ext.intersphinx',23 'sphinxcontrib.log_cabinet',17 "sphinx.ext.autodoc",18 "sphinx.ext.intersphinx",19 "sphinxcontrib.log_cabinet",20 "pallets_sphinx_themes",21]2522intersphinx_mapping = {27 'python': ('https://docs.python.org/3/', None),28 'werkzeug': ('http://werkzeug.pocoo.org/docs/', None),29 'click': ('http://click.pocoo.org/', None),30 'jinja': ('http://jinja.pocoo.org/docs/', None),31 'itsdangerous': ('https://pythonhosted.org/itsdangerous', None),32 'sqlalchemy': ('https://docs.sqlalchemy.org/en/latest/', None),33 'wtforms': ('https://wtforms.readthedocs.io/en/latest/', None),34 'blinker': ('https://pythonhosted.org/blinker/', None),23 "python": ("https://docs.python.org/3/", None),24 "werkzeug": ("http://werkzeug.pocoo.org/docs/", None),25 "click": ("https://click.palletsprojects.com/", None),26 "jinja": ("http://jinja.pocoo.org/docs/", None),27 "itsdangerous": ("https://itsdangerous.palletsprojects.com/", None),28 "sqlalchemy": ("https://docs.sqlalchemy.org/", None),29 "wtforms": ("https://wtforms.readthedocs.io/en/stable/", None),30 "blinker": ("https://pythonhosted.org/blinker/", None),31}3233# HTML -----------------------------------------------------------------3439html_theme = 'flask'35html_theme = "flask"36html_theme_options = {"index_sidebar_logo": False}37html_context = {41 'project_links': [42 ProjectLink('Donate to Pallets', 'https://psfmember.org/civicrm/contribute/transact?reset=1&id=20'),43 ProjectLink('Flask Website', 'https://palletsprojects.com/p/flask/'),44 ProjectLink('PyPI releases', 'https://pypi.org/project/Flask/'),45 ProjectLink('Source Code', 'https://github.com/pallets/flask/'),46 ProjectLink(47 'Issue Tracker', 'https://github.com/pallets/flask/issues/'),48 ],49 'versions': [50 DocVersion('dev', 'Development', 'unstable'),51 DocVersion('1.0', 'Flask 1.0', 'stable'),52 DocVersion('0.12', 'Flask 0.12'),53 ],54 'canonical_url': 'http://flask.pocoo.org/docs/{}/'.format(version),55 '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}46html_sidebars = {58 'index': [59 'project.html',60 'versions.html',61 'carbon_ads.html',62 'searchbox.html',63 ],64 '**': [65 'localtoc.html',66 'relations.html',67 'versions.html',68 'carbon_ads.html',69 'searchbox.html',70 ]47 "index": ["project.html", "localtoc.html", "searchbox.html"],48 "**": ["localtoc.html", "relations.html", "searchbox.html"],49}72html_static_path = ['_static']73html_favicon = '_static/flask-favicon.ico'74html_logo = '_static/flask.png'75html_additional_pages = {76 '404': '404.html',77}50singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}51html_static_path = ["_static"]52html_favicon = "_static/flask-favicon.ico"53html_logo = "_static/flask.png"54html_title = "Flask Documentation ({})".format(version)55html_show_sourcelink = False5657# LaTeX ----------------------------------------------------------------5859latex_documents = [83 (master_doc, 'Flask.tex', 'Flask Documentation', 'Pallets Team', 'manual'),60 (master_doc, "Flask.tex", "Flask Documentation", "Pallets Team", "manual")61]62latex_use_modindex = False63latex_elements = {87 'papersize': 'a4paper',88 'pointsize': '12pt',89 'fontpkg': r'\usepackage{mathpazo}',90 'preamble': r'\usepackage{flaskstyle}',64 "papersize": "a4paper",65 "pointsize": "12pt",66 "fontpkg": r"\usepackage{mathpazo}",67 "preamble": r"\usepackage{flaskstyle}",68}69latex_use_parts = True93latex_additional_files = ['flaskstyle.sty', 'logo.pdf']70latex_additional_files = ["flaskstyle.sty", "logo.pdf"]7195# linkcheck ------------------------------------------------------------9697linkcheck_anchors = False9872# Local Extensions -----------------------------------------------------73101def unwrap_decorators():102 import sphinx.util.inspect as inspect103 import functools74105 old_getargspec = inspect.getargspec106 def getargspec(x):107 return old_getargspec(getattr(x, '_original_function', x))108 inspect.getargspec = getargspec109110 old_update_wrapper = functools.update_wrapper111 def update_wrapper(wrapper, wrapped, *a, **kw):112 rv = old_update_wrapper(wrapper, wrapped, *a, **kw)113 rv._original_function = wrapped114 return rv115 functools.update_wrapper = update_wrapper116117118unwrap_decorators()119del unwrap_decorators120121122_internal_mark_re = re.compile(r'^\s*:internal:\s*$(?m)', re.M)123124125def skip_internal(app, what, name, obj, skip, options):126 docstring = inspect.getdoc(obj) or ''127128 if skip or _internal_mark_re.search(docstring) is not None:129 return True130131132def cut_module_meta(app, what, name, obj, options, lines):133 """Remove metadata from autodoc output."""134 if what != 'module':135 return136137 lines[:] = [138 line for line in lines139 if not line.startswith((':copyright:', ':license:'))140 ]141142143def github_link(144 name, rawtext, text, lineno, inliner, options=None, content=None145):75def github_link(name, rawtext, text, lineno, inliner, options=None, content=None):76 app = inliner.document.settings.env.app77 release = app.config.release148 base_url = 'https://github.com/pallets/flask/tree/'78 base_url = "https://github.com/pallets/flask/tree/"79150 if text.endswith('>'):151 words, text = text[:-1].rsplit('<', 1)80 if text.endswith(">"):81 words, text = text[:-1].rsplit("<", 1)82 words = words.strip()83 else:84 words = None85156 if release.endswith('dev'):157 url = '{0}master/{1}'.format(base_url, text)86 if release.endswith("dev"):87 url = "{0}master/{1}".format(base_url, text)88 else:159 url = '{0}{1}/{2}'.format(base_url, release, text)89 url = "{0}{1}/{2}".format(base_url, release, text)9091 if words is None:92 words = url9394 from docutils.nodes import reference95 from docutils.parsers.rst.roles import set_classes9697 options = options or {}98 set_classes(options)99 node = reference(rawtext, words, refuri=url, **options)100 return [node], []101102103def setup(app):173 app.connect('autodoc-skip-member', skip_internal)174 app.connect('autodoc-process-docstring', cut_module_meta)175 app.add_role('gh', github_link)104 app.add_role("gh", github_link)
modified:docs/index.rst+3 added-2 removed
1:orphan:1.. rst-class:: hide-header23Welcome to Flask4================56.. image:: _static/logo-full.png7 :alt: Flask: web development, one drop at a time8 :align: right8 :align: center9 :target: https://palletsprojects.com/p/flask/1011Welcome to Flask's documentation. Get started with :ref:`installation`12and then get an overview with the :ref:`quickstart`. There is also a13more detailed :ref:`tutorial` that shows how to create a small but
14 unmodified lines
added:docs/requirements.txt+3 added
1Sphinx~=1.8.02Pallets-Sphinx-Themes~=1.1.03sphinxcontrib-log-cabinet~=1.0.0
modified:tox.ini+1 added-10 removed
37 unmodified lines
38 coverage run -p -m pytest tests examples3940[testenv:docs-html]41deps =42 sphinx43 pallets-sphinx-themes44 sphinxcontrib-log-cabinet42 -r docs/requirements.txt43commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html4447[testenv:docs-linkcheck]48deps =49 sphinx50 pallets-sphinx-themes51 sphinxcontrib-log-cabinet52commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs {envtmpdir}/linkcheck5345[testenv:coverage-report]46deps = coverage47skip_install = true48commands =
12 unmodified lines