Merge pull request #2709 from davidism/docs-theme
Before adoption: this commit came in with the history the project adopted, so no landing records it.
use theme provided by pallets-sphinx-themes
authored by David Lord · committed by GitHub · parents 3a0ea72, 49a38ed · Browse files · 25 files·+186 added−586 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
25 files+186 added−586 removed
- other:+186 added−586 removed
Provenance
- Commit
5fba092- Tree
f16e992- Author
David Lord <davidism@gmail.com>- Committer
GitHub <noreply@github.com>- Parent 1
3a0ea72- Parent 2
49a38ed
25 files changed+186 added−586 removed
deleted:docs/_templates/sidebarintro.html-22 removed
12345678910111213141516171819202122<h3>About Flask</h3><p> Flask is a micro web development framework for Python. You are currently looking at the documentation of the development version.</p><h3>Other Formats</h3><p> You can download the documentation in other formats as well:</p><ul> <li><a href="http://flask.pocoo.org/docs/flask-docs.pdf">as PDF</a> <li><a href="http://flask.pocoo.org/docs/flask-docs.epub">as ePub</a> <li><a href="http://flask.pocoo.org/docs/flask-docs.mobi">as .mobi</a> <li><a href="http://flask.pocoo.org/docs/flask-docs.zip">as zipped HTML</a></ul><h3>Useful Links</h3><ul> <li><a href="http://flask.pocoo.org/">The Flask Website</a></li> <li><a href="https://pypi.python.org/pypi/Flask">Flask @ PyPI</a></li> <li><a href="https://github.com/pallets/flask">Flask @ GitHub</a></li> <li><a href="https://github.com/pallets/flask/issues">Issue Tracker</a></li></ul>deleted:docs/_templates/sidebarlogo.html-3 removed
123<p class="logo"><a href="{{ pathto(master_doc) }}"> <img class="logo" src="{{ pathto('_static/flask.png', 1) }}" alt="Logo"/></a></p>modified:docs/deploying/fastcgi.rst+1 added-1 removed
235 unmodified lines236 237 .. _nginx: https://nginx.org/238 .. _lighttpd: https://www.lighttpd.net/239 .. _cherokee: http://cherokee-project.com/240-.. _flup: https://pypi.python.org/pypi/flup240+.. _flup: https://pypi.org/project/flup/modified:docs/deploying/mod_wsgi.rst+1 added-1 removed
132 unmodified lines133 For more information consult the `mod_wsgi documentation`_.134 135 .. _mod_wsgi: https://github.com/GrahamDumpleton/mod_wsgi136 .. _installation instructions: https://modwsgi.readthedocs.io/en/develop/installation.html137-.. _virtual python: https://pypi.python.org/pypi/virtualenv137+.. _virtual python: https://pypi.org/project/virtualenv/138 .. _mod_wsgi documentation: https://modwsgi.readthedocs.io/en/develop/index.html139 140 Troubleshooting141 ---------------76 unmodified linesmodified:docs/patterns/caching.rst+1 added-1 removed
25 unmodified lines26 from werkzeug.contrib.cache import SimpleCache27 cache = SimpleCache()28 29 If you want to use memcached, make sure to have one of the memcache modules30-supported (you get them from `PyPI <https://pypi.python.org/pypi>`_) and a30+supported (you get them from `PyPI <https://pypi.org/>`_) and a31 memcached server running somewhere. This is how you connect to such an32 memcached server then::33 34 from werkzeug.contrib.cache import MemcachedCache35 unmodified linesmodified:docs/patterns/distribute.rst+2 added-2 removed
171 unmodified lines172 folder instead of copying the data over. You can then continue to work on173 the code without having to run ``install`` again after each change.174 175 176-.. _pip: https://pypi.python.org/pypi/pip177-.. _Setuptools: https://pypi.python.org/pypi/setuptools176+.. _pip: https://pypi.org/project/pip/177+.. _Setuptools: https://pypi.org/project/setuptools/modified:docs/patterns/sqlalchemy.rst+1 added-1 removed
18 unmodified lines19 there is a Flask extension that handles that for you. This is recommended20 if you want to get started quickly.21 22 You can download `Flask-SQLAlchemy`_ from `PyPI23-<https://pypi.python.org/pypi/Flask-SQLAlchemy>`_.23+<https://pypi.org/project/Flask-SQLAlchemy/>`_.24 25 .. _Flask-SQLAlchemy: http://flask-sqlalchemy.pocoo.org/26 27 191 unmodified linesmodified:docs/patterns/wtforms.rst+1 added-1 removed
15 unmodified lines16 17 The `Flask-WTF`_ extension expands on this pattern and adds a18 few little helpers that make working with forms and Flask more19 fun. You can get it from `PyPI20- <https://pypi.python.org/pypi/Flask-WTF>`_.20+ <https://pypi.org/project/Flask-WTF/>`_.21 22 .. _Flask-WTF: https://flask-wtf.readthedocs.io/en/stable/23 24 The Forms102 unmodified linesdeleted:docs/.gitignore-1 removed
1-_buildmodified:docs/api.rst+1 added-1 removed
629 unmodified lines630 do nothing but will fail with a :exc:`RuntimeError` for all other631 operations, including connecting.632 633 634-.. _blinker: https://pypi.python.org/pypi/blinker634+.. _blinker: https://pypi.org/project/blinker/635 636 .. _class-based-views:637 638 Class-Based Views184 unmodified linesmodified:docs/conf.py+105 added-277 removed
1 # -*- coding: utf-8 -*-2-#3-# Flask documentation build configuration file, created by4-# sphinx-quickstart on Tue Apr 6 15:24:58 2010.5-#6-# This file is execfile()d with the current directory set to its containing dir.7-#8-# Note that not all possible configuration values are present in this9-# autogenerated file.10-#11-# All configuration values have a default; values that are commented out12-# serve to show the default.2 from __future__ import print_function3 15-import datetime16-import os17-import sys18-import time4+import inspect5+import re6 20-import pkg_resources7+from pallets_sphinx_themes import DocVersion, ProjectLink, get_version8 22-BUILD_DATE = datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))9+# Project --------------------------------------------------------------10 24-# If extensions (or modules to document with autodoc) are in another directory,25-# add these directories to sys.path here. If the directory is relative to the26-# documentation root, use os.path.abspath to make it absolute, like shown here.27-sys.path.append(os.path.dirname(__file__))11+project = 'Flask'12+copyright = '2010 Pallets Team'13+author = 'Pallets Team'14+release, version = get_version('Flask')15 29-# -- General configuration -----------------------------------------------------16+# General --------------------------------------------------------------17 31-# If your documentation needs a minimal Sphinx version, state it here.32-#needs_sphinx = '1.0'18+master_doc = 'index'19 34-# Add any Sphinx extension module names here, as strings. They can be extensions35-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.20 extensions = [21 'sphinx.ext.autodoc',22 'sphinx.ext.intersphinx',39- 'flaskdocext'23+ 'sphinxcontrib.log_cabinet',24 ]25 42-try:43- __import__('sphinxcontrib.log_cabinet')44-except ImportError:45- print('sphinxcontrib-log-cabinet is not installed.')46- print('Changelog directives will not be re-organized.')47-else:48- extensions.append('sphinxcontrib.log_cabinet')26+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),35+}36 50-# Add any paths that contain templates here, relative to this directory.51-templates_path = ['_templates']37+# HTML -----------------------------------------------------------------38 53-# The suffix of source filenames.54-source_suffix = '.rst'55-56-# The encoding of source files.57-#source_encoding = 'utf-8-sig'58-59-# The master toctree document.60-master_doc = 'index'61-62-# General information about the project.63-project = u'Flask'64-copyright = u'2010 - {0}, Armin Ronacher'.format(BUILD_DATE.year)65-66-# The version info for the project you're documenting, acts as replacement for67-# |version| and |release|, also used in various other places throughout the68-# built documents.69-try:70- release = pkg_resources.get_distribution('Flask').version71-except pkg_resources.DistributionNotFound:72- print('Flask must be installed to build the documentation.')73- print('Install from source using `pip install -e .` in a virtualenv.')74- sys.exit(1)75-76-if 'dev' in release:77- release = ''.join(release.partition('dev')[:2])78-79-version = '.'.join(release.split('.')[:2])80-81-# The language for content autogenerated by Sphinx. Refer to documentation82-# for a list of supported languages.83-#language = None84-85-# There are two options for replacing |today|: either, you set today to some86-# non-false value, then it is used:87-#today = ''88-# Else, today_fmt is used as the format for a strftime call.89-#today_fmt = '%B %d, %Y'90-91-# List of patterns, relative to source directory, that match files and92-# directories to ignore when looking for source files.93-exclude_patterns = ['_build']94-95-# The reST default role (used for this markup: `text`) to use for all documents.96-#default_role = None97-98-# If true, '()' will be appended to :func: etc. cross-reference text.99-#add_function_parentheses = True100-101-# If true, the current module name will be prepended to all description102-# unit titles (such as .. function::).103-#add_module_names = True104-105-# If true, sectionauthor and moduleauthor directives will be shown in the106-# output. They are ignored by default.107-#show_authors = False108-109-# A list of ignored prefixes for module index sorting.110-#modindex_common_prefix = []111-112-113-# -- Options for HTML output ---------------------------------------------------114-115-# The theme to use for HTML and HTML Help pages. Major themes that come with116-# Sphinx are currently 'default' and 'sphinxdoc'.117-# html_theme = 'default'118-119-# Theme options are theme-specific and customize the look and feel of a theme120-# further. For a list of options available for each theme, see the121-# documentation.122-# html_theme_options = {}123-124-# Add any paths that contain custom themes here, relative to this directory.125-# html_theme_path = ['_themes']126-127-# The name for this set of Sphinx documents. If None, it defaults to128-# "<project> v<release> documentation".129-#html_title = None130-131-# A shorter title for the navigation bar. Default is the same as html_title.132-#html_short_title = None133-134-# The name of an image file (relative to this directory) to place at the top135-# of the sidebar. Do not set, template magic!136-#html_logo = None137-138-# The name of an image file (within the static path) to use as favicon of the139-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32140-# pixels large.141-html_favicon = '_static/flask-favicon.ico'142-143-# Add any paths that contain custom static files (such as style sheets) here,144-# relative to this directory. They are copied after the builtin static files,145-# so a file named "default.css" will overwrite the builtin "default.css".146-html_static_path = ['_static']147-148-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,149-# using the given strftime format.150-#html_last_updated_fmt = '%b %d, %Y'151-152-# If true, SmartyPants will be used to convert quotes and dashes to153-# typographically correct entities.154-#html_use_smartypants = True155-156-# Custom sidebar templates, maps document names to template names.39+html_theme = 'flask'40+html_context = {41+ 'project_links': [42+ ProjectLink('Flask Website', 'https://palletsprojects.com/p/flask/'),43+ ProjectLink('PyPI releases', 'https://pypi.org/project/Flask/'),44+ ProjectLink('Source Code', 'https://github.com/pallets/flask/'),45+ ProjectLink(46+ 'Issue Tracker', 'https://github.com/pallets/flask/issues/'),47+ ],48+ 'versions': [49+ DocVersion('dev', 'Development', 'unstable'),50+ DocVersion('1.0', 'Flask 1.0', 'stable'),51+ DocVersion('0.12', 'Flask 0.12'),52+ ],53+ 'canonical_url': 'http://flask.pocoo.org/docs/{}/'.format(version),54+ 'carbon_ads_args': 'zoneid=1673&serve=C6AILKT&placement=pocooorg',55+}56 html_sidebars = {57 'index': [159- 'sidebarintro.html',160- 'sourcelink.html',161- 'searchbox.html'58+ 'project.html',59+ 'versions.html',60+ 'searchbox.html',61 ],62 '**': [164- 'sidebarlogo.html',63 'localtoc.html',64 'relations.html',167- 'sourcelink.html',168- 'searchbox.html'65+ 'versions.html',66+ 'carbon_ads.html',67+ 'searchbox.html',68 ]69 }70+html_static_path = ['_static']71+html_favicon = '_static/flask-favicon.ico'72+html_logo = '_static/flask.png'73+html_additional_pages = {74+ '404': '404.html',75+}76+html_show_sourcelink = False77 172-# Additional templates that should be rendered to pages, maps page names to173-# template names.174-#html_additional_pages = {}78+# LaTeX ----------------------------------------------------------------79 176-# If false, no module index is generated.177-html_use_modindex = False178-179-# If false, no index is generated.180-#html_use_index = True181-182-# If true, the index is split into individual pages for each letter.183-#html_split_index = False184-185-# If true, links to the reST sources are added to the pages.186-#html_show_sourcelink = True187-188-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.189-html_show_sphinx = False190-191-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.192-#html_show_copyright = True193-194-# If true, an OpenSearch description file will be output, and all pages will195-# contain a <link> tag referring to it. The value of this option must be the196-# base URL from which the finished HTML is served.197-#html_use_opensearch = ''198-199-# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").200-#html_file_suffix = ''201-202-# Output file base name for HTML help builder.203-htmlhelp_basename = 'Flaskdoc'204-205-206-# -- Options for LaTeX output --------------------------------------------------207-208-# Grouping the document tree into LaTeX files. List of tuples209-# (source start file, target name, title, author, documentclass [howto/manual]).80 latex_documents = [211- ('latexindex', 'Flask.tex', u'Flask Documentation', u'Armin Ronacher', 'manual'),81+ (master_doc, 'Flask.tex', 'Flask Documentation', 'Pallets Team', 'manual'),82 ]213-214-# Documents to append as an appendix to all manuals.215-#latex_appendices = []216-217-# If false, no module index is generated.83 latex_use_modindex = False219-84 latex_elements = {221- 'fontpkg': r'\usepackage{mathpazo}',85 'papersize': 'a4paper',86 'pointsize': '12pt',87+ 'fontpkg': r'\usepackage{mathpazo}',224- 'preamble': r'\usepackage{flaskstyle}'88+ 'preamble': r'\usepackage{flaskstyle}',89 }90 latex_use_parts = True227-91 latex_additional_files = ['flaskstyle.sty', 'logo.pdf']92 93+# linkcheck ------------------------------------------------------------94 231-# -- Options for Epub output ---------------------------------------------------95+linkcheck_anchors = False96 233-# Bibliographic Dublin Core info.234-#epub_title = ''235-#epub_author = ''236-#epub_publisher = ''237-#epub_copyright = ''97+# Local Extensions -----------------------------------------------------98 239-# The language of the text. It defaults to the language option240-# or en if the language is not set.241-#epub_language = ''242-243-# The scheme of the identifier. Typical schemes are ISBN or URL.244-#epub_scheme = ''245-246-# The unique identifier of the text. This can be an ISBN number247-# or the project homepage.248-#epub_identifier = ''249-250-# A unique identification for the text.251-#epub_uid = ''252-253-# HTML files that should be inserted before the pages created by sphinx.254-# The format is a list of tuples containing the path and title.255-#epub_pre_files = []256-257-# HTML files shat should be inserted after the pages created by sphinx.258-# The format is a list of tuples containing the path and title.259-#epub_post_files = []260-261-# A list of files that should not be packed into the epub file.262-#epub_exclude_files = []263-264-# The depth of the table of contents in toc.ncx.265-#epub_tocdepth = 3266-267-intersphinx_mapping = {268- 'python': ('https://docs.python.org/3/', None),269- 'werkzeug': ('http://werkzeug.pocoo.org/docs/', None),270- 'click': ('http://click.pocoo.org/', None),271- 'jinja': ('http://jinja.pocoo.org/docs/', None),272- 'itsdangerous': ('https://pythonhosted.org/itsdangerous', None),273- 'sqlalchemy': ('https://docs.sqlalchemy.org/en/latest/', None),274- 'wtforms': ('https://wtforms.readthedocs.io/en/latest/', None),275- 'blinker': ('https://pythonhosted.org/blinker/', None),276-}277-278-html_theme_options = {279- 'touch_icon': 'touch-icon.png'280-}281-282-# unwrap decorators99 def unwrap_decorators():100 import sphinx.util.inspect as inspect101 import functools102 8 unmodified lines111 rv._original_function = wrapped112 return rv113 functools.update_wrapper = update_wrapper114 115+116 unwrap_decorators()117 del unwrap_decorators118 119 303-def setup(app):304- def cut_module_meta(app, what, name, obj, options, lines):305- """Remove metadata from autodoc output."""306- if what != 'module':307- return120+_internal_mark_re = re.compile(r'^\s*:internal:\s*$(?m)', re.M)121 309- lines[:] = [310- line for line in lines311- if not line.startswith((':copyright:', ':license:'))312- ]122 314- app.connect('autodoc-process-docstring', cut_module_meta)123+def skip_internal(app, what, name, obj, skip, options):124+ docstring = inspect.getdoc(obj) or ''125 316- def github_link(317- name, rawtext, text, lineno, inliner,318- options=None, content=None319- ):320- app = inliner.document.settings.env.app321- release = app.config.release322- base_url = 'https://github.com/pallets/flask/tree/'126+ if skip or _internal_mark_re.search(docstring) is not None:127+ return True128 324- if text.endswith('>'):325- words, text = text[:-1].rsplit('<', 1)326- words = words.strip()327- else:328- words = None129 330- if release.endswith('dev'):331- url = '{0}master/{1}'.format(base_url, text)332- else:333- url = '{0}{1}/{2}'.format(base_url, release, text)130+def cut_module_meta(app, what, name, obj, options, lines):131+ """Remove metadata from autodoc output."""132+ if what != 'module':133+ return134 335- if words is None:336- words = url135+ lines[:] = [136+ line for line in lines137+ if not line.startswith((':copyright:', ':license:'))138+ ]139 338- from docutils.nodes import reference339- from docutils.parsers.rst.roles import set_classes340- options = options or {}341- set_classes(options)342- node = reference(rawtext, words, refuri=url, **options)343- return [node], []140 141+def github_link(142+ name, rawtext, text, lineno, inliner, options=None, content=None143+):144+ app = inliner.document.settings.env.app145+ release = app.config.release146+ base_url = 'https://github.com/pallets/flask/tree/'147+148+ if text.endswith('>'):149+ words, text = text[:-1].rsplit('<', 1)150+ words = words.strip()151+ else:152+ words = None153+154+ if release.endswith('dev'):155+ url = '{0}master/{1}'.format(base_url, text)156+ else:157+ url = '{0}{1}/{2}'.format(base_url, release, text)158+159+ if words is None:160+ words = url161+162+ from docutils.nodes import reference163+ from docutils.parsers.rst.roles import set_classes164+ options = options or {}165+ set_classes(options)166+ node = reference(rawtext, words, refuri=url, **options)167+ return [node], []168+169+170+def setup(app):171+ app.connect('autodoc-skip-member', skip_internal)172+ app.connect('autodoc-process-docstring', cut_module_meta)173 app.add_role('gh', github_link)modified:docs/extensiondev.rst+3 added-2 removed
326 unmodified lines327 *ExtensionName-Flask*.328 6. Approved extensions must define all their dependencies in the329 :file:`setup.py` file unless a dependency cannot be met because it is not330 available on PyPI.331-7. The extension must have documentation that uses one of the two Flask332- themes for Sphinx documentation.331+7. The documentation must use the ``flask`` theme from the `Official332+ Pallets Themes`_.333 8. The setup.py description (and thus the PyPI description) has to334 link to the documentation, website (if there is one) and there335 must be a link to automatically install the development version336 (``PackageName==dev``).4 unmodified lines341 342 .. _OAuth extension: https://pythonhosted.org/Flask-OAuth/343 .. _mailinglist: http://flask.pocoo.org/mailinglist/344 .. _IRC channel: http://flask.pocoo.org/community/irc/345+.. _Official Pallets Themes: https://pypi.org/project/pallets-sphinx-themes/modified:docs/extensions.rst+1 added-1 removed
48 unmodified lines49 extension.50 51 52 .. _Extension Registry: http://flask.pocoo.org/extensions/53-.. _pypi: https://pypi.python.org/pypi?:action=browse&c=58553+.. _pypi: https://pypi.org/search/?c=Framework+%3A%3A+Flaskdeleted:docs/flaskdocext.py-16 removed
1-import re2-import inspect3-4-5-_internal_mark_re = re.compile(r'^\s*:internal:\s*$(?m)')6-7-8-def skip_member(app, what, name, obj, skip, options):9- docstring = inspect.getdoc(obj)10- if skip:11- return True12- return _internal_mark_re.search(docstring or '') is not None13-14-15-def setup(app):16- app.connect('autodoc-skip-member', skip_member)modified:docs/index.rst+2 added-2 removed
3 unmodified lines4 ================5 6 .. image:: _static/logo-full.png7 :alt: Flask: web development, one drop at a time8- :class: floatingflask8+ :align: right9 10 Welcome to Flask's documentation. Get started with :ref:`installation`11 and then get an overview with the :ref:`quickstart`. There is also a12 more detailed :ref:`tutorial` that shows how to create a small but13 complete application with Flask. Common patterns are described in the14-:ref:`patterns` section. The rest of the docs desribe each component of14+:ref:`patterns` section. The rest of the docs describe each component of15 Flask in detail, with a full reference in the :ref:`api` section.16 17 Flask depends on the `Jinja`_ template engine and the `Werkzeug`_ WSGI18 toolkit. The documentation for these libraries can be found at:8 unmodified linesmodified:docs/installation.rst+1 added-1 removed
25 unmodified lines26 the ``flask`` command and allows adding custom management commands.27 28 .. _Werkzeug: http://werkzeug.pocoo.org/29 .. _Jinja: http://jinja.pocoo.org/30-.. _MarkupSafe: https://pypi.python.org/pypi/MarkupSafe30+.. _MarkupSafe: https://pypi.org/project/MarkupSafe/31 .. _ItsDangerous: https://pythonhosted.org/itsdangerous/32 .. _Click: http://click.pocoo.org/33 34 Optional dependencies149 unmodified linesmodified:docs/make.bat+36 added-139 removed
1-@ECHO OFF2-3-REM Command file for Sphinx documentation4-5-if "%SPHINXBUILD%" == "" (6- set SPHINXBUILD=sphinx-build7-)8-set BUILDDIR=_build9-set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .10-if NOT "%PAPER%" == "" (11- set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%12-)13-14-if "%1" == "" goto help15-16-if "%1" == "help" (17- :help18- echo.Please use `make ^<target^>` where ^<target^> is one of19- echo. html to make standalone HTML files20- echo. dirhtml to make HTML files named index.html in directories21- echo. singlehtml to make a single large HTML file22- echo. pickle to make pickle files23- echo. json to make JSON files24- echo. htmlhelp to make HTML files and a HTML help project25- echo. qthelp to make HTML files and a qthelp project26- echo. devhelp to make HTML files and a Devhelp project27- echo. epub to make an epub28- echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter29- echo. changes to make an overview over all changed/added/deprecated items30- echo. linkcheck to check all external links for integrity31- echo. doctest to run all doctests embedded in the documentation if enabled32- goto end33-)34-35-if "%1" == "clean" (36- for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i37- del /q /s %BUILDDIR%\*38- goto end39-)40-41-if "%1" == "html" (42- %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html43- echo.44- echo.Build finished. The HTML pages are in %BUILDDIR%/html.45- goto end46-)47-48-if "%1" == "dirhtml" (49- %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml50- echo.51- echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.52- goto end53-)54-55-if "%1" == "singlehtml" (56- %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml57- echo.58- echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.59- goto end60-)61-62-if "%1" == "pickle" (63- %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle64- echo.65- echo.Build finished; now you can process the pickle files.66- goto end67-)68-69-if "%1" == "json" (70- %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json71- echo.72- echo.Build finished; now you can process the JSON files.73- goto end74-)75-76-if "%1" == "htmlhelp" (77- %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp78- echo.79- echo.Build finished; now you can run HTML Help Workshop with the ^80-.hhp project file in %BUILDDIR%/htmlhelp.81- goto end82-)83-84-if "%1" == "qthelp" (85- %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp86- echo.87- echo.Build finished; now you can run "qcollectiongenerator" with the ^88-.qhcp project file in %BUILDDIR%/qthelp, like this:89- echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Flask.qhcp90- echo.To view the help file:91- echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Flask.ghc92- goto end93-)94-95-if "%1" == "devhelp" (96- %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% _build/devhelp97- echo.98- echo.Build finished.99- goto end100-)101-102-if "%1" == "epub" (103- %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub104- echo.105- echo.Build finished. The epub file is in %BUILDDIR%/epub.106- goto end107-)108-109-if "%1" == "latex" (110- %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex111- echo.112- echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.113- goto end114-)115-116-if "%1" == "changes" (117- %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes118- echo.119- echo.The overview file is in %BUILDDIR%/changes.120- goto end121-)122-123-if "%1" == "linkcheck" (124- %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck125- echo.126- echo.Link check complete; look for any errors in the above output ^127-or in %BUILDDIR%/linkcheck/output.txt.128- goto end129-)130-131-if "%1" == "doctest" (132- %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest133- echo.134- echo.Testing of doctests in the sources finished, look at the ^135-results in %BUILDDIR%/doctest/output.txt.136- goto end137-)138-139-:end1+@ECHO OFF2+3+pushd %~dp04+5+REM Command file for Sphinx documentation6+7+if "%SPHINXBUILD%" == "" (8+ set SPHINXBUILD=sphinx-build9+)10+set SOURCEDIR=.11+set BUILDDIR=_build12+set SPHINXPROJ=Flask13+14+if "%1" == "" goto help15+16+%SPHINXBUILD% >NUL 2>NUL17+if errorlevel 9009 (18+ echo.19+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx20+ echo.installed, then set the SPHINXBUILD environment variable to point21+ echo.to the full path of the 'sphinx-build' executable. Alternatively you22+ echo.may add the Sphinx directory to PATH.23+ echo.24+ echo.If you don't have Sphinx installed, grab it from25+ echo.http://sphinx-doc.org/26+ exit /b 127+)28+29+%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%30+goto end31+32+:help33+%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%34+35+:end36+popdmodified:docs/Makefile+10 added-108 removed
1-# Makefile for Sphinx documentation1+# Minimal makefile for Sphinx documentation2 #3 4 # You can set these variables from the command line.5 SPHINXOPTS =6 SPHINXBUILD = sphinx-build7-PAPER =7+SPHINXPROJ = Flask8+SOURCEDIR = .9 BUILDDIR = _build10 10-# Internal variables.11-PAPEROPT_a4 = -D latex_paper_size=a412-PAPEROPT_letter = -D latex_paper_size=letter13-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .14-15-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp epub latex changes linkcheck doctest16-11+# Put it first so that "make" without argument is like "make help".12 help:18- @echo "Please use \`make <target>' where <target> is one of"19- @echo " html to make standalone HTML files"20- @echo " dirhtml to make HTML files named index.html in directories"21- @echo " singlehtml to make a single large HTML file"22- @echo " pickle to make pickle files"23- @echo " json to make JSON files"24- @echo " htmlhelp to make HTML files and a HTML help project"25- @echo " qthelp to make HTML files and a qthelp project"26- @echo " devhelp to make HTML files and a Devhelp project"27- @echo " epub to make an epub"28- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"29- @echo " latexpdf to make LaTeX files and run them through pdflatex"30- @echo " changes to make an overview of all changed/added/deprecated items"31- @echo " linkcheck to check all external links for integrity"32- @echo " doctest to run all doctests embedded in the documentation (if enabled)"13+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)14 34-clean:35- -rm -rf $(BUILDDIR)/*15+.PHONY: help Makefile16 37-html:38- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html39- @echo40- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."41-42-dirhtml:43- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml44- @echo45- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."46-47-singlehtml:48- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml49- @echo50- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."51-52-pickle:53- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle54- @echo55- @echo "Build finished; now you can process the pickle files."56-57-json:58- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json59- @echo60- @echo "Build finished; now you can process the JSON files."61-62-htmlhelp:63- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp64- @echo65- @echo "Build finished; now you can run HTML Help Workshop with the" \66- ".hhp project file in $(BUILDDIR)/htmlhelp."67-68-qthelp:69- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp70- @echo71- @echo "Build finished; now you can run "qcollectiongenerator" with the" \72- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"73- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Flask.qhcp"74- @echo "To view the help file:"75- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Flask.qhc"76-77-devhelp:78- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) _build/devhelp79- @echo80- @echo "Build finished."81- @echo "To view the help file:"82- @echo "# mkdir -p $$HOME/.local/share/devhelp/Flask"83- @echo "# ln -s _build/devhelp $$HOME/.local/share/devhelp/Flask"84- @echo "# devhelp"85-86-epub:87- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub88- @echo89- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."90-91-latex:92- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex93- @echo94- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."95- @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \96- "run these through (pdf)latex."97-98-latexpdf: latex99- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex100- @echo "Running LaTeX files through pdflatex..."101- make -C _build/latex all-pdf102- @echo "pdflatex finished; the PDF files are in _build/latex."103-104-changes:105- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes106- @echo107- @echo "The overview file is in $(BUILDDIR)/changes."108-109-linkcheck:110- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck111- @echo112- @echo "Link check complete; look for any errors in the above output " \113- "or in $(BUILDDIR)/linkcheck/output.txt."114-115-doctest:116- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest117- @echo "Testing of doctests in the sources finished, look at the " \118- "results in $(BUILDDIR)/doctest/output.txt."17+# 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)modified:docs/signals.rst+1 added-1 removed
185 unmodified lines186 187 Take a look at :ref:`core-signals-list` for a list of all builtin signals.188 189 190-.. _blinker: https://pypi.python.org/pypi/blinker190+.. _blinker: https://pypi.org/project/blinker/modified:flask/cli.py+1 added-1 removed
241 unmodified lines242 '\n\n{tb}'.format(name=module_name, tb=traceback.format_exc())243 )244 elif raise_if_not_found:245 raise NoAppException(246- 'Could not import "{name}"."'.format(name=module_name)246+ 'Could not import "{name}".'.format(name=module_name)247 )248 else:249 return250 640 unmodified linesmodified:flask/helpers.py+1 added-1 removed
484 unmodified lines485 .. versionchanged:: 0.12486 The `attachment_filename` is preferred over `filename` for MIME-type487 detection.488 489- .. versionchanged:: 0.13489+ .. versionchanged:: 1.0490 UTF-8 filenames, as specified in `RFC 2231`_, are supported.491 492 .. _RFC 2231: https://tools.ietf.org/html/rfc2231#section-4493 536 unmodified linesmodified:.gitignore+1 added
12 unmodified lines13 .tox/14 .cache/15 .pytest_cache/16 .idea/17+docs/_build/18 19 # Coverage reports20 htmlcov/21 .coverage2 unmodified linesmodified:CHANGES.rst+1 added-1 removed
709 unmodified lines710 - modules can now register for a subdomain instead of just an URL711 prefix. This makes it possible to bind a whole module to a712 configurable subdomain.713 714-.. _blinker: https://pypi.python.org/pypi/blinker714+.. _blinker: https://pypi.org/project/blinker/715 716 Version 0.5.2717 -------------718 106 unmodified linesmodified:setup.py+7 added
36 unmodified lines37 'pytest>=3',38 'coverage',39 'tox',40 'sphinx',41+ 'pallets-sphinx-themes',42+ 'sphinxcontrib-log-cabinet',43 ],44+ 'docs': [45+ 'sphinx',46+ 'pallets-sphinx-themes',47+ 'sphinxcontrib-log-cabinet',48+ ]49 },50 classifiers=[51 'Development Status :: 5 - Production/Stable',52 'Environment :: Web Environment',22 unmodified linesmodified:tox.ini+8 added-2 removed
36 unmodified lines37 # pytest-cov doesn't seem to play nice with -p38 coverage run -p -m pytest tests examples39 40 [testenv:docs-html]41-deps = sphinx41+deps =42+ sphinx43+ pallets-sphinx-themes44+ sphinxcontrib-log-cabinet45 commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html46 47 [testenv:docs-linkcheck]45-deps = sphinx48+deps =49+ sphinx50+ pallets-sphinx-themes51+ sphinxcontrib-log-cabinet52 commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs {envtmpdir}/linkcheck53 54 [testenv:coverage-report]55 deps = coverage14 unmodified lines