Skip to content
Myr

Merge pull request #3376 from pallets/migrate-docs

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

update docs for new theme

authored by David Lord · committed by GitHub · parents 1c2a2cd, 4ed2065 · Browse files · 15 files+65 added−135 removed
This commit

State

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

Diff stats

15 files+65 added−135 removed

  • other:+65 added−135 removed

15 files+65 added−135 removed

modified:docs/_static/debugger.pngbinary

A binary file, modified.

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.pngbinary

A binary file, added.

deleted:docs/_static/flask.pngbinary

A binary file, deleted.

deleted:docs/_static/logo-full.pngbinary

A binary file, deleted.

modified:docs/_static/no.pngbinary

A binary file, modified.

added:docs/_static/pycharm-runconfig.pngbinary

A binary file, added.

deleted:docs/_static/touch-icon.pngbinary

A binary file, deleted.

modified:docs/_static/yes.pngbinary

A binary file, modified.

modified:docs/conf.py+48 added-122 removed
1# -*- coding: utf-8 -*-2from __future__ import print_function1import packaging.version2from pallets_sphinx_themes import get_version3from pallets_sphinx_themes import ProjectLink44import inspect5import re67from pallets_sphinx_themes import ProjectLink, get_version85# Project --------------------------------------------------------------611project = 'Flask'12copyright = '2010 Pallets Team'13author = 'Pallets Team'14release, version = get_version('Flask')7project = "Flask"8copyright = "2010 Pallets"9author = "Pallets"10release, version = get_version("Flask")1112# General --------------------------------------------------------------1318master_doc = 'index'1914master_doc = "index"15extensions = [21 'sphinx.ext.autodoc',22 'sphinx.ext.intersphinx',23 'sphinxcontrib.log_cabinet',16 "sphinx.ext.autodoc",17 "sphinx.ext.intersphinx",18 "sphinxcontrib.log_cabinet",19 "pallets_sphinx_themes",20 "sphinx_issues",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": ("https://werkzeug.palletsprojects.com/", 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}32issues_github_path = "pallets/flask"3334# HTML -----------------------------------------------------------------3539html_theme = 'flask'36html_theme = "flask"37html_theme_options = {"index_sidebar_logo": False}38html_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 'canonical_url': 'http://flask.pocoo.org/docs/{}/'.format(version),50 'carbon_ads_args': 'zoneid=1673&serve=C6AILKT&placement=pocooorg',39 "project_links": [40 ProjectLink("Donate to Pallets", "https://palletsprojects.com/donate"),41 ProjectLink("Flask Website", "https://palletsprojects.com/p/flask/"),42 ProjectLink("PyPI releases", "https://pypi.org/project/Flask/"),43 ProjectLink("Source Code", "https://github.com/pallets/flask/"),44 ProjectLink("Issue Tracker", "https://github.com/pallets/flask/issues/"),45 ]46}47html_sidebars = {53 'index': [54 'project.html',55 'versions.html',56 'carbon_ads.html',57 'searchbox.html',58 ],59 '**': [60 'localtoc.html',61 'relations.html',62 'versions.html',63 'carbon_ads.html',64 'searchbox.html',65 ]48 "index": ["project.html", "localtoc.html", "searchbox.html"],49 "**": ["localtoc.html", "relations.html", "searchbox.html"],50}67html_static_path = ['_static']68html_favicon = '_static/flask-favicon.ico'69html_logo = '_static/flask.png'70html_additional_pages = {71 '404': '404.html',72}51singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}52html_static_path = ["_static"]53html_favicon = "_static/flask-icon.png"54html_logo = "_static/flask-icon.png"55html_title = "Flask Documentation ({})".format(version)56html_show_sourcelink = False5758# LaTeX ----------------------------------------------------------------5960latex_documents = [78 (master_doc, 'Flask.tex', 'Flask Documentation', 'Pallets Team', 'manual'),61 (master_doc, "Flask-{}.tex".format(version), html_title, author, "manual")62]80latex_use_modindex = False81latex_elements = {82 'papersize': 'a4paper',83 'pointsize': '12pt',84 'fontpkg': r'\usepackage{mathpazo}',85 'preamble': r'\usepackage{flaskstyle}',86}87latex_use_parts = True88latex_additional_files = ['flaskstyle.sty', 'logo.pdf']6390# linkcheck ------------------------------------------------------------9192linkcheck_anchors = False9364# Local Extensions -----------------------------------------------------6596def unwrap_decorators():97 import sphinx.util.inspect as inspect98 import functools66100 old_getargspec = inspect.getargspec101 def getargspec(x):102 return old_getargspec(getattr(x, '_original_function', x))103 inspect.getargspec = getargspec104105 old_update_wrapper = functools.update_wrapper106 def update_wrapper(wrapper, wrapped, *a, **kw):107 rv = old_update_wrapper(wrapper, wrapped, *a, **kw)108 rv._original_function = wrapped109 return rv110 functools.update_wrapper = update_wrapper111112113unwrap_decorators()114del unwrap_decorators115116117_internal_mark_re = re.compile(r'^\s*:internal:\s*$(?m)', re.M)118119120def skip_internal(app, what, name, obj, skip, options):121 docstring = inspect.getdoc(obj) or ''122123 if skip or _internal_mark_re.search(docstring) is not None:124 return True125126127def cut_module_meta(app, what, name, obj, options, lines):128 """Remove metadata from autodoc output."""129 if what != 'module':130 return131132 lines[:] = [133 line for line in lines134 if not line.startswith((':copyright:', ':license:'))135 ]136137138def github_link(139 name, rawtext, text, lineno, inliner, options=None, content=None140):67def github_link(name, rawtext, text, lineno, inliner, options=None, content=None):68 app = inliner.document.settings.env.app69 release = app.config.release143 base_url = 'https://github.com/pallets/flask/tree/'70 base_url = "https://github.com/pallets/flask/tree/"71145 if text.endswith('>'):146 words, text = text[:-1].rsplit('<', 1)72 if text.endswith(">"):73 words, text = text[:-1].rsplit("<", 1)74 words = words.strip()75 else:76 words = None77151 if release.endswith('dev'):152 url = '{0}master/{1}'.format(base_url, text)78 if packaging.version.parse(release).is_devrelease:79 url = "{0}master/{1}".format(base_url, text)80 else:154 url = '{0}{1}/{2}'.format(base_url, release, text)81 url = "{0}{1}/{2}".format(base_url, release, text)8283 if words is None:84 words = url8586 from docutils.nodes import reference87 from docutils.parsers.rst.roles import set_classes8889 options = options or {}90 set_classes(options)91 node = reference(rawtext, words, refuri=url, **options)92 return [node], []939495def setup(app):168 app.connect('autodoc-skip-member', skip_internal)169 app.connect('autodoc-process-docstring', cut_module_meta)170 app.add_role('gh', github_link)96 app.add_role("gh", github_link)
modified:docs/index.rst+5 added-5 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 :class: floatingflask9 :align: right6.. image:: _static/flask-logo.png7 :alt: Flask: web development, one drop at a time8 :align: center9 :target: https://palletsprojects.com/p/flask/1011Welcome to Flask's documentation. This documentation is divided into12different parts. I recommend that you get started with13:ref:`installation` and then head over to the :ref:`quickstart`.
19 unmodified lines
modified:docs/make.bat+2 added-3 removed
7 unmodified lines
8 set SPHINXBUILD=sphinx-build9)10set SOURCEDIR=.11set BUILDDIR=_build12set SPHINXPROJ=Flask1213if "%1" == "" goto help1415%SPHINXBUILD% >NUL 2>NUL
8 unmodified lines
24 echo.http://sphinx-doc.org/25 exit /b 126)2729%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%28%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%29goto end3031:help33%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%32%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%3334:end35popd
modified:docs/Makefile+5 added-5 removed
1# Minimal makefile for Sphinx documentation2#34# You can set these variables from the command line.5SPHINXOPTS =6SPHINXBUILD = sphinx-build7SPHINXPROJ = Flask4# You can set these variables from the command line, and also5# from the environment for the first two.6SPHINXOPTS ?=7SPHINXBUILD ?= sphinx-build8SOURCEDIR = .9BUILDDIR = _build1011# Put it first so that "make" without argument is like "make help".
4 unmodified lines
1617# Catch-all target: route all unknown targets to Sphinx using the new18# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).19%: Makefile20 @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)20 @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
added:docs/requirements.txt+5 added
1Sphinx~=2.2.02Pallets-Sphinx-Themes~=1.2.23sphinxcontrib-log-cabinet~=1.0.14sphinx-issues~=1.2.05packaging~=19.2