Merge pull request #3376 from pallets/migrate-docs
Before adoption: this commit came in with the history the project adopted, so no landing records it.
update docs for new theme
authored by David Lord · committed by GitHub · parents 1c2a2cd, 4ed2065 · Browse files · 15 files·+65 added−135 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
15 files+65 added−135 removed
- other:+65 added−135 removed
Provenance
- Commit
e007949- Tree
d921c57- Author
David Lord <davidism@gmail.com>- Committer
GitHub <noreply@github.com>- Parent 1
1c2a2cd- Parent 2
4ed2065
15 files changed+65 added−135 removed
modified:docs/_static/debugger.pngbinary
A binary file, modified.
deleted:docs/_static/flask-favicon.icobinary
A binary file, deleted.
added:docs/_static/flask-icon.pngbinary
A binary file, added.
added:docs/_static/flask-logo.pngbinary
A binary file, added.
deleted:docs/_static/flask.pngbinary
A binary file, deleted.
deleted:docs/_static/logo-full.pngbinary
A binary file, deleted.
modified:docs/_static/no.pngbinary
A binary file, modified.
added:docs/_static/pycharm-runconfig.pngbinary
A binary file, added.
deleted:docs/_static/touch-icon.pngbinary
A binary file, deleted.
modified:docs/_static/yes.pngbinary
A binary file, modified.
modified:docs/conf.py+48 added-122 removed
1-# -*- coding: utf-8 -*-2-from __future__ import print_function1+import packaging.version2+from pallets_sphinx_themes import get_version3+from pallets_sphinx_themes import ProjectLink4 4-import inspect5-import re6-7-from pallets_sphinx_themes import ProjectLink, get_version8-5 # Project --------------------------------------------------------------6 11-project = 'Flask'12-copyright = '2010 Pallets Team'13-author = 'Pallets Team'14-release, version = get_version('Flask')7+project = "Flask"8+copyright = "2010 Pallets"9+author = "Pallets"10+release, version = get_version("Flask")11 12 # General --------------------------------------------------------------13 18-master_doc = 'index'19-14+master_doc = "index"15 extensions = [21- 'sphinx.ext.autodoc',22- 'sphinx.ext.intersphinx',23- 'sphinxcontrib.log_cabinet',16+ "sphinx.ext.autodoc",17+ "sphinx.ext.intersphinx",18+ "sphinxcontrib.log_cabinet",19+ "pallets_sphinx_themes",20+ "sphinx_issues",21 ]25-22 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),23+ "python": ("https://docs.python.org/3/", None),24+ "werkzeug": ("https://werkzeug.palletsprojects.com/", None),25+ "click": ("https://click.palletsprojects.com/", None),26+ "jinja": ("http://jinja.pocoo.org/docs/", None),27+ "itsdangerous": ("https://itsdangerous.palletsprojects.com/", None),28+ "sqlalchemy": ("https://docs.sqlalchemy.org/", None),29+ "wtforms": ("https://wtforms.readthedocs.io/en/stable/", None),30+ "blinker": ("https://pythonhosted.org/blinker/", None),31 }32+issues_github_path = "pallets/flask"33 34 # HTML -----------------------------------------------------------------35 39-html_theme = 'flask'36+html_theme = "flask"37+html_theme_options = {"index_sidebar_logo": False}38 html_context = {41- 'project_links': [42- ProjectLink('Donate to Pallets', 'https://psfmember.org/civicrm/contribute/transact?reset=1&id=20'),43- ProjectLink('Flask Website', 'https://palletsprojects.com/p/flask/'),44- ProjectLink('PyPI releases', 'https://pypi.org/project/Flask/'),45- ProjectLink('Source Code', 'https://github.com/pallets/flask/'),46- ProjectLink(47- 'Issue Tracker', 'https://github.com/pallets/flask/issues/'),48- ],49- 'canonical_url': 'http://flask.pocoo.org/docs/{}/'.format(version),50- 'carbon_ads_args': 'zoneid=1673&serve=C6AILKT&placement=pocooorg',39+ "project_links": [40+ ProjectLink("Donate to Pallets", "https://palletsprojects.com/donate"),41+ ProjectLink("Flask Website", "https://palletsprojects.com/p/flask/"),42+ ProjectLink("PyPI releases", "https://pypi.org/project/Flask/"),43+ ProjectLink("Source Code", "https://github.com/pallets/flask/"),44+ ProjectLink("Issue Tracker", "https://github.com/pallets/flask/issues/"),45+ ]46 }47 html_sidebars = {53- 'index': [54- 'project.html',55- 'versions.html',56- 'carbon_ads.html',57- 'searchbox.html',58- ],59- '**': [60- 'localtoc.html',61- 'relations.html',62- 'versions.html',63- 'carbon_ads.html',64- 'searchbox.html',65- ]48+ "index": ["project.html", "localtoc.html", "searchbox.html"],49+ "**": ["localtoc.html", "relations.html", "searchbox.html"],50 }67-html_static_path = ['_static']68-html_favicon = '_static/flask-favicon.ico'69-html_logo = '_static/flask.png'70-html_additional_pages = {71- '404': '404.html',72-}51+singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}52+html_static_path = ["_static"]53+html_favicon = "_static/flask-icon.png"54+html_logo = "_static/flask-icon.png"55+html_title = "Flask Documentation ({})".format(version)56 html_show_sourcelink = False57 58 # LaTeX ----------------------------------------------------------------59 60 latex_documents = [78- (master_doc, 'Flask.tex', 'Flask Documentation', 'Pallets Team', 'manual'),61+ (master_doc, "Flask-{}.tex".format(version), html_title, author, "manual")62 ]80-latex_use_modindex = False81-latex_elements = {82- 'papersize': 'a4paper',83- 'pointsize': '12pt',84- 'fontpkg': r'\usepackage{mathpazo}',85- 'preamble': r'\usepackage{flaskstyle}',86-}87-latex_use_parts = True88-latex_additional_files = ['flaskstyle.sty', 'logo.pdf']63 90-# linkcheck ------------------------------------------------------------91-92-linkcheck_anchors = False93-64 # Local Extensions -----------------------------------------------------65 96-def unwrap_decorators():97- import sphinx.util.inspect as inspect98- import functools66 100- old_getargspec = inspect.getargspec101- def getargspec(x):102- return old_getargspec(getattr(x, '_original_function', x))103- inspect.getargspec = getargspec104-105- old_update_wrapper = functools.update_wrapper106- def update_wrapper(wrapper, wrapped, *a, **kw):107- rv = old_update_wrapper(wrapper, wrapped, *a, **kw)108- rv._original_function = wrapped109- return rv110- functools.update_wrapper = update_wrapper111-112-113-unwrap_decorators()114-del unwrap_decorators115-116-117-_internal_mark_re = re.compile(r'^\s*:internal:\s*$(?m)', re.M)118-119-120-def skip_internal(app, what, name, obj, skip, options):121- docstring = inspect.getdoc(obj) or ''122-123- if skip or _internal_mark_re.search(docstring) is not None:124- return True125-126-127-def cut_module_meta(app, what, name, obj, options, lines):128- """Remove metadata from autodoc output."""129- if what != 'module':130- return131-132- lines[:] = [133- line for line in lines134- if not line.startswith((':copyright:', ':license:'))135- ]136-137-138-def github_link(139- name, rawtext, text, lineno, inliner, options=None, content=None140-):67+def github_link(name, rawtext, text, lineno, inliner, options=None, content=None):68 app = inliner.document.settings.env.app69 release = app.config.release143- base_url = 'https://github.com/pallets/flask/tree/'70+ base_url = "https://github.com/pallets/flask/tree/"71 145- if text.endswith('>'):146- words, text = text[:-1].rsplit('<', 1)72+ if text.endswith(">"):73+ words, text = text[:-1].rsplit("<", 1)74 words = words.strip()75 else:76 words = None77 151- if release.endswith('dev'):152- url = '{0}master/{1}'.format(base_url, text)78+ if packaging.version.parse(release).is_devrelease:79+ url = "{0}master/{1}".format(base_url, text)80 else:154- url = '{0}{1}/{2}'.format(base_url, release, text)81+ url = "{0}{1}/{2}".format(base_url, release, text)82 83 if words is None:84 words = url85 86 from docutils.nodes import reference87 from docutils.parsers.rst.roles import set_classes88+89 options = options or {}90 set_classes(options)91 node = reference(rawtext, words, refuri=url, **options)92 return [node], []93 94 95 def setup(app):168- app.connect('autodoc-skip-member', skip_internal)169- app.connect('autodoc-process-docstring', cut_module_meta)170- app.add_role('gh', github_link)96+ app.add_role("gh", github_link)modified:docs/index.rst+5 added-5 removed
1-:orphan:1+.. rst-class:: hide-header2 3 Welcome to Flask4 ================5 6-.. image:: _static/logo-full.png7- :alt: Flask: web development, one drop at a time8- :class: floatingflask9- :align: right6+.. image:: _static/flask-logo.png7+ :alt: Flask: web development, one drop at a time8+ :align: center9+ :target: https://palletsprojects.com/p/flask/10 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+2 added-3 removed
7 unmodified lines8 set SPHINXBUILD=sphinx-build9 )10 set SOURCEDIR=.11 set BUILDDIR=_build12-set SPHINXPROJ=Flask12 13 if "%1" == "" goto help14 15 %SPHINXBUILD% >NUL 2>NUL8 unmodified lines24 echo.http://sphinx-doc.org/25 exit /b 126 )27 29-%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%28+%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%29 goto end30 31 :help33-%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%32+%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%33 34 :end35 popdmodified:docs/Makefile+5 added-5 removed
1 # Minimal makefile for Sphinx documentation2 #3 4-# You can set these variables from the command line.5-SPHINXOPTS =6-SPHINXBUILD = sphinx-build7-SPHINXPROJ = Flask4+# You can set these variables from the command line, and also5+# from the environment for the first two.6+SPHINXOPTS ?=7+SPHINXBUILD ?= sphinx-build8 SOURCEDIR = .9 BUILDDIR = _build10 11 # Put it first so that "make" without argument is like "make help".4 unmodified lines16 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)20+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)added:docs/requirements.txt+5 added
1+Sphinx~=2.2.02+Pallets-Sphinx-Themes~=1.2.23+sphinxcontrib-log-cabinet~=1.0.14+sphinx-issues~=1.2.05+packaging~=19.2