Merge branch '2.x' into 3.x
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parents 2cb7606, 7062f1e · Browse files · 21 files·+82 added−1246 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
21 files+82 added−1246 removed
- other:+82 added−1246 removed
Provenance
- Commit
85c18d7- Tree
9df5ff0- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent 1
2cb7606- Parent 2
7062f1e
21 files changed+82 added−1246 removed
added:docs/_static/click-icon.pngbinary
A binary file, added.
added:docs/_static/click-logo-sidebar.pngbinary
A binary file, added.
added:docs/_static/click-logo.pngbinary
A binary file, added.
deleted:docs/_static/click-small.pngbinary
A binary file, deleted.
deleted:docs/_static/click-small@2x.pngbinary
A binary file, deleted.
deleted:docs/_static/click.pngbinary
A binary file, deleted.
deleted:docs/_static/click@2x.pngbinary
A binary file, deleted.
deleted:docs/_templates/sidebarintro.html-13 removed
12345678910111213<h3>About</h3><p> Click is a Python package for creating beautiful command line interfaces in a composable way with as little amount of code as necessary. It’s the “Command Line Interface Creation Kit”.</p><h3>Useful Links</h3><ul> <li><a href="http://click.pocoo.org/">The Click Website</a></li> <li><a href="http://pypi.python.org/pypi/click">click @ PyPI</a></li> <li><a href="http://github.com/mitsuhiko/click">click @ github</a></li> <li><a href="http://github.com/mitsuhiko/click/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/click-small@2x.png', 1) }}" width="120" height="50" alt="Logo"></a></p>deleted:docs/_themes/click/static/click.css_t-403 removed
1-/*2- * click.css_t3- * ~~~~~~~~~~~4- *5- * :copyright: Copyright 2014 by Armin Ronacher.6- * :license: Flask Design License, see LICENSE for details.7- */8-9-{% set page_width = '940px' %}10-{% set sidebar_width = '220px' %}11- 12-@import url("basic.css");13-14-@import url(http://fonts.googleapis.com/css?family=Ubuntu+Mono:400,400italic,700,700italic);15-@import url(http://fonts.googleapis.com/css?family=Open+Sans:300,400);16- 17-/* -- page layout ----------------------------------------------------------- */18- 19-body {20- font-family: 'Ubuntu Mono', 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono';21- font-size: 15px;22- background-color: white;23- color: #000;24- margin: 0;25- padding: 0;26-}27-28-div.document {29- width: {{ page_width }};30- margin: 30px auto 0 auto;31-}32-33-div.documentwrapper {34- float: left;35- width: 100%;36-}37-38-div.bodywrapper {39- margin: 0 0 0 {{ sidebar_width }};40-}41-42-div.sphinxsidebar {43- width: {{ sidebar_width }};44-}45-46-div.sphinxsidebar h3,47-div.sphinxsidebar h4 {48- font-family: 'Open Sans', 'Helvetica', 'Arial', sans-serif;49- font-weight: 300;50- margin: 20px 0px 10px 0px;51- padding: 0;52-}53-54-hr {55- border: 1px solid #B1B4B6;56-}57- 58-div.body {59- background-color: #ffffff;60- color: #3E4349;61- padding: 0 30px 0 30px;62-}63-64-img.floatingflask {65- padding: 0 0 10px 10px;66- float: right;67-}68- 69-div.footer {70- width: {{ page_width }};71- margin: 20px auto 30px auto;72- font-size: 14px;73- color: #888;74- text-align: right;75-}76-77-div.footer a {78- color: #888;79-}80-81-div.related {82- display: none;83-}84- 85-div.sphinxsidebar a {86- color: #444;87- text-decoration: none;88- border-bottom: 1px dotted #999;89-}90-91-div.sphinxsidebar a:hover {92- border-bottom: 1px solid #999;93-}94- 95-div.sphinxsidebar {96- font-size: 14px;97- line-height: 1.5;98-}99-100-div.sphinxsidebarwrapper {101- padding: 18px 10px;102-}103-104-div.sphinxsidebarwrapper p.logo {105- padding: 0 0 20px 0;106- margin: 0;107- text-align: left;108-}109- 110-div.sphinxsidebar h3,111-div.sphinxsidebar h4 {112- color: #444;113- font-size: 18px;114- font-weight: normal;115- margin: 0 0 5px 0;116- padding: 0;117-}118-119-div.sphinxsidebar h4 {120- font-size: 15px;121-}122- 123-div.sphinxsidebar h3 a {124- color: #444;125-}126-127-div.sphinxsidebar p.logo a,128-div.sphinxsidebar h3 a,129-div.sphinxsidebar p.logo a:hover,130-div.sphinxsidebar h3 a:hover {131- border: none;132-}133- 134-div.sphinxsidebar p {135- color: #555;136- margin: 10px 0;137-}138-139-div.sphinxsidebar ul {140- margin: 10px 0;141- padding: 0;142- color: #000;143-}144- 145-div.sphinxsidebar input {146- border: 1px solid #ccc;147- font-family: 'Ubuntu Mono', 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono';148- font-size: 13px;149-}150-151-div.sphinxsidebar #searchbox input[type="text"] {152- width: 120px;153-}154- 155-/* -- body styles ----------------------------------------------------------- */156- 157-a {158- color: #5D2CD1;159- text-decoration: underline;160-}161- 162-a:hover {163- color: #7546E3;164- text-decoration: underline;165-}166- 167-div.body h1,168-div.body h2,169-div.body h3,170-div.body h4,171-div.body h5,172-div.body h6 {173- font-family: 'Open Sans', 'Helvetica', 'Arial', sans-serif;174- font-weight: 400;175- margin: 30px 0px 10px 0px;176- padding: 0;177-}178-179-div.indexwrapper h1 {180- text-indent: -999999px;181- background: url(click.png) no-repeat center center;182- height: 200px;183-}184-185-@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {186- div.indexwrapper h1 {187- background: url(click@2x.png) no-repeat center center;188- background-size: 420px 175px;189- }190-}191-192-div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; }193-div.body h2 { font-size: 180%; }194-div.body h3 { font-size: 150%; }195-div.body h4 { font-size: 130%; }196-div.body h5 { font-size: 100%; }197-div.body h6 { font-size: 100%; }198- 199-a.headerlink {200- color: #ddd;201- padding: 0 4px;202- text-decoration: none;203-}204- 205-a.headerlink:hover {206- color: #444;207- background: #eaeaea;208-}209- 210-div.body p, div.body dd, div.body li {211- line-height: 1.4em;212-}213-214-div.admonition {215- background: #fafafa;216- margin: 20px -30px;217- padding: 10px 30px;218- border-top: 1px solid #ccc;219- border-bottom: 1px solid #ccc;220-}221-222-div.admonition tt.xref, div.admonition a tt {223- border-bottom: 1px solid #fafafa;224-}225-226-dd div.admonition {227- margin-left: -60px;228- padding-left: 60px;229-}230-231-div.admonition p.admonition-title {232- font-family: 'Open Sans', 'Helvetica', 'Arial', sans-serif;233- font-weight: 400;234- font-size: 24px;235- margin: 0 0 10px 0;236- padding: 0;237- line-height: 1;238-}239-240-div.admonition p.last {241- margin-bottom: 0;242-}243-244-div.highlight {245- background-color: white;246-}247-248-dt:target, .highlight {249- background: #FAF3E8;250-}251-252-div.note {253- background-color: #eee;254- border: 1px solid #ccc;255-}256- 257-div.seealso {258- background-color: #ffc;259- border: 1px solid #ff6;260-}261- 262-div.topic {263- background-color: #eee;264-}265- 266-p.admonition-title {267- display: inline;268-}269- 270-p.admonition-title:after {271- content: ":";272-}273-274-pre, tt {275- font-family: 'Ubuntu Mono', 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono';276- font-size: 15px;277-}278-279-img.screenshot {280-}281-282-tt.descname, tt.descclassname {283- font-size: 0.95em;284-}285-286-tt.descname {287- padding-right: 0.08em;288-}289-290-img.screenshot {291- -moz-box-shadow: 2px 2px 4px #eee;292- -webkit-box-shadow: 2px 2px 4px #eee;293- box-shadow: 2px 2px 4px #eee;294-}295-296-table.docutils {297- border: 1px solid #888;298- -moz-box-shadow: 2px 2px 4px #eee;299- -webkit-box-shadow: 2px 2px 4px #eee;300- box-shadow: 2px 2px 4px #eee;301-}302-303-table.docutils td, table.docutils th {304- border: 1px solid #888;305- padding: 0.25em 0.7em;306-}307-308-table.field-list, table.footnote {309- border: none;310- -moz-box-shadow: none;311- -webkit-box-shadow: none;312- box-shadow: none;313-}314-315-table.footnote {316- margin: 15px 0;317- width: 100%;318- border: 1px solid #eee;319- background: #fdfdfd;320- font-size: 0.9em;321-}322-323-table.footnote + table.footnote {324- margin-top: -15px;325- border-top: none;326-}327-328-table.field-list th {329- padding: 0 0.8em 0 0;330-}331-332-table.field-list td {333- padding: 0;334-}335-336-table.footnote td.label {337- width: 0px;338- padding: 0.3em 0 0.3em 0.5em;339-}340-341-table.footnote td {342- padding: 0.3em 0.5em;343-}344-345-dl {346- margin: 0;347- padding: 0;348-}349-350-dl dd {351- margin-left: 30px;352-}353-354-blockquote {355- margin: 0 0 0 30px;356- padding: 0;357-}358-359-ul, ol {360- margin: 10px 0 10px 30px;361- padding: 0;362-}363- 364-pre {365- padding: 7px 0 7px 30px;366- margin: 15px 0;367- line-height: 1.3em;368-}369- 370-tt {371- background-color: #ecf0f3;372- color: #222;373- /* padding: 1px 2px; */374-}375-376-tt.xref, a tt {377- background-color: #FBFBFB;378- border-bottom: 1px solid white;379-}380-381-a.reference {382- text-decoration: none;383- border-bottom: 1px dotted #5D2CD1;384-}385-386-a.reference:hover {387- border-bottom: 1px solid #7546E3;388-}389-390-a.footnote-reference {391- text-decoration: none;392- font-size: 0.7em;393- vertical-align: top;394- border-bottom: 1px dotted #5D2CD1;395-}396-397-a.footnote-reference:hover {398- border-bottom: 1px solid #7546E3;399-}400-401-a:hover tt {402- background: #EEE;403-}deleted:docs/_themes/click/layout.html-20 removed
1234567891011121314151617181920{%- extends "basic/layout.html" %}{%- block extrahead %} {{ super() }}{% endblock %}{%- block relbar2 %}{% endblock %}{% block header %} {{ super() }} {% if pagename == 'index' %} <div class=indexwrapper> {% endif %}{% endblock %}{%- block footer %} <div class="footer"> © Copyright {{ copyright }}. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>. </div> {% if pagename == 'index' %} </div> {% endif %}{%- endblock %}deleted:docs/_themes/click/relations.html-19 removed
12345678910111213141516171819<h3>Related Topics</h3><ul> <li><a href="{{ pathto(master_doc) }}">Documentation overview</a><ul> {%- for parent in parents %} <li><a href="{{ parent.link|e }}">{{ parent.title }}</a><ul> {%- endfor %} {%- if prev %} <li>Previous: <a href="{{ prev.link|e }}" title="{{ _('previous chapter') }}">{{ prev.title }}</a></li> {%- endif %} {%- if next %} <li>Next: <a href="{{ next.link|e }}" title="{{ _('next chapter') }}">{{ next.title }}</a></li> {%- endif %} {%- for parent in parents %} </ul></li> {%- endfor %} </ul></li></ul>deleted:docs/_themes/click/theme.conf-4 removed
1-[theme]2-inherit = basic3-stylesheet = click.css4-pygments_style = tangodeleted:docs/_themes/LICENSE-37 removed
1-Copyright (c) 2014 by Armin Ronacher.2-3-Some rights reserved.4-5-Redistribution and use in source and binary forms of the theme, with or6-without modification, are permitted provided that the following conditions7-are met:8-9-* Redistributions of source code must retain the above copyright10- notice, this list of conditions and the following disclaimer.11-12-* Redistributions in binary form must reproduce the above13- copyright notice, this list of conditions and the following14- disclaimer in the documentation and/or other materials provided15- with the distribution.16-17-* The names of the contributors may not be used to endorse or18- promote products derived from this software without specific19- prior written permission.20-21-We kindly ask you to only use these themes in an unmodified manner just22-for Click and Click-related products, not for unrelated projects. If you23-like the visual style and want to use it for your own projects, please24-consider making some larger changes to the themes (such as changing25-font faces, sizes, colors or margins).26-27-THIS THEME IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"28-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE29-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE30-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE31-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR32-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF33-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS34-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN35-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)36-ARISING IN ANY WAY OUT OF THE USE OF THIS THEME, EVEN IF ADVISED OF THE37-POSSIBILITY OF SUCH DAMAGE.deleted:docs/_themes/README-31 removed
1-Flask Sphinx Styles2-===================3-4-This repository contains sphinx styles for Flask and Flask related5-projects. To use this style in your Sphinx documentation, follow6-this guide:7-8-1. put this folder as _themes into your docs folder. Alternatively9- you can also use git submodules to check out the contents there.10-2. add this to your conf.py:11-12- sys.path.append(os.path.abspath('_themes'))13- html_theme_path = ['_themes']14- html_theme = 'flask'15-16-The following themes exist:17-18-- 'flask' - the standard flask documentation theme for large19- projects20-- 'flask_small' - small one-page theme. Intended to be used by21- very small addon libraries for flask.22-23-The following options exist for the flask_small theme:24-25- [options]26- index_logo = '' filename of a picture in _static27- to be used as replacement for the28- h1 in the index.rst file.29- index_logo_height = 120px height of the index logo30- github_fork = '' repository name on github for the31- "fork me" badgedeleted:docs/clickdoctools.py-255 removed
1-import os2-import sys3-import click4-import shutil5-import tempfile6-import contextlib7-8-try:9- from StringIO import StringIO10-except ImportError:11- from io import StringIO12-13-from docutils import nodes14-from docutils.statemachine import ViewList15-16-from sphinx.domains import Domain17-from sphinx.util.compat import Directive18-19-20-class EchoingStdin(object):21-22- def __init__(self, input, output):23- self._input = input24- self._output = output25-26- def __getattr__(self, x):27- return getattr(self._input, x)28-29- def _echo(self, rv):30- mark = False31- if rv.endswith('\xff'):32- rv = rv[:-1]33- mark = True34- self._output.write(rv)35- if mark:36- self._output.write('^D\n')37- return rv38-39- def read(self, n=-1):40- return self._echo(self._input.read(n))41-42- def readline(self, n=-1):43- return self._echo(self._input.readline(n))44-45- def readlines(self):46- return [self._echo(x) for x in self._input.readlines()]47-48- def __iter__(self):49- return iter(self._echo(x) for x in self._input)50-51-52-@contextlib.contextmanager53-def isolation(input=None, env=None):54- if isinstance(input, unicode):55- input = input.encode('utf-8')56- input = StringIO(input or '')57- output = StringIO()58- sys.stdin = EchoingStdin(input, output)59- sys.stdin.encoding = 'utf-8'60-61- def visible_input(prompt=None):62- sys.stdout.write(prompt or '')63- val = input.readline().rstrip('\r\n')64- sys.stdout.write(val + '\n')65- sys.stdout.flush()66- return val67-68- def hidden_input(prompt=None):69- sys.stdout.write((prompt or '') + '\n')70- sys.stdout.flush()71- return input.readline().rstrip('\r\n')72-73- sys.stdout = output74- sys.stderr = output75- old_visible_prompt_func = click.termui.visible_prompt_func76- old_hidden_prompt_func = click.termui.hidden_prompt_func77- click.termui.visible_prompt_func = visible_input78- click.termui.hidden_prompt_func = hidden_input79-80- old_env = {}81- try:82- if env:83- for key, value in env.iteritems():84- old_env[key] = os.environ.get(value)85- os.environ[key] = value86- yield output87- finally:88- for key, value in old_env.iteritems():89- if value is None:90- try:91- del os.environ[key]92- except Exception:93- pass94- else:95- os.environ[key] = value96- sys.stdout = sys.__stdout__97- sys.stderr = sys.__stderr__98- click.termui.visible_prompt_func = old_visible_prompt_func99- click.termui.hidden_prompt_func = old_hidden_prompt_func100-101-102-@contextlib.contextmanager103-def isolated_filesystem():104- cwd = os.getcwd()105- t = tempfile.mkdtemp()106- os.chdir(t)107- try:108- yield109- finally:110- os.chdir(cwd)111- try:112- shutil.rmtree(t)113- except (OSError, IOError):114- pass115-116-117-class ExampleRunner(object):118-119- def __init__(self):120- self.namespace = {121- 'click': click,122- '__file__': 'dummy.py',123- }124-125- def declare(self, source):126- code = compile(source, '<docs>', 'exec')127- eval(code, self.namespace)128-129- def run(self, source):130- code = compile(source, '<docs>', 'exec')131- buffer = []132-133- def invoke(cmd, args=None, prog_name=None,134- input=None, terminate_input=False, env=None,135- **extra):136- if env:137- for key, value in sorted(env.items()):138- if ' ' in value:139- value = '"%s"' % value140- buffer.append('$ export %s=%s' % (key, value))141- args = args or []142- if prog_name is None:143- prog_name = cmd.name.replace('_', '-')144- buffer.append(('$ %s %s' % (145- prog_name,146- ' '.join(('"%s"' % x) if ' ' in x else x for x in args)147- )).rstrip())148- if isinstance(input, (tuple, list)):149- input = '\n'.join(input) + '\n'150- if terminate_input:151- input += '\xff'152- with isolation(input=input, env=env) as output:153- try:154- cmd.main(args=args, prog_name=prog_name.split()[-1],155- **extra)156- except SystemExit:157- pass158- buffer.extend(output.getvalue().splitlines())159-160- def println(text=''):161- buffer.append(text)162-163- eval(code, self.namespace, {164- 'invoke': invoke,165- 'println': println,166- 'isolated_filesystem': isolated_filesystem,167- })168- return buffer169-170- def close(self):171- pass172-173-174-def parse_rst(state, content_offset, doc):175- node = nodes.section()176- # hack around title style bookkeeping177- surrounding_title_styles = state.memo.title_styles178- surrounding_section_level = state.memo.section_level179- state.memo.title_styles = []180- state.memo.section_level = 0181- state.nested_parse(doc, content_offset, node, match_titles=1)182- state.memo.title_styles = surrounding_title_styles183- state.memo.section_level = surrounding_section_level184- return node.children185-186-187-def get_example_runner(document):188- runner = getattr(document, 'click_example_runner', None)189- if runner is None:190- runner = document.click_example_runner = ExampleRunner()191- return runner192-193-194-class ExampleDirective(Directive):195- has_content = True196- required_arguments = 0197- optional_arguments = 0198- final_argument_whitespace = False199-200- def run(self):201- doc = ViewList()202- runner = get_example_runner(self.state.document)203- try:204- runner.declare('\n'.join(self.content))205- except:206- runner.close()207- raise208- doc.append('.. sourcecode:: python', '')209- doc.append('', '')210- for line in self.content:211- doc.append(' ' + line, '')212- return parse_rst(self.state, self.content_offset, doc)213-214-215-class RunExampleDirective(Directive):216- has_content = True217- required_arguments = 0218- optional_arguments = 0219- final_argument_whitespace = False220-221- def run(self):222- doc = ViewList()223- runner = get_example_runner(self.state.document)224- try:225- rv = runner.run('\n'.join(self.content))226- except:227- runner.close()228- raise229- doc.append('.. sourcecode:: text', '')230- doc.append('', '')231- for line in rv:232- doc.append(' ' + line, '')233- return parse_rst(self.state, self.content_offset, doc)234-235-236-class ClickDomain(Domain):237- name = 'click'238- label = 'Click'239- directives = {240- 'example': ExampleDirective,241- 'run': RunExampleDirective,242- }243-244-245-def delete_example_runner_state(app, doctree):246- runner = getattr(doctree, 'click_example_runner', None)247- if runner is not None:248- runner.close()249- del doctree.click_example_runner250-251-252-def setup(app):253- app.add_domain(ClickDomain)254-255- app.connect('doctree-read', delete_example_runner_state)modified:docs/conf.py+41 added-200 removed
1-# -*- coding: utf-8 -*-2-#3-# click documentation build configuration file, created by4-# sphinx-quickstart on Mon Apr 26 19:53:01 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.1+from pallets_sphinx_themes import ProjectLink, get_version2 14-import sys, os3+# Project --------------------------------------------------------------4 16-# If extensions (or modules to document with autodoc) are in another directory,17-# add these directories to sys.path here. If the directory is relative to the18-# documentation root, use os.path.abspath to make it absolute, like shown here.19-sys.path.append(os.path.abspath('_themes'))20-sys.path.append(os.path.abspath('..'))21-sys.path.append(os.path.abspath('.'))5+project = "Click"6+copyright = "2014 Pallets Team"7+author = "Pallets Team"8+release, version = get_version("Click", version_length=1)9 23-# -- General configuration -----------------------------------------------------10+# General --------------------------------------------------------------11 25-# If your documentation needs a minimal Sphinx version, state it here.26-#needs_sphinx = '1.0'12+master_doc = "index"13+extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx", "pallets_sphinx_themes"]14+intersphinx_mapping = {"python": ("https://docs.python.org/3/", None)}15 28-# Add any Sphinx extension module names here, as strings. They can be extensions29-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.30-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx',31- 'clickdoctools']16+# HTML -----------------------------------------------------------------17 33-# Add any paths that contain templates here, relative to this directory.34-templates_path = ['_templates']35-36-# The suffix of source filenames.37-source_suffix = '.rst'38-39-# The encoding of source files.40-#source_encoding = 'utf-8-sig'41-42-# The master toctree document.43-master_doc = 'index'44-45-# General information about the project.46-project = u'click'47-copyright = u'2014, Armin Ronacher'48-49-# The version info for the project you're documenting, acts as replacement for50-# |version| and |release|, also used in various other places throughout the51-# built documents.52-#53-# The short X.Y version.54-version = '1.0'55-# The full version, including alpha/beta/rc tags.56-release = '1.0'57-58-# The language for content autogenerated by Sphinx. Refer to documentation59-# for a list of supported languages.60-#language = None61-62-# There are two options for replacing |today|: either, you set today to some63-# non-false value, then it is used:64-#today = ''65-# Else, today_fmt is used as the format for a strftime call.66-#today_fmt = '%B %d, %Y'67-68-# List of patterns, relative to source directory, that match files and69-# directories to ignore when looking for source files.70-exclude_patterns = ['_build']71-72-# The reST default role (used for this markup: `text`) to use for all documents.73-#default_role = None74-75-# If true, '()' will be appended to :func: etc. cross-reference text.76-#add_function_parentheses = True77-78-# If true, the current module name will be prepended to all description79-# unit titles (such as .. function::).80-#add_module_names = True81-82-# If true, sectionauthor and moduleauthor directives will be shown in the83-# output. They are ignored by default.84-#show_authors = False85-86-# A list of ignored prefixes for module index sorting.87-#modindex_common_prefix = []88-89-90-# -- Options for HTML output ---------------------------------------------------91-92-# The theme to use for HTML and HTML Help pages. Major themes that come with93-# Sphinx are currently 'default' and 'sphinxdoc'.94-html_theme = 'click'95-96-# Theme options are theme-specific and customize the look and feel of a theme97-# further. For a list of options available for each theme, see the98-# documentation.99-html_theme_options = {18+html_theme = "click"19+html_theme_options = {"index_sidebar_logo": False}20+html_context = {21+ "project_links": [22+ ProjectLink("Donate to Pallets", "https://palletsprojects.com/donate"),23+ ProjectLink("Click Website", "https://palletsprojects.com/p/click/"),24+ ProjectLink("PyPI releases", "https://pypi.org/project/Click/"),25+ ProjectLink("Source Code", "https://github.com/pallets/click/"),26+ ProjectLink("Issue Tracker", "https://github.com/pallets/click/issues/"),27+ ]28 }101-102-# Add any paths that contain custom themes here, relative to this directory.103-html_theme_path = ['_themes']104-105-# The name for this set of Sphinx documents. If None, it defaults to106-# "<project> v<release> documentation".107-html_title = 'click'108-109-# A shorter title for the navigation bar. Default is the same as html_title.110-#html_short_title = None111-112-# The name of an image file (relative to this directory) to place at the top113-# of the sidebar.114-#html_logo = None115-116-# The name of an image file (within the static path) to use as favicon of the117-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32118-# pixels large.119-#html_favicon = None120-121-# Add any paths that contain custom static files (such as style sheets) here,122-# relative to this directory. They are copied after the builtin static files,123-# so a file named "default.css" will overwrite the builtin "default.css".124-html_static_path = ['_static']125-126-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,127-# using the given strftime format.128-#html_last_updated_fmt = '%b %d, %Y'129-130-# If true, SmartyPants will be used to convert quotes and dashes to131-# typographically correct entities.132-#html_use_smartypants = True133-134-# Custom sidebar templates, maps document names to template names.29 html_sidebars = {136- 'index': ['sidebarintro.html', 'sourcelink.html', 'searchbox.html'],137- '**': ['sidebarlogo.html', 'localtoc.html', 'relations.html',138- 'sourcelink.html', 'searchbox.html']30+ "index": ["project.html", "versions.html", "searchbox.html"],31+ "**": ["localtoc.html", "relations.html", "versions.html", "searchbox.html"],32 }33+singlehtml_sidebars = {"index": ["project.html", "versions.html", "localtoc.html"]}34+html_static_path = ["_static"]35+html_favicon = "_static/click-icon.png"36+html_logo = "_static/click-logo-sidebar.png"37+html_title = "{} Documentation ({})".format(project, version)38+html_show_sourcelink = False39+html_domain_indices = False40+html_experimental_html5_writer = True41 141-# Additional templates that should be rendered to pages, maps page names to142-# template names.143-#html_additional_pages = {}42+# LaTeX ----------------------------------------------------------------43 145-# If false, no module index is generated.146-#html_domain_indices = True147-148-# If false, no index is generated.149-#html_use_index = True150-151-# If true, the index is split into individual pages for each letter.152-#html_split_index = False153-154-# If true, links to the reST sources are added to the pages.155-#html_show_sourcelink = True156-157-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.158-#html_show_sphinx = True159-160-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.161-#html_show_copyright = True162-163-# If true, an OpenSearch description file will be output, and all pages will164-# contain a <link> tag referring to it. The value of this option must be the165-# base URL from which the finished HTML is served.166-#html_use_opensearch = ''167-168-# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").169-#html_file_suffix = ''170-171-# Output file base name for HTML help builder.172-htmlhelp_basename = 'clickdoc'173-174-175-# -- Options for LaTeX output --------------------------------------------------176-177-# The paper size ('letter' or 'a4').178-#latex_paper_size = 'letter'179-180-# The font size ('10pt', '11pt' or '12pt').181-#latex_font_size = '10pt'182-183-# Grouping the document tree into LaTeX files. List of tuples184-# (source start file, target name, title, author, documentclass [howto/manual]).44 latex_documents = [186- ('index', 'click.tex', u'click documentation',187- u'Armin Ronacher', 'manual'),45+ (master_doc, "Click.tex", "Click Documentation", "Pallets Team", "manual")46 ]47 190-# The name of an image file (relative to this directory) to place at the top of191-# the title page.192-#latex_logo = None48+# theme compatibility --------------------------------------------------49 194-# For "manual" documents, if this is true, then toplevel headings are parts,195-# not chapters.196-#latex_use_parts = False50 198-# Additional stuff for the LaTeX preamble.199-#latex_preamble = ''51+def setup(app):52+ from click.testing import CliRunner53 201-# Documents to append as an appendix to all manuals.202-#latex_appendices = []54+ orig_invoke = CliRunner.invoke55 204-# If false, no module index is generated.205-#latex_domain_indices = True56+ def invoke(self, *args, **kwargs):57+ kwargs.pop("prog_name", None)58+ return orig_invoke(self, *args, **kwargs)59 207-208-# -- Options for manual page output --------------------------------------------209-210-# One entry per manual page. List of tuples211-# (source start file, name, description, authors, manual section).212-man_pages = [213- ('index', 'click', u'click documentation',214- [u'Armin Ronacher'], 1)215-]216-217-intersphinx_mapping = {218- 'http://docs.python.org/dev': None219-}60+ CliRunner.invoke = invokemodified:docs/index.rst+11 added-4 removed
1-Welcome to the Click Documentation2-==================================1+.. rst-class:: hide-header2 3+Welcome to Click4+================5+6+.. image:: _static/click-logo.png7+ :align: center8+ :scale: 50%9+ :target: https://palletsprojects.com/p/click/10+11 Click is a Python package for creating beautiful command line interfaces12 in a composable way with as little code as necessary. It's the "Command13 Line Interface Creation Kit". It's highly configurable but comes with14 sensible defaults out of the box.41 unmodified lines56 You can get the library directly from PyPI::57 58 pip install click59 53-Documentation Contents54-----------------------60+Documentation61+-------------62 63 This part of the documentation guides you through all of the library's64 usage patterns.65 40 unmodified linesmodified:docs/make.bat+18 added-137 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=Jinja13 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. text to make text files30- echo. man to make manual pages31- echo. changes to make an overview over all changed/added/deprecated items32- echo. linkcheck to check all external links for integrity33- echo. doctest to run all doctests embedded in the documentation if enabled34- goto end35-)36-37-if "%1" == "clean" (38- for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i39- del /q /s %BUILDDIR%\*40- goto end41-)42-43-if "%1" == "html" (44- %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html16+%SPHINXBUILD% >NUL 2>NUL17+if errorlevel 9009 (18 echo.46- echo.Build finished. The HTML pages are in %BUILDDIR%/html.47- goto end48-)49-50-if "%1" == "dirhtml" (51- %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.53- echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.54- goto end24+ echo.If you don't have Sphinx installed, grab it from25+ echo.http://sphinx-doc.org/26+ exit /b 127 )28 57-if "%1" == "singlehtml" (58- %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml59- echo.60- echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.61- goto end62-)29+%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%30+goto end31 64-if "%1" == "pickle" (65- %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle66- echo.67- echo.Build finished; now you can process the pickle files.68- goto end69-)32+:help33+%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%34 71-if "%1" == "json" (72- %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json73- echo.74- echo.Build finished; now you can process the JSON files.75- goto end76-)77-78-if "%1" == "htmlhelp" (79- %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp80- echo.81- echo.Build finished; now you can run HTML Help Workshop with the ^82-.hhp project file in %BUILDDIR%/htmlhelp.83- goto end84-)85-86-if "%1" == "qthelp" (87- %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp88- echo.89- echo.Build finished; now you can run "qcollectiongenerator" with the ^90-.qhcp project file in %BUILDDIR%/qthelp, like this:91- echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Classy.qhcp92- echo.To view the help file:93- echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Classy.ghc94- goto end95-)96-97-if "%1" == "devhelp" (98- %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp99- echo.100- echo.Build finished.101- goto end102-)103-104-if "%1" == "epub" (105- %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub106- echo.107- echo.Build finished. The epub file is in %BUILDDIR%/epub.108- goto end109-)110-111-if "%1" == "latex" (112- %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex113- echo.114- echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.115- goto end116-)117-118-if "%1" == "text" (119- %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text120- echo.121- echo.Build finished. The text files are in %BUILDDIR%/text.122- goto end123-)124-125-if "%1" == "man" (126- %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man127- echo.128- echo.Build finished. The manual pages are in %BUILDDIR%/man.129- goto end130-)131-132-if "%1" == "changes" (133- %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes134- echo.135- echo.The overview file is in %BUILDDIR%/changes.136- goto end137-)138-139-if "%1" == "linkcheck" (140- %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck141- echo.142- echo.Link check complete; look for any errors in the above output ^143-or in %BUILDDIR%/linkcheck/output.txt.144- goto end145-)146-147-if "%1" == "doctest" (148- %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest149- echo.150- echo.Testing of doctests in the sources finished, look at the ^151-results in %BUILDDIR%/doctest/output.txt.152- goto end153-)154-35 :end36+popdmodified:docs/Makefile+10 added-120 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 = Jinja8+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 devhelp epub latex latexpdf text man 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 " text to make text files"31- @echo " man to make manual pages"32- @echo " changes to make an overview of all changed/added/deprecated items"33- @echo " linkcheck to check all external links for integrity"34- @echo " doctest to run all doctests embedded in the documentation (if enabled)"13+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)14 36-clean:37- -rm -rf $(BUILDDIR)/*15+.PHONY: help Makefile16 39-html:40- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html41- @echo42- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."43-44-dirhtml:45- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml46- @echo47- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."48-49-singlehtml:50- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml51- @echo52- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."53-54-pickle:55- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle56- @echo57- @echo "Build finished; now you can process the pickle files."58-59-json:60- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json61- @echo62- @echo "Build finished; now you can process the JSON files."63-64-htmlhelp:65- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp66- @echo67- @echo "Build finished; now you can run HTML Help Workshop with the" \68- ".hhp project file in $(BUILDDIR)/htmlhelp."69-70-qthelp:71- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp72- @echo73- @echo "Build finished; now you can run "qcollectiongenerator" with the" \74- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"75- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Classy.qhcp"76- @echo "To view the help file:"77- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Classy.qhc"78-79-devhelp:80- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp81- @echo82- @echo "Build finished."83- @echo "To view the help file:"84- @echo "# mkdir -p $$HOME/.local/share/devhelp/Classy"85- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Classy"86- @echo "# devhelp"87-88-epub:89- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub90- @echo91- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."92-93-latex:94- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex95- @echo96- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."97- @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \98- "run these through (pdf)latex."99-100-latexpdf: latex101- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex102- @echo "Running LaTeX files through pdflatex..."103- make -C $(BUILDDIR)/latex all-pdf104- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."105-106-text:107- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text108- @echo109- @echo "Build finished. The text files are in $(BUILDDIR)/text."110-111-man:112- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man113- @echo114- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."115-116-changes:117- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes118- @echo119- @echo "The overview file is in $(BUILDDIR)/changes."120-121-linkcheck:122- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck123- @echo124- @echo "Link check complete; look for any errors in the above output " \125- "or in $(BUILDDIR)/linkcheck/output.txt."126-127-doctest:128- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest129- @echo "Testing of doctests in the sources finished, look at the " \130- "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)added:docs/requirements.txt+2 added
1+Sphinx~=1.7.72+Pallets-Sphinx-Themes~=1.1.0