fix docs build
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 f7e7f2a · 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
Provenance
- Commit
8b567fe- Tree
bbe4c6a- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
f7e7f2a
4 files changed+56 added−132 removed
modified:docs/conf.py+49 added-120 removed
1 # -*- coding: utf-8 -*-2 from __future__ import print_function3 4-import inspect5-import re4+from pallets_sphinx_themes import ProjectLink, get_version5 7-from pallets_sphinx_themes import DocVersion, 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',17+ "sphinx.ext.autodoc",18+ "sphinx.ext.intersphinx",19+ "sphinxcontrib.log_cabinet",20+ "pallets_sphinx_themes",21 ]25-22 intersphinx_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 }32 33 # HTML -----------------------------------------------------------------34 39-html_theme = 'flask'35+html_theme = "flask"36+html_theme_options = {"index_sidebar_logo": False}37 html_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 }46 html_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 }72-html_static_path = ['_static']73-html_favicon = '_static/flask-favicon.ico'74-html_logo = '_static/flask.png'75-html_additional_pages = {76- '404': '404.html',77-}50+singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}51+html_static_path = ["_static"]52+html_favicon = "_static/flask-favicon.ico"53+html_logo = "_static/flask.png"54+html_title = "Flask Documentation ({})".format(version)55 html_show_sourcelink = False56 57 # LaTeX ----------------------------------------------------------------58 59 latex_documents = [83- (master_doc, 'Flask.tex', 'Flask Documentation', 'Pallets Team', 'manual'),60+ (master_doc, "Flask.tex", "Flask Documentation", "Pallets Team", "manual")61 ]62 latex_use_modindex = False63 latex_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 }69 latex_use_parts = True93-latex_additional_files = ['flaskstyle.sty', 'logo.pdf']70+latex_additional_files = ["flaskstyle.sty", "logo.pdf"]71 95-# linkcheck ------------------------------------------------------------96-97-linkcheck_anchors = False98-72 # Local Extensions -----------------------------------------------------73 101-def unwrap_decorators():102- import sphinx.util.inspect as inspect103- import functools74 105- old_getargspec = inspect.getargspec106- def getargspec(x):107- return old_getargspec(getattr(x, '_original_function', x))108- inspect.getargspec = getargspec109-110- 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_wrapper116-117-118-unwrap_decorators()119-del unwrap_decorators120-121-122-_internal_mark_re = re.compile(r'^\s*:internal:\s*$(?m)', re.M)123-124-125-def skip_internal(app, what, name, obj, skip, options):126- docstring = inspect.getdoc(obj) or ''127-128- if skip or _internal_mark_re.search(docstring) is not None:129- return True130-131-132-def cut_module_meta(app, what, name, obj, options, lines):133- """Remove metadata from autodoc output."""134- if what != 'module':135- return136-137- lines[:] = [138- line for line in lines139- if not line.startswith((':copyright:', ':license:'))140- ]141-142-143-def github_link(144- name, rawtext, text, lineno, inliner, options=None, content=None145-):75+def 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/"79 150- 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 = None85 156- 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)90 91 if words is None:92 words = url93 94 from docutils.nodes import reference95 from docutils.parsers.rst.roles import set_classes96+97 options = options or {}98 set_classes(options)99 node = reference(rawtext, words, refuri=url, **options)100 return [node], []101 102 103 def 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-header2 3 Welcome to Flask4 ================5 6 .. image:: _static/logo-full.png7 :alt: Flask: web development, one drop at a time8- :align: right8+ :align: center9+ :target: https://palletsprojects.com/p/flask/10 11 Welcome to Flask's documentation. Get started with :ref:`installation`12 and then get an overview with the :ref:`quickstart`. There is also a13 more detailed :ref:`tutorial` that shows how to create a small but14 unmodified linesadded:docs/requirements.txt+3 added
1+Sphinx~=1.8.02+Pallets-Sphinx-Themes~=1.1.03+sphinxcontrib-log-cabinet~=1.0.0modified:tox.ini+1 added-10 removed
37 unmodified lines38 coverage run -p -m pytest tests examples39 40 [testenv:docs-html]41 deps =42- sphinx43- pallets-sphinx-themes44- sphinxcontrib-log-cabinet42+ -r docs/requirements.txt43 commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html44 47-[testenv:docs-linkcheck]48-deps =49- sphinx50- pallets-sphinx-themes51- sphinxcontrib-log-cabinet52-commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs {envtmpdir}/linkcheck53-45 [testenv:coverage-report]46 deps = coverage47 skip_install = true48 commands =12 unmodified lines