Skip to content
Myr

conf.py

This file

Path

docs/conf.py

302 lines · 9.5 KiB · Python

Last changed by

Merge pull request #2149 from onovy/masterDavid Lordbefore adoption6c9ff85

History of this file

Take it

The walk stopped after 200 commits: lines older than 7df543d point at it.

Merge pull request #1703 from jeffwidman/masterDavid Lordbefore adoption7df543d

lines 1–12why, one step back
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.

fix some warnings while building docsDavid Lordbefore adoption317d603

line 13why, one step back
13from __future__ import print_function

clean up code formatting in some docsDavid Lordbefore adoption1928f28

lines 14–16why, one step back
14import os
15import sys16import pkg_resources

Merge pull request #2149 from onovy/masterDavid Lordbefore adoption6c9ff85

lines 17–18why, one step back
17import time
18import datetime

Merge pull request #1703 from jeffwidman/masterDavid Lordbefore adoption7df543d

line 19why, one step back
19

Merge pull request #2149 from onovy/masterDavid Lordbefore adoption6c9ff85

lines 20–21why, one step back
20BUILD_DATE = datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))
21

Merge pull request #1703 from jeffwidman/masterDavid Lordbefore adoption7df543d

lines 22–24why, one step back
22# If extensions (or modules to document with autodoc) are in another directory,
23# add these directories to sys.path here. If the directory is relative to the24# documentation root, use os.path.abspath to make it absolute, like shown here.

clean up code formatting in some docsDavid Lordbefore adoption1928f28

lines 25–26why, one step back
25sys.path.append(os.path.join(os.path.dirname(__file__), '_themes'))
26sys.path.append(os.path.dirname(__file__))

Merge pull request #1703 from jeffwidman/masterDavid Lordbefore adoption7df543d

lines 27–34why, one step back
27
28# -- General configuration -----------------------------------------------------2930# If your documentation needs a minimal Sphinx version, state it here.31#needs_sphinx = '1.0'3233# Add any Sphinx extension module names here, as strings. They can be extensions34# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.

fix some warnings while building docsDavid Lordbefore adoption317d603

lines 35–39why, one step back
35extensions = [
36 'sphinx.ext.autodoc',37 'sphinx.ext.intersphinx',38 'flaskdocext'39]

Merge pull request #1703 from jeffwidman/masterDavid Lordbefore adoption7df543d

lines 40–54why, one step back
40
41# Add any paths that contain templates here, relative to this directory.42templates_path = ['_templates']4344# The suffix of source filenames.45source_suffix = '.rst'4647# The encoding of source files.48#source_encoding = 'utf-8-sig'4950# The master toctree document.51master_doc = 'index'5253# General information about the project.54project = u'Flask'

Merge pull request #2149 from onovy/masterDavid Lordbefore adoption6c9ff85

line 55why, one step back
55copyright = u'2010 - {0}, Armin Ronacher'.format(BUILD_DATE.year)

Merge pull request #1703 from jeffwidman/masterDavid Lordbefore adoption7df543d

lines 56–62why, one step back
56
57# The version info for the project you're documenting, acts as replacement for58# |version| and |release|, also used in various other places throughout the59# built documents.60try:61 release = pkg_resources.get_distribution('Flask').version62except pkg_resources.DistributionNotFound:

fix some warnings while building docsDavid Lordbefore adoption317d603

lines 63–64why, one step back
63 print('Flask must be installed to build the documentation.')
64 print('Install from source using `pip install -e .` in a virtualenv.')

Merge pull request #1703 from jeffwidman/masterDavid Lordbefore adoption7df543d

lines 65–67why, one step back
65 sys.exit(1)
6667if 'dev' in release:

clean up code formatting in some docsDavid Lordbefore adoption1928f28

lines 68–69why, one step back
68 release = ''.join(release.partition('dev')[:2])
69

Merge pull request #1703 from jeffwidman/masterDavid Lordbefore adoption7df543d

lines 70–107why, one step back
70version = '.'.join(release.split('.')[:2])
7172# The language for content autogenerated by Sphinx. Refer to documentation73# for a list of supported languages.74#language = None7576# There are two options for replacing |today|: either, you set today to some77# non-false value, then it is used:78#today = ''79# Else, today_fmt is used as the format for a strftime call.80#today_fmt = '%B %d, %Y'8182# List of patterns, relative to source directory, that match files and83# directories to ignore when looking for source files.84exclude_patterns = ['_build']8586# The reST default role (used for this markup: `text`) to use for all documents.87#default_role = None8889# If true, '()' will be appended to :func: etc. cross-reference text.90#add_function_parentheses = True9192# If true, the current module name will be prepended to all description93# unit titles (such as .. function::).94#add_module_names = True9596# If true, sectionauthor and moduleauthor directives will be shown in the97# output. They are ignored by default.98#show_authors = False99100# A list of ignored prefixes for module index sorting.101#modindex_common_prefix = []102103104# -- Options for HTML output ---------------------------------------------------105106# The theme to use for HTML and HTML Help pages. Major themes that come with107# Sphinx are currently 'default' and 'sphinxdoc'.

clean up code formatting in some docsDavid Lordbefore adoption1928f28

line 108why, one step back
108# html_theme = 'default'

Merge pull request #1703 from jeffwidman/masterDavid Lordbefore adoption7df543d

lines 109–112why, one step back
109
110# Theme options are theme-specific and customize the look and feel of a theme111# further. For a list of options available for each theme, see the112# documentation.

clean up code formatting in some docsDavid Lordbefore adoption1928f28

line 113why, one step back
113# html_theme_options = {}

Merge pull request #1703 from jeffwidman/masterDavid Lordbefore adoption7df543d

lines 114–131why, one step back
114
115# Add any paths that contain custom themes here, relative to this directory.116html_theme_path = ['_themes']117118# The name for this set of Sphinx documents. If None, it defaults to119# "<project> v<release> documentation".120#html_title = None121122# A shorter title for the navigation bar. Default is the same as html_title.123#html_short_title = None124125# The name of an image file (relative to this directory) to place at the top126# of the sidebar. Do not set, template magic!127#html_logo = None128129# The name of an image file (within the static path) to use as favicon of the130# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32131# pixels large.

clean up code formatting in some docsDavid Lordbefore adoption1928f28

line 132why, one step back
132html_favicon = '_static/flask-favicon.ico'

Merge pull request #1703 from jeffwidman/masterDavid Lordbefore adoption7df543d

lines 133–148why, one step back
133
134# Add any paths that contain custom static files (such as style sheets) here,135# relative to this directory. They are copied after the builtin static files,136# so a file named "default.css" will overwrite the builtin "default.css".137html_static_path = ['_static']138139# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,140# using the given strftime format.141#html_last_updated_fmt = '%b %d, %Y'142143# If true, SmartyPants will be used to convert quotes and dashes to144# typographically correct entities.145#html_use_smartypants = True146147# Custom sidebar templates, maps document names to template names.148html_sidebars = {

clean up code formatting in some docsDavid Lordbefore adoption1928f28

lines 149–160why, one step back
149 'index': [
150 'sidebarintro.html',151 'sourcelink.html',152 'searchbox.html'153 ],154 '**': [155 'sidebarlogo.html',156 'localtoc.html',157 'relations.html',158 'sourcelink.html',159 'searchbox.html'160 ]

Merge pull request #1703 from jeffwidman/masterDavid Lordbefore adoption7df543d

lines 161–201why, one step back
161}
162163# Additional templates that should be rendered to pages, maps page names to164# template names.165#html_additional_pages = {}166167# If false, no module index is generated.168html_use_modindex = False169170# If false, no index is generated.171#html_use_index = True172173# If true, the index is split into individual pages for each letter.174#html_split_index = False175176# If true, links to the reST sources are added to the pages.177#html_show_sourcelink = True178179# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.180html_show_sphinx = False181182# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.183#html_show_copyright = True184185# If true, an OpenSearch description file will be output, and all pages will186# contain a <link> tag referring to it. The value of this option must be the187# base URL from which the finished HTML is served.188#html_use_opensearch = ''189190# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").191#html_file_suffix = ''192193# Output file base name for HTML help builder.194htmlhelp_basename = 'Flaskdoc'195196197# -- Options for LaTeX output --------------------------------------------------198199# Grouping the document tree into LaTeX files. List of tuples200# (source start file, target name, title, author, documentclass [howto/manual]).201latex_documents = [

clean up code formatting in some docsDavid Lordbefore adoption1928f28

line 202why, one step back
202 ('latexindex', 'Flask.tex', u'Flask Documentation', u'Armin Ronacher', 'manual'),

Merge pull request #1703 from jeffwidman/masterDavid Lordbefore adoption7df543d

lines 203–211why, one step back
203]
204205# Documents to append as an appendix to all manuals.206#latex_appendices = []207208# If false, no module index is generated.209latex_use_modindex = False210211latex_elements = {

clean up code formatting in some docsDavid Lordbefore adoption1928f28

lines 212–215why, one step back
212 'fontpkg': r'\usepackage{mathpazo}',
213 'papersize': 'a4paper',214 'pointsize': '12pt',215 'preamble': r'\usepackage{flaskstyle}'

Merge pull request #1703 from jeffwidman/masterDavid Lordbefore adoption7df543d

lines 216–258why, one step back
216}
217latex_use_parts = True218219latex_additional_files = ['flaskstyle.sty', 'logo.pdf']220221222# -- Options for Epub output ---------------------------------------------------223224# Bibliographic Dublin Core info.225#epub_title = ''226#epub_author = ''227#epub_publisher = ''228#epub_copyright = ''229230# The language of the text. It defaults to the language option231# or en if the language is not set.232#epub_language = ''233234# The scheme of the identifier. Typical schemes are ISBN or URL.235#epub_scheme = ''236237# The unique identifier of the text. This can be a ISBN number238# or the project homepage.239#epub_identifier = ''240241# A unique identification for the text.242#epub_uid = ''243244# HTML files that should be inserted before the pages created by sphinx.245# The format is a list of tuples containing the path and title.246#epub_pre_files = []247248# HTML files shat should be inserted after the pages created by sphinx.249# The format is a list of tuples containing the path and title.250#epub_post_files = []251252# A list of files that should not be packed into the epub file.253#epub_exclude_files = []254255# The depth of the table of contents in toc.ncx.256#epub_tocdepth = 3257258intersphinx_mapping = {

clean up code formatting in some docsDavid Lordbefore adoption1928f28

lines 259–265why, one step back
259 'python': ('https://docs.python.org/3/', None),
260 'werkzeug': ('http://werkzeug.pocoo.org/docs/', None),261 'click': ('http://click.pocoo.org/', None),262 'jinja': ('http://jinja.pocoo.org/docs/', None),263 'sqlalchemy': ('http://docs.sqlalchemy.org/en/latest/', None),264 'wtforms': ('https://wtforms.readthedocs.io/en/latest/', None),265 'blinker': ('https://pythonhosted.org/blinker/', None)

Merge pull request #1703 from jeffwidman/masterDavid Lordbefore adoption7df543d

lines 266–269why, one step back
266}
267268try:269 __import__('flask_theme_support')

clean up code formatting in some docsDavid Lordbefore adoption1928f28

lines 270–275why, one step back
270 pygments_style = 'flask_theme_support.FlaskyStyle'
271 html_theme = 'flask'272 html_theme_options = {273 'touch_icon': 'touch-icon.png'274 }275except ImportError:

fix some warnings while building docsDavid Lordbefore adoption317d603

lines 276–281why, one step back
276 print('-' * 74)
277 print('Warning: Flask themes unavailable. Building with default theme')278 print('If you want the Flask themes, run this command and build again:')279 print()280 print(' git submodule update --init')281 print('-' * 74)

Merge pull request #1703 from jeffwidman/masterDavid Lordbefore adoption7df543d

lines 282–302why, one step back
282
283284# unwrap decorators285def unwrap_decorators():286 import sphinx.util.inspect as inspect287 import functools288289 old_getargspec = inspect.getargspec290 def getargspec(x):291 return old_getargspec(getattr(x, '_original_function', x))292 inspect.getargspec = getargspec293294 old_update_wrapper = functools.update_wrapper295 def update_wrapper(wrapper, wrapped, *a, **kw):296 rv = old_update_wrapper(wrapper, wrapped, *a, **kw)297 rv._original_function = wrapped298 return rv299 functools.update_wrapper = update_wrapper300301unwrap_decorators()302del unwrap_decorators