Merge pull request #2710 from davidism/0.12-docs-theme
Before adoption: this commit came in with the history the project adopted, so no landing records it.
backport #2709 use theme provided by pallets-sphinx-themes
authored by David Lord · committed by GitHub · parents b354c37, 679bf00 · Browse files · 26 files·+164 added−658 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
26 files+164 added−658 removed
- other:+164 added−658 removed
Provenance
- Commit
0ff3f72- Tree
68e0d08- Author
David Lord <davidism@gmail.com>- Committer
GitHub <noreply@github.com>- Parent 1
b354c37- Parent 2
679bf00
26 files changed+164 added−658 removed
deleted:docs/_templates/sidebarintro.html-22 removed
12345678910111213141516171819202122<h3>About Flask</h3><p> Flask is a micro webdevelopment 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="http://pypi.python.org/pypi/Flask">Flask @ PyPI</a></li> <li><a href="http://github.com/pallets/flask">Flask @ GitHub</a></li> <li><a href="http://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: http://nginx.org/238 .. _lighttpd: http://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: http://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: http://modwsgi.readthedocs.io/en/develop/index.html139 140 Troubleshooting141 ---------------76 unmodified linesmodified:docs/patterns/distribute.rst+1 added-1 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/pip176+.. _pip: https://pypi.org/project/pip/177 .. _Setuptools: https://pythonhosted.org/setuptoolsmodified:docs/patterns/jquery.rst+2 added-4 removed
160 unmodified lines161 data arrived, it will call the given function with the return value as162 argument. Note that we can use the `$SCRIPT_ROOT` variable here that163 we set earlier.164 165-If you don't get the whole picture, download the `sourcecode166-for this example167-<https://github.com/pallets/flask/tree/master/examples/jqueryexample>`_168-from GitHub.165+If you don't get the whole picture, download the :gh:`sourcecode for166+this example <examples/jqueryexample>` from GitHub.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://pythonhosted.org/Flask-SQLAlchemy/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: http://pythonhosted.org/Flask-WTF/23 24 The Forms102 unmodified linesmodified:docs/tutorial/dbcon.rst+5 added-7 removed
64 unmodified lines65 group these module-level functions together, and put your new66 ``get_db`` and ``close_db`` functions below your existing67 ``connect_db`` function (following the tutorial line-by-line).68 69- If you need a moment to find your bearings, take a look at how the `example70- source`_ is organized. In Flask, you can put all of your application code71- into a single Python module. You don't have to, and if your app :ref:`grows72- larger <larger-applications>`, it's a good idea not to.73-74-.. _example source:75- https://github.com/pallets/flask/tree/master/examples/flaskr/69+ If you need a moment to find your bearings, take a look at how the70+ :gh:`example source <examples/flaskr>` is organized. In Flask, you71+ can put all of your application code into a single Python module.72+ You don't have to, and if your app73+ :ref:`grows larger <larger-applications>`, it's a good idea not to.modified:docs/tutorial/index.rst+1 added-4 removed
10 unmodified lines11 as a database (which comes out of the box with Python) so there is nothing12 else you need.13 14 If you want the full source code in advance or for comparison, check out15-the `example source`_.15+the :gh:`example source <examples/flaskr>`.16 17-.. _example source:18- https://github.com/pallets/flask/tree/master/examples/flaskr/19-17 .. toctree::18 :maxdepth: 219 20 introduction10 unmodified linesdeleted:docs/_themesnot shown
Its text is not shown, deleted.
deleted:docs/.gitignore-1 removed
1-_buildmodified:docs/api.rst+1 added-1 removed
701 unmodified lines702 do nothing but will fail with a :exc:`RuntimeError` for all other703 operations, including connecting.704 705 706-.. _blinker: https://pypi.python.org/pypi/blinker706+.. _blinker: https://pypi.org/project/blinker/707 708 709 Class-Based Views710 -----------------181 unmodified linesmodified:docs/conf.py+114 added-245 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_function14-from datetime import datetime15-import os16-import sys17-import pkg_resources3 19-# If extensions (or modules to document with autodoc) are in another directory,20-# add these directories to sys.path here. If the directory is relative to the21-# documentation root, use os.path.abspath to make it absolute, like shown here.22-sys.path.append(os.path.join(os.path.dirname(__file__), '_themes'))23-sys.path.append(os.path.dirname(__file__))4+import inspect5+import re6 25-# -- General configuration -----------------------------------------------------7+from pallets_sphinx_themes import ProjectLink, get_version8 27-# If your documentation needs a minimal Sphinx version, state it here.28-#needs_sphinx = '1.0'9+# Project --------------------------------------------------------------10 30-# Add any Sphinx extension module names here, as strings. They can be extensions31-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.11+project = 'Flask'12+copyright = '2010 Pallets Team'13+author = 'Pallets Team'14+release, version = get_version('Flask')15+16+# General --------------------------------------------------------------17+18+master_doc = 'index'19+20 extensions = [21 'sphinx.ext.autodoc',22 'sphinx.ext.intersphinx',35- 'flaskdocext'23+ 'sphinxcontrib.log_cabinet',24 ]25 38-# Add any paths that contain templates here, relative to this directory.39-templates_path = ['_templates']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 41-# The suffix of source filenames.42-source_suffix = '.rst'37+# HTML -----------------------------------------------------------------38 44-# The encoding of source files.45-#source_encoding = 'utf-8-sig'46-47-# The master toctree document.48-master_doc = 'index'49-50-# General information about the project.51-project = u'Flask'52-copyright = u'2010 - {0}, Armin Ronacher'.format(datetime.utcnow().year)53-54-# The version info for the project you're documenting, acts as replacement for55-# |version| and |release|, also used in various other places throughout the56-# built documents.57-try:58- release = pkg_resources.get_distribution('Flask').version59-except pkg_resources.DistributionNotFound:60- print('Flask must be installed to build the documentation.')61- print('Install from source using `pip install -e .` in a virtualenv.')62- sys.exit(1)63-64-if 'dev' in release:65- release = ''.join(release.partition('dev')[:2])66-67-version = '.'.join(release.split('.')[:2])68-69-# The language for content autogenerated by Sphinx. Refer to documentation70-# for a list of supported languages.71-#language = None72-73-# There are two options for replacing |today|: either, you set today to some74-# non-false value, then it is used:75-#today = ''76-# Else, today_fmt is used as the format for a strftime call.77-#today_fmt = '%B %d, %Y'78-79-# List of patterns, relative to source directory, that match files and80-# directories to ignore when looking for source files.81-exclude_patterns = ['_build']82-83-# The reST default role (used for this markup: `text`) to use for all documents.84-#default_role = None85-86-# If true, '()' will be appended to :func: etc. cross-reference text.87-#add_function_parentheses = True88-89-# If true, the current module name will be prepended to all description90-# unit titles (such as .. function::).91-#add_module_names = True92-93-# If true, sectionauthor and moduleauthor directives will be shown in the94-# output. They are ignored by default.95-#show_authors = False96-97-# A list of ignored prefixes for module index sorting.98-#modindex_common_prefix = []99-100-101-# -- Options for HTML output ---------------------------------------------------102-103-# The theme to use for HTML and HTML Help pages. Major themes that come with104-# Sphinx are currently 'default' and 'sphinxdoc'.105-# html_theme = 'default'106-107-# Theme options are theme-specific and customize the look and feel of a theme108-# further. For a list of options available for each theme, see the109-# documentation.110-# html_theme_options = {}111-112-# Add any paths that contain custom themes here, relative to this directory.113-html_theme_path = ['_themes']114-115-# The name for this set of Sphinx documents. If None, it defaults to116-# "<project> v<release> documentation".117-#html_title = None118-119-# A shorter title for the navigation bar. Default is the same as html_title.120-#html_short_title = None121-122-# The name of an image file (relative to this directory) to place at the top123-# of the sidebar. Do not set, template magic!124-#html_logo = None125-126-# The name of an image file (within the static path) to use as favicon of the127-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32128-# pixels large.129-html_favicon = '_static/flask-favicon.ico'130-131-# Add any paths that contain custom static files (such as style sheets) here,132-# relative to this directory. They are copied after the builtin static files,133-# so a file named "default.css" will overwrite the builtin "default.css".134-html_static_path = ['_static']135-136-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,137-# using the given strftime format.138-#html_last_updated_fmt = '%b %d, %Y'139-140-# If true, SmartyPants will be used to convert quotes and dashes to141-# typographically correct entities.142-#html_use_smartypants = True143-144-# 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+ 'canonical_url': 'http://flask.pocoo.org/docs/{}/'.format(version),49+ 'carbon_ads_args': 'zoneid=1673&serve=C6AILKT&placement=pocooorg',50+}51 html_sidebars = {52 'index': [147- 'sidebarintro.html',148- 'sourcelink.html',149- 'searchbox.html'53+ 'project.html',54+ 'versions.html',55+ 'searchbox.html',56 ],57 '**': [152- 'sidebarlogo.html',58 'localtoc.html',59 'relations.html',155- 'sourcelink.html',156- 'searchbox.html'60+ 'versions.html',61+ 'carbon_ads.html',62+ 'searchbox.html',63 ]64 }65+html_static_path = ['_static']66+html_favicon = '_static/flask-favicon.ico'67+html_logo = '_static/flask.png'68+html_additional_pages = {69+ '404': '404.html',70+}71+html_show_sourcelink = False72 160-# Additional templates that should be rendered to pages, maps page names to161-# template names.162-#html_additional_pages = {}73+# LaTeX ----------------------------------------------------------------74 164-# If false, no module index is generated.165-html_use_modindex = False166-167-# If false, no index is generated.168-#html_use_index = True169-170-# If true, the index is split into individual pages for each letter.171-#html_split_index = False172-173-# If true, links to the reST sources are added to the pages.174-#html_show_sourcelink = True175-176-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.177-html_show_sphinx = False178-179-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.180-#html_show_copyright = True181-182-# If true, an OpenSearch description file will be output, and all pages will183-# contain a <link> tag referring to it. The value of this option must be the184-# base URL from which the finished HTML is served.185-#html_use_opensearch = ''186-187-# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").188-#html_file_suffix = ''189-190-# Output file base name for HTML help builder.191-htmlhelp_basename = 'Flaskdoc'192-193-194-# -- Options for LaTeX output --------------------------------------------------195-196-# Grouping the document tree into LaTeX files. List of tuples197-# (source start file, target name, title, author, documentclass [howto/manual]).75 latex_documents = [199- ('latexindex', 'Flask.tex', u'Flask Documentation', u'Armin Ronacher', 'manual'),76+ (master_doc, 'Flask.tex', 'Flask Documentation', 'Pallets Team', 'manual'),77 ]201-202-# Documents to append as an appendix to all manuals.203-#latex_appendices = []204-205-# If false, no module index is generated.78 latex_use_modindex = False207-79 latex_elements = {209- 'fontpkg': r'\usepackage{mathpazo}',80 'papersize': 'a4paper',81 'pointsize': '12pt',82+ 'fontpkg': r'\usepackage{mathpazo}',212- 'preamble': r'\usepackage{flaskstyle}'83+ 'preamble': r'\usepackage{flaskstyle}',84 }85 latex_use_parts = True215-86 latex_additional_files = ['flaskstyle.sty', 'logo.pdf']87 88+# linkcheck ------------------------------------------------------------89 219-# -- Options for Epub output ---------------------------------------------------90+linkcheck_anchors = False91 221-# Bibliographic Dublin Core info.222-#epub_title = ''223-#epub_author = ''224-#epub_publisher = ''225-#epub_copyright = ''92+# Local Extensions -----------------------------------------------------93 227-# The language of the text. It defaults to the language option228-# or en if the language is not set.229-#epub_language = ''230-231-# The scheme of the identifier. Typical schemes are ISBN or URL.232-#epub_scheme = ''233-234-# The unique identifier of the text. This can be a ISBN number235-# or the project homepage.236-#epub_identifier = ''237-238-# A unique identification for the text.239-#epub_uid = ''240-241-# HTML files that should be inserted before the pages created by sphinx.242-# The format is a list of tuples containing the path and title.243-#epub_pre_files = []244-245-# HTML files shat should be inserted after the pages created by sphinx.246-# The format is a list of tuples containing the path and title.247-#epub_post_files = []248-249-# A list of files that should not be packed into the epub file.250-#epub_exclude_files = []251-252-# The depth of the table of contents in toc.ncx.253-#epub_tocdepth = 3254-255-intersphinx_mapping = {256- 'python': ('https://docs.python.org/3/', None),257- 'werkzeug': ('http://werkzeug.pocoo.org/docs/', None),258- 'click': ('http://click.pocoo.org/', None),259- 'jinja': ('http://jinja.pocoo.org/docs/', None),260- 'sqlalchemy': ('http://docs.sqlalchemy.org/en/latest/', None),261- 'wtforms': ('https://wtforms.readthedocs.io/en/latest/', None),262- 'blinker': ('https://pythonhosted.org/blinker/', None)263-}264-265-try:266- __import__('flask_theme_support')267- pygments_style = 'flask_theme_support.FlaskyStyle'268- html_theme = 'flask'269- html_theme_options = {270- 'touch_icon': 'touch-icon.png'271- }272-except ImportError:273- print('-' * 74)274- print('Warning: Flask themes unavailable. Building with default theme')275- print('If you want the Flask themes, run this command and build again:')276- print()277- print(' git submodule update --init')278- print('-' * 74)279-280-281-# unwrap decorators94 def unwrap_decorators():95 import sphinx.util.inspect as inspect96 import functools97 8 unmodified lines106 rv._original_function = wrapped107 return rv108 functools.update_wrapper = update_wrapper109 110+111 unwrap_decorators()112 del unwrap_decorators113+114+115+_internal_mark_re = re.compile(r'^\s*:internal:\s*$(?m)', re.M)116+117+118+def skip_internal(app, what, name, obj, skip, options):119+ docstring = inspect.getdoc(obj) or ''120+121+ if skip or _internal_mark_re.search(docstring) is not None:122+ return True123+124+125+def cut_module_meta(app, what, name, obj, options, lines):126+ """Remove metadata from autodoc output."""127+ if what != 'module':128+ return129+130+ lines[:] = [131+ line for line in lines132+ if not line.startswith((':copyright:', ':license:'))133+ ]134+135+136+def github_link(137+ name, rawtext, text, lineno, inliner, options=None, content=None138+):139+ app = inliner.document.settings.env.app140+ release = app.config.release141+ base_url = 'https://github.com/pallets/flask/tree/'142+143+ if text.endswith('>'):144+ words, text = text[:-1].rsplit('<', 1)145+ words = words.strip()146+ else:147+ words = None148+149+ if release.endswith('dev'):150+ url = '{0}master/{1}'.format(base_url, text)151+ else:152+ url = '{0}{1}/{2}'.format(base_url, release, text)153+154+ if words is None:155+ words = url156+157+ from docutils.nodes import reference158+ from docutils.parsers.rst.roles import set_classes159+ options = options or {}160+ set_classes(options)161+ node = reference(rawtext, words, refuri=url, **options)162+ return [node], []163+164+165+def setup(app):166+ app.connect('autodoc-skip-member', skip_internal)167+ app.connect('autodoc-process-docstring', cut_module_meta)168+ app.add_role('gh', github_link)modified:docs/extensions.rst+1 added-24 removed
27 unmodified lines28 Building Extensions29 -------------------30 31 While `Flask Extension Registry`_ contains many Flask extensions, you may not find32-an extension that fits your need. If this is the case, you can always create your own. 32+an extension that fits your need. If this is the case, you can always create your own.33 Consider reading :ref:`extension-dev` to develop your own Flask extension.34 35-Flask Before 0.836-----------------37-38-If you are using Flask 0.7 or earlier the :data:`flask.ext` package will not39-exist, instead you have to import from ``flaskext.foo`` or ``flask_foo``40-depending on how the extension is distributed. If you want to develop an41-application that supports Flask 0.7 or earlier you should still import42-from the :data:`flask.ext` package. We provide you with a compatibility43-module that provides this package for older versions of Flask. You can44-download it from GitHub: `flaskext_compat.py`_45-46-And here is how you can use it::47-48- import flaskext_compat49- flaskext_compat.activate()50-51- from flask.ext import foo52-53-Once the ``flaskext_compat`` module is activated the :data:`flask.ext` will54-exist and you can start importing from there.55-56-35 .. _Flask Extension Registry: http://flask.pocoo.org/extensions/58-.. _flaskext_compat.py: https://raw.githubusercontent.com/pallets/flask/master/scripts/flaskext_compat.pydeleted: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)deleted:docs/flaskext.py-86 removed
1-# flasky extensions. flasky pygments style based on tango style2-from pygments.style import Style3-from pygments.token import Keyword, Name, Comment, String, Error, \4- Number, Operator, Generic, Whitespace, Punctuation, Other, Literal5-6-7-class FlaskyStyle(Style):8- background_color = "#f8f8f8"9- default_style = ""10-11- styles = {12- # No corresponding class for the following:13- #Text: "", # class: ''14- Whitespace: "underline #f8f8f8", # class: 'w'15- Error: "#a40000 border:#ef2929", # class: 'err'16- Other: "#000000", # class 'x'17-18- Comment: "italic #8f5902", # class: 'c'19- Comment.Preproc: "noitalic", # class: 'cp'20-21- Keyword: "bold #004461", # class: 'k'22- Keyword.Constant: "bold #004461", # class: 'kc'23- Keyword.Declaration: "bold #004461", # class: 'kd'24- Keyword.Namespace: "bold #004461", # class: 'kn'25- Keyword.Pseudo: "bold #004461", # class: 'kp'26- Keyword.Reserved: "bold #004461", # class: 'kr'27- Keyword.Type: "bold #004461", # class: 'kt'28-29- Operator: "#582800", # class: 'o'30- Operator.Word: "bold #004461", # class: 'ow' - like keywords31-32- Punctuation: "bold #000000", # class: 'p'33-34- # because special names such as Name.Class, Name.Function, etc.35- # are not recognized as such later in the parsing, we choose them36- # to look the same as ordinary variables.37- Name: "#000000", # class: 'n'38- Name.Attribute: "#c4a000", # class: 'na' - to be revised39- Name.Builtin: "#004461", # class: 'nb'40- Name.Builtin.Pseudo: "#3465a4", # class: 'bp'41- Name.Class: "#000000", # class: 'nc' - to be revised42- Name.Constant: "#000000", # class: 'no' - to be revised43- Name.Decorator: "#888", # class: 'nd' - to be revised44- Name.Entity: "#ce5c00", # class: 'ni'45- Name.Exception: "bold #cc0000", # class: 'ne'46- Name.Function: "#000000", # class: 'nf'47- Name.Property: "#000000", # class: 'py'48- Name.Label: "#f57900", # class: 'nl'49- Name.Namespace: "#000000", # class: 'nn' - to be revised50- Name.Other: "#000000", # class: 'nx'51- Name.Tag: "bold #004461", # class: 'nt' - like a keyword52- Name.Variable: "#000000", # class: 'nv' - to be revised53- Name.Variable.Class: "#000000", # class: 'vc' - to be revised54- Name.Variable.Global: "#000000", # class: 'vg' - to be revised55- Name.Variable.Instance: "#000000", # class: 'vi' - to be revised56-57- Number: "#990000", # class: 'm'58-59- Literal: "#000000", # class: 'l'60- Literal.Date: "#000000", # class: 'ld'61-62- String: "#4e9a06", # class: 's'63- String.Backtick: "#4e9a06", # class: 'sb'64- String.Char: "#4e9a06", # class: 'sc'65- String.Doc: "italic #8f5902", # class: 'sd' - like a comment66- String.Double: "#4e9a06", # class: 's2'67- String.Escape: "#4e9a06", # class: 'se'68- String.Heredoc: "#4e9a06", # class: 'sh'69- String.Interpol: "#4e9a06", # class: 'si'70- String.Other: "#4e9a06", # class: 'sx'71- String.Regex: "#4e9a06", # class: 'sr'72- String.Single: "#4e9a06", # class: 's1'73- String.Symbol: "#4e9a06", # class: 'ss'74-75- Generic: "#000000", # class: 'g'76- Generic.Deleted: "#a40000", # class: 'gd'77- Generic.Emph: "italic #000000", # class: 'ge'78- Generic.Error: "#ef2929", # class: 'gr'79- Generic.Heading: "bold #000080", # class: 'gh'80- Generic.Inserted: "#00A000", # class: 'gi'81- Generic.Output: "#888", # class: 'go'82- Generic.Prompt: "#745334", # class: 'gp'83- Generic.Strong: "bold #000000", # class: 'gs'84- Generic.Subheading: "bold #800080", # class: 'gu'85- Generic.Traceback: "bold #a40000", # class: 'gt'86- }modified:docs/index.rst+1 added
4 unmodified lines5 6 .. image:: _static/logo-full.png7 :alt: Flask: web development, one drop at a time8 :class: floatingflask9+ :align: right10 11 Welcome to Flask's documentation. This documentation is divided into12 different parts. I recommend that you get started with13 :ref:`installation` and then head over to the :ref:`quickstart`.19 unmodified linesmodified:docs/make.bat+18 added-121 removed
1 @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=_build9-set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .10-if NOT "%PAPER%" == "" (11- set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%12-)12+set SPHINXPROJ=Flask13 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%/html16+%SPHINXBUILD% >NUL 2>NUL17+if errorlevel 9009 (18 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%/dirhtml19+ 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.51- echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.52- goto end24+ echo.If you don't have Sphinx installed, grab it from25+ echo.http://sphinx-doc.org/26+ exit /b 127 )28 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-)29+%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%30+goto end31 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-)32+:help33+%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%34 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-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:docs/testing.rst+2 added-5 removed
19 unmodified lines20 ---------------21 22 First, we need an application to test; we will use the application from23 the :ref:`tutorial`. If you don't have that application yet, get the24-sources from `the examples`_.24+sources from :gh:`the examples <examples/flaskr>`.25 26-.. _the examples:27- https://github.com/pallets/flask/tree/master/examples/flaskr/28-26 The Testing Skeleton27 --------------------28 29 In order to test the application, we add a second module162 unmodified lines192 suite.193 194 195 .. _MiniTwit Example:199- https://github.com/pallets/flask/tree/master/examples/minitwit/196+ https://github.com/pallets/flask/tree/0.12.3/examples/minitwit/197 198 199 Other Testing Tricks200 --------------------154 unmodified linesmodified:docs/upgrading.rst+1 added-1 removed
213 unmodified lines214 215 To apply the upgrade script do the following:216 217 1. Download the script: `flask-07-upgrade.py218- <https://raw.githubusercontent.com/pallets/flask/master/scripts/flask-07-upgrade.py>`_218+ <https://raw.githubusercontent.com/pallets/flask/0.12.3/scripts/flask-07-upgrade.py>`_219 2. Run it in the directory of your application::220 221 python flask-07-upgrade.py > patchfile.diff222 250 unmodified linesmodified:.gitignore+1 added
9 unmodified lines10 _mailinglist11 .tox12 .cache/13 .idea/14+docs/_build/15 16 # Coverage reports17 htmlcov18 .coverage2 unmodified linesdeleted:.gitmodules-3 removed
1-[submodule "docs/_themes"]2- path = docs/_themes3- url = https://github.com/mitsuhiko/flask-sphinx-themes.gitmodified:CHANGES+1 added-1 removed
522 unmodified lines523 - modules can now register for a subdomain instead of just an URL524 prefix. This makes it possible to bind a whole module to a525 configurable subdomain.526 527-.. _blinker: https://pypi.python.org/pypi/blinker527+.. _blinker: https://pypi.org/project/blinker/528 529 Version 0.5.2530 -------------531 106 unmodified lines