Skip to content
Myr

conf.py

This file

Path

docs/conf.py

314 lines · 9.8 KiB · Python

Last changed by

Merge pull request #2624 from pallets/metadataDavid Lordbefore adoption4309c7c

History of this file

Take it

The walk stopped after 200 commits: lines older than 2ab9144 point at it.

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

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.

resolve merge conflictsKenneth Reitzbefore adoption31174fe

lines 13–18why, one step back
13from __future__ import print_function
14import os15import sys16import pkg_resources17import time18import datetime

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

line 19why, one step back
19

Merge pull request #2624 from pallets/metadataDavid Lordbefore adoption4309c7c

lines 20–21why, one step back
20from sphinx.application import Sphinx
21

resolve merge conflictsKenneth Reitzbefore adoption31174fe

line 22why, one step back
22BUILD_DATE = datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

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

resolve merge conflictsKenneth Reitzbefore adoption31174fe

line 27why, one step back
27sys.path.append(os.path.dirname(__file__))

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

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

resolve merge conflictsKenneth Reitzbefore adoption31174fe

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

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

line 41why, one step back
41

resolve merge conflictsKenneth Reitzbefore adoption31174fe

lines 42–49why, one step back
42try:
43 __import__('sphinxcontrib.log_cabinet')44except ImportError:45 print('sphinxcontrib-log-cabinet is not installed.')46 print('Changelog directives will not be re-organized.')47else:48 extensions.append('sphinxcontrib.log_cabinet')49

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

lines 50–63why, one step back
50# Add any paths that contain templates here, relative to this directory.
51templates_path = ['_templates']5253# The suffix of source filenames.54source_suffix = '.rst'5556# The encoding of source files.57#source_encoding = 'utf-8-sig'5859# The master toctree document.60master_doc = 'index'6162# General information about the project.63project = u'Flask'

resolve merge conflictsKenneth Reitzbefore adoption31174fe

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

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

lines 65–71why, one step back
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.69try:70 release = pkg_resources.get_distribution('Flask').version71except pkg_resources.DistributionNotFound:

resolve merge conflictsKenneth Reitzbefore adoption31174fe

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

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

lines 74–76why, one step back
74 sys.exit(1)
7576if 'dev' in release:

resolve merge conflictsKenneth Reitzbefore adoption31174fe

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

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

lines 79–116why, one step back
79version = '.'.join(release.split('.')[:2])
8081# The language for content autogenerated by Sphinx. Refer to documentation82# for a list of supported languages.83#language = None8485# 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'9091# List of patterns, relative to source directory, that match files and92# directories to ignore when looking for source files.93exclude_patterns = ['_build']9495# The reST default role (used for this markup: `text`) to use for all documents.96#default_role = None9798# If true, '()' will be appended to :func: etc. cross-reference text.99#add_function_parentheses = True100101# If true, the current module name will be prepended to all description102# unit titles (such as .. function::).103#add_module_names = True104105# If true, sectionauthor and moduleauthor directives will be shown in the106# output. They are ignored by default.107#show_authors = False108109# A list of ignored prefixes for module index sorting.110#modindex_common_prefix = []111112113# -- Options for HTML output ---------------------------------------------------114115# The theme to use for HTML and HTML Help pages. Major themes that come with116# Sphinx are currently 'default' and 'sphinxdoc'.

resolve merge conflictsKenneth Reitzbefore adoption31174fe

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

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

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

resolve merge conflictsKenneth Reitzbefore adoption31174fe

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

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

lines 123–124why, one step back
123
124# Add any paths that contain custom themes here, relative to this directory.

Merge pull request #2080 from pallets/sphinx_themeKenneth Reitzbefore adoption4eca29f

line 125why, one step back
125# html_theme_path = ['_themes']

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

lines 126–140why, one step back
126
127# The name for this set of Sphinx documents. If None, it defaults to128# "<project> v<release> documentation".129#html_title = None130131# A shorter title for the navigation bar. Default is the same as html_title.132#html_short_title = None133134# 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 = None137138# 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.

resolve merge conflictsKenneth Reitzbefore adoption31174fe

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

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

lines 142–157why, one step back
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".146html_static_path = ['_static']147148# 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'151152# If true, SmartyPants will be used to convert quotes and dashes to153# typographically correct entities.154#html_use_smartypants = True155156# Custom sidebar templates, maps document names to template names.157html_sidebars = {

resolve merge conflictsKenneth Reitzbefore adoption31174fe

lines 158–169why, one step back
158 'index': [
159 'sidebarintro.html',160 'sourcelink.html',161 'searchbox.html'162 ],163 '**': [164 'sidebarlogo.html',165 'localtoc.html',166 'relations.html',167 'sourcelink.html',168 'searchbox.html'169 ]

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

lines 170–210why, one step back
170}
171172# Additional templates that should be rendered to pages, maps page names to173# template names.174#html_additional_pages = {}175176# If false, no module index is generated.177html_use_modindex = False178179# If false, no index is generated.180#html_use_index = True181182# If true, the index is split into individual pages for each letter.183#html_split_index = False184185# If true, links to the reST sources are added to the pages.186#html_show_sourcelink = True187188# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.189html_show_sphinx = False190191# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.192#html_show_copyright = True193194# 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 = ''198199# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").200#html_file_suffix = ''201202# Output file base name for HTML help builder.203htmlhelp_basename = 'Flaskdoc'204205206# -- Options for LaTeX output --------------------------------------------------207208# Grouping the document tree into LaTeX files. List of tuples209# (source start file, target name, title, author, documentclass [howto/manual]).210latex_documents = [

resolve merge conflictsKenneth Reitzbefore adoption31174fe

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

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

lines 212–220why, one step back
212]
213214# Documents to append as an appendix to all manuals.215#latex_appendices = []216217# If false, no module index is generated.218latex_use_modindex = False219220latex_elements = {

resolve merge conflictsKenneth Reitzbefore adoption31174fe

lines 221–224why, one step back
221 'fontpkg': r'\usepackage{mathpazo}',
222 'papersize': 'a4paper',223 'pointsize': '12pt',224 'preamble': r'\usepackage{flaskstyle}'

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

lines 225–245why, one step back
225}
226latex_use_parts = True227228latex_additional_files = ['flaskstyle.sty', 'logo.pdf']229230231# -- Options for Epub output ---------------------------------------------------232233# Bibliographic Dublin Core info.234#epub_title = ''235#epub_author = ''236#epub_publisher = ''237#epub_copyright = ''238239# The language of the text. It defaults to the language option240# or en if the language is not set.241#epub_language = ''242243# The scheme of the identifier. Typical schemes are ISBN or URL.244#epub_scheme = ''245

resolve merge conflictsKenneth Reitzbefore adoption31174fe

line 246why, one step back
246# The unique identifier of the text. This can be an ISBN number

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

lines 247–267why, one step back
247# or the project homepage.
248#epub_identifier = ''249250# A unique identification for the text.251#epub_uid = ''252253# 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 = []256257# 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 = []260261# A list of files that should not be packed into the epub file.262#epub_exclude_files = []263264# The depth of the table of contents in toc.ncx.265#epub_tocdepth = 3266267intersphinx_mapping = {

resolve merge conflictsKenneth Reitzbefore adoption31174fe

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

fix linksDavid Lordbefore adoption97ad085

line 272why, one step back
272 'itsdangerous': ('https://pythonhosted.org/itsdangerous', None),

resolve merge conflictsKenneth Reitzbefore adoption31174fe

lines 273–274why, one step back
273 'sqlalchemy': ('https://docs.sqlalchemy.org/en/latest/', None),
274 'wtforms': ('https://wtforms.readthedocs.io/en/latest/', None),

fix linksDavid Lordbefore adoption97ad085

line 275why, one step back
275 'blinker': ('https://pythonhosted.org/blinker/', None),

Merge pull request #1237 from Winnetou/patch-3Markus Unterwaditzerbefore adoption2ab9144

lines 276–277why, one step back
276}
277

use alabasterKenneth Reitzbefore adoption386ac92

lines 278–280why, one step back
278html_theme_options = {
279 'touch_icon': 'touch-icon.png'280}

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

lines 281–300why, one step back
281
282# unwrap decorators283def unwrap_decorators():284 import sphinx.util.inspect as inspect285 import functools286287 old_getargspec = inspect.getargspec288 def getargspec(x):289 return old_getargspec(getattr(x, '_original_function', x))290 inspect.getargspec = getargspec291292 old_update_wrapper = functools.update_wrapper293 def update_wrapper(wrapper, wrapped, *a, **kw):294 rv = old_update_wrapper(wrapper, wrapped, *a, **kw)295 rv._original_function = wrapped296 return rv297 functools.update_wrapper = update_wrapper298299unwrap_decorators()300del unwrap_decorators

Merge pull request #2624 from pallets/metadataDavid Lordbefore adoption4309c7c

lines 301–314why, one step back
301
302303def setup(app: Sphinx):304 def cut_module_meta(app, what, name, obj, options, lines):305 """Remove metadata from autodoc output."""306 if what != 'module':307 return308309 lines[:] = [310 line for line in lines311 if not line.startswith((':copyright:', ':license:'))312 ]313314 app.connect('autodoc-process-docstring', cut_module_meta)