Skip to content
Myr

conf.py

This file

Path

docs/conf.py

299 lines · 9.4 KiB · Python

Last changed by

clean up code formatting in some docsDavid Lordbefore adoption1928f28

History of this file

Take it

The walk stopped after 200 commits: lines older than 86e8267 point at it.

Merge pull request #1378 from cbron/masterKeyan Pishdadianbefore adoption86e8267

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–17why, one step back
14from datetime import datetime
15import os16import sys17import pkg_resources

Merge pull request #1378 from cbron/masterKeyan Pishdadianbefore adoption86e8267

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

clean up code formatting in some docsDavid Lordbefore adoption1928f28

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

Merge pull request #1378 from cbron/masterKeyan Pishdadianbefore adoption86e8267

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

fix some warnings while building docsDavid Lordbefore adoption317d603

lines 32–36why, one step back
32extensions = [
33 'sphinx.ext.autodoc',34 'sphinx.ext.intersphinx',35 'flaskdocext'36]

Merge pull request #1378 from cbron/masterKeyan Pishdadianbefore adoption86e8267

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

clean up code formatting in some docsDavid Lordbefore adoption1928f28

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

Merge pull request #1378 from cbron/masterKeyan Pishdadianbefore adoption86e8267

lines 53–59why, one step back
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.57try:58 release = pkg_resources.get_distribution('Flask').version59except pkg_resources.DistributionNotFound:

fix some warnings while building docsDavid Lordbefore adoption317d603

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

Merge pull request #1378 from cbron/masterKeyan Pishdadianbefore adoption86e8267

lines 62–64why, one step back
62 sys.exit(1)
6364if 'dev' in release:

clean up code formatting in some docsDavid Lordbefore adoption1928f28

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

Merge pull request #1378 from cbron/masterKeyan Pishdadianbefore adoption86e8267

lines 67–104why, one step back
67version = '.'.join(release.split('.')[:2])
6869# The language for content autogenerated by Sphinx. Refer to documentation70# for a list of supported languages.71#language = None7273# 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'7879# List of patterns, relative to source directory, that match files and80# directories to ignore when looking for source files.81exclude_patterns = ['_build']8283# The reST default role (used for this markup: `text`) to use for all documents.84#default_role = None8586# If true, '()' will be appended to :func: etc. cross-reference text.87#add_function_parentheses = True8889# If true, the current module name will be prepended to all description90# unit titles (such as .. function::).91#add_module_names = True9293# If true, sectionauthor and moduleauthor directives will be shown in the94# output. They are ignored by default.95#show_authors = False9697# A list of ignored prefixes for module index sorting.98#modindex_common_prefix = []99100101# -- Options for HTML output ---------------------------------------------------102103# The theme to use for HTML and HTML Help pages. Major themes that come with104# Sphinx are currently 'default' and 'sphinxdoc'.

clean up code formatting in some docsDavid Lordbefore adoption1928f28

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

Merge pull request #1378 from cbron/masterKeyan Pishdadianbefore adoption86e8267

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

clean up code formatting in some docsDavid Lordbefore adoption1928f28

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

Merge pull request #1378 from cbron/masterKeyan Pishdadianbefore adoption86e8267

lines 111–128why, one step back
111
112# Add any paths that contain custom themes here, relative to this directory.113html_theme_path = ['_themes']114115# The name for this set of Sphinx documents. If None, it defaults to116# "<project> v<release> documentation".117#html_title = None118119# A shorter title for the navigation bar. Default is the same as html_title.120#html_short_title = None121122# 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 = None125126# 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.

clean up code formatting in some docsDavid Lordbefore adoption1928f28

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

Merge pull request #1378 from cbron/masterKeyan Pishdadianbefore adoption86e8267

lines 130–145why, one step back
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".134html_static_path = ['_static']135136# 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'139140# If true, SmartyPants will be used to convert quotes and dashes to141# typographically correct entities.142#html_use_smartypants = True143144# Custom sidebar templates, maps document names to template names.145html_sidebars = {

clean up code formatting in some docsDavid Lordbefore adoption1928f28

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

Merge pull request #1378 from cbron/masterKeyan Pishdadianbefore adoption86e8267

lines 158–198why, one step back
158}
159160# Additional templates that should be rendered to pages, maps page names to161# template names.162#html_additional_pages = {}163164# If false, no module index is generated.165html_use_modindex = False166167# If false, no index is generated.168#html_use_index = True169170# If true, the index is split into individual pages for each letter.171#html_split_index = False172173# If true, links to the reST sources are added to the pages.174#html_show_sourcelink = True175176# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.177html_show_sphinx = False178179# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.180#html_show_copyright = True181182# 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 = ''186187# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").188#html_file_suffix = ''189190# Output file base name for HTML help builder.191htmlhelp_basename = 'Flaskdoc'192193194# -- Options for LaTeX output --------------------------------------------------195196# Grouping the document tree into LaTeX files. List of tuples197# (source start file, target name, title, author, documentclass [howto/manual]).198latex_documents = [

clean up code formatting in some docsDavid Lordbefore adoption1928f28

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

Merge pull request #1378 from cbron/masterKeyan Pishdadianbefore adoption86e8267

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

clean up code formatting in some docsDavid Lordbefore adoption1928f28

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

Merge pull request #1378 from cbron/masterKeyan Pishdadianbefore adoption86e8267

lines 213–255why, one step back
213}
214latex_use_parts = True215216latex_additional_files = ['flaskstyle.sty', 'logo.pdf']217218219# -- Options for Epub output ---------------------------------------------------220221# Bibliographic Dublin Core info.222#epub_title = ''223#epub_author = ''224#epub_publisher = ''225#epub_copyright = ''226227# The language of the text. It defaults to the language option228# or en if the language is not set.229#epub_language = ''230231# The scheme of the identifier. Typical schemes are ISBN or URL.232#epub_scheme = ''233234# The unique identifier of the text. This can be a ISBN number235# or the project homepage.236#epub_identifier = ''237238# A unique identification for the text.239#epub_uid = ''240241# 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 = []244245# 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 = []248249# A list of files that should not be packed into the epub file.250#epub_exclude_files = []251252# The depth of the table of contents in toc.ncx.253#epub_tocdepth = 3254255intersphinx_mapping = {

clean up code formatting in some docsDavid Lordbefore adoption1928f28

lines 256–262why, one step back
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)

Merge pull request #1378 from cbron/masterKeyan Pishdadianbefore adoption86e8267

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

clean up code formatting in some docsDavid Lordbefore adoption1928f28

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

fix some warnings while building docsDavid Lordbefore adoption317d603

lines 273–278why, one step back
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)

Merge pull request #1483 from untitaker/improve-autodocMarkus Unterwaditzerbefore adoption5c68b24

lines 279–299why, one step back
279
280281# unwrap decorators282def unwrap_decorators():283 import sphinx.util.inspect as inspect284 import functools285286 old_getargspec = inspect.getargspec287 def getargspec(x):288 return old_getargspec(getattr(x, '_original_function', x))289 inspect.getargspec = getargspec290291 old_update_wrapper = functools.update_wrapper292 def update_wrapper(wrapper, wrapped, *a, **kw):293 rv = old_update_wrapper(wrapper, wrapped, *a, **kw)294 rv._original_function = wrapped295 return rv296 functools.update_wrapper = update_wrapper297298unwrap_decorators()299del unwrap_decorators