Skip to content
Myr

Merge branch '4.x' into 5.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 c6df8e6, 1b07ebf · Browse files · 16 files+84 added−754 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

16 files+84 added−754 removed

  • other:+84 added−754 removed

16 files+84 added−754 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
deleted:docs/_templates/sidebarlogo.html-3 removed
deleted:docs/clickdoctools.py-275 removed
1import os2import sys3import click4import shutil5import tempfile6import contextlib7import subprocess89try:10 from StringIO import StringIO11except ImportError:12 from io import StringIO1314from docutils import nodes15from docutils.statemachine import ViewList1617from sphinx.domains import Domain18from sphinx.util.compat import Directive192021class EchoingStdin(object):2223 def __init__(self, input, output):24 self._input = input25 self._output = output2627 def __getattr__(self, x):28 return getattr(self._input, x)2930 def _echo(self, rv):31 mark = False32 if rv.endswith('\xff'):33 rv = rv[:-1]34 mark = True35 self._output.write(rv)36 if mark:37 self._output.write('^D\n')38 return rv3940 def read(self, n=-1):41 return self._echo(self._input.read(n))4243 def readline(self, n=-1):44 return self._echo(self._input.readline(n))4546 def readlines(self):47 return [self._echo(x) for x in self._input.readlines()]4849 def __iter__(self):50 return iter(self._echo(x) for x in self._input)515253@contextlib.contextmanager54def fake_modules():55 old_call = subprocess.call56 def dummy_call(*args, **kwargs):57 with tempfile.TemporaryFile('wb+') as f:58 kwargs['stdout'] = f59 kwargs['stderr'] = f60 rv = subprocess.Popen(*args, **kwargs).wait()61 f.seek(0)62 click.echo(f.read().decode('utf-8', 'replace').rstrip())63 return rv64 subprocess.call = dummy_call65 try:66 yield67 finally:68 subprocess.call = old_call697071@contextlib.contextmanager72def isolation(input=None, env=None):73 if isinstance(input, unicode):74 input = input.encode('utf-8')75 input = StringIO(input or '')76 output = StringIO()77 sys.stdin = EchoingStdin(input, output)78 sys.stdin.encoding = 'utf-8'7980 def visible_input(prompt=None):81 sys.stdout.write(prompt or '')82 val = input.readline().rstrip('\r\n')83 sys.stdout.write(val + '\n')84 sys.stdout.flush()85 return val8687 def hidden_input(prompt=None):88 sys.stdout.write((prompt or '') + '\n')89 sys.stdout.flush()90 return input.readline().rstrip('\r\n')9192 sys.stdout = output93 sys.stderr = output94 old_visible_prompt_func = click.termui.visible_prompt_func95 old_hidden_prompt_func = click.termui.hidden_prompt_func96 click.termui.visible_prompt_func = visible_input97 click.termui.hidden_prompt_func = hidden_input9899 old_env = {}100 try:101 if env:102 for key, value in env.iteritems():103 old_env[key] = os.environ.get(value)104 os.environ[key] = value105 yield output106 finally:107 for key, value in old_env.iteritems():108 if value is None:109 try:110 del os.environ[key]111 except Exception:112 pass113 else:114 os.environ[key] = value115 sys.stdout = sys.__stdout__116 sys.stderr = sys.__stderr__117 click.termui.visible_prompt_func = old_visible_prompt_func118 click.termui.hidden_prompt_func = old_hidden_prompt_func119120121@contextlib.contextmanager122def isolated_filesystem():123 cwd = os.getcwd()124 t = tempfile.mkdtemp()125 os.chdir(t)126 try:127 yield128 finally:129 os.chdir(cwd)130 try:131 shutil.rmtree(t)132 except (OSError, IOError):133 pass134135136class ExampleRunner(object):137138 def __init__(self):139 self.namespace = {140 'click': click,141 '__file__': 'dummy.py',142 }143144 def declare(self, source):145 with fake_modules():146 code = compile(source, '<docs>', 'exec')147 eval(code, self.namespace)148149 def run(self, source):150 code = compile(source, '<docs>', 'exec')151 buffer = []152153 def invoke(cmd, args=None, prog_name=None,154 input=None, terminate_input=False, env=None,155 **extra):156 if env:157 for key, value in sorted(env.items()):158 if ' ' in value:159 value = '"%s"' % value160 buffer.append('$ export %s=%s' % (key, value))161 args = args or []162 if prog_name is None:163 prog_name = cmd.name.replace('_', '-')164 buffer.append(('$ %s %s' % (165 prog_name,166 ' '.join(('"%s"' % x) if ' ' in x else x for x in args)167 )).rstrip())168 if isinstance(input, (tuple, list)):169 input = '\n'.join(input) + '\n'170 if terminate_input:171 input += '\xff'172 with isolation(input=input, env=env) as output:173 try:174 cmd.main(args=args, prog_name=prog_name.split()[-1],175 **extra)176 except SystemExit:177 pass178 buffer.extend(output.getvalue().splitlines())179180 def println(text=''):181 buffer.append(text)182183 eval(code, self.namespace, {184 'invoke': invoke,185 'println': println,186 'isolated_filesystem': isolated_filesystem,187 })188 return buffer189190 def close(self):191 pass192193194def parse_rst(state, content_offset, doc):195 node = nodes.section()196 # hack around title style bookkeeping197 surrounding_title_styles = state.memo.title_styles198 surrounding_section_level = state.memo.section_level199 state.memo.title_styles = []200 state.memo.section_level = 0201 state.nested_parse(doc, content_offset, node, match_titles=1)202 state.memo.title_styles = surrounding_title_styles203 state.memo.section_level = surrounding_section_level204 return node.children205206207def get_example_runner(document):208 runner = getattr(document, 'click_example_runner', None)209 if runner is None:210 runner = document.click_example_runner = ExampleRunner()211 return runner212213214class ExampleDirective(Directive):215 has_content = True216 required_arguments = 0217 optional_arguments = 0218 final_argument_whitespace = False219220 def run(self):221 doc = ViewList()222 runner = get_example_runner(self.state.document)223 try:224 runner.declare('\n'.join(self.content))225 except:226 runner.close()227 raise228 doc.append('.. sourcecode:: python', '')229 doc.append('', '')230 for line in self.content:231 doc.append(' ' + line, '')232 return parse_rst(self.state, self.content_offset, doc)233234235class RunExampleDirective(Directive):236 has_content = True237 required_arguments = 0238 optional_arguments = 0239 final_argument_whitespace = False240241 def run(self):242 doc = ViewList()243 runner = get_example_runner(self.state.document)244 try:245 rv = runner.run('\n'.join(self.content))246 except:247 runner.close()248 raise249 doc.append('.. sourcecode:: text', '')250 doc.append('', '')251 for line in rv:252 doc.append(' ' + line, '')253 return parse_rst(self.state, self.content_offset, doc)254255256class ClickDomain(Domain):257 name = 'click'258 label = 'Click'259 directives = {260 'example': ExampleDirective,261 'run': RunExampleDirective,262 }263264265def delete_example_runner_state(app, doctree):266 runner = getattr(doctree, 'click_example_runner', None)267 if runner is not None:268 runner.close()269 del doctree.click_example_runner270271272def setup(app):273 app.add_domain(ClickDomain)274275 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.1from pallets_sphinx_themes import ProjectLink, get_version214import sys, os15import datetime3# Project --------------------------------------------------------------417# If extensions (or modules to document with autodoc) are in another directory,18# add these directories to sys.path here. If the directory is relative to the19# documentation root, use os.path.abspath to make it absolute, like shown here.20sys.path.append(os.path.abspath('..'))21sys.path.append(os.path.abspath('.'))5project = "Click"6copyright = "2014 Pallets Team"7author = "Pallets Team"8release, version = get_version("Click", version_length=1)923# -- General configuration -----------------------------------------------------10# General --------------------------------------------------------------1125# If your documentation needs a minimal Sphinx version, state it here.26#needs_sphinx = '1.0'12master_doc = "index"13extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx", "pallets_sphinx_themes"]14intersphinx_mapping = {"python": ("https://docs.python.org/3/", None)}1528# Add any Sphinx extension module names here, as strings. They can be extensions29# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.30extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx',31 'clickdoctools']16# HTML -----------------------------------------------------------------1733# Add any paths that contain templates here, relative to this directory.34templates_path = ['_templates']3536# The suffix of source filenames.37source_suffix = '.rst'3839# The encoding of source files.40#source_encoding = 'utf-8-sig'4142# The master toctree document.43master_doc = 'index'4445# General information about the project.46project = u'click'47copyright = u'%d, Armin Ronacher' % datetime.datetime.utcnow().year4849# 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.54version = '1.0'55# The full version, including alpha/beta/rc tags.56release = '1.0'5758# The language for content autogenerated by Sphinx. Refer to documentation59# for a list of supported languages.60#language = None6162# 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'6768# List of patterns, relative to source directory, that match files and69# directories to ignore when looking for source files.70exclude_patterns = ['_build']7172# The reST default role (used for this markup: `text`) to use for all documents.73#default_role = None7475# If true, '()' will be appended to :func: etc. cross-reference text.76#add_function_parentheses = True7778# If true, the current module name will be prepended to all description79# unit titles (such as .. function::).80#add_module_names = True8182# If true, sectionauthor and moduleauthor directives will be shown in the83# output. They are ignored by default.84#show_authors = False8586# A list of ignored prefixes for module index sorting.87#modindex_common_prefix = []888990# -- Options for HTML output ---------------------------------------------------9192# The theme to use for HTML and HTML Help pages. Major themes that come with93# Sphinx are currently 'default' and 'sphinxdoc'.94#html_theme = 'default'9596# 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.99html_theme_options = {18html_theme = "click"19html_theme_options = {"index_sidebar_logo": False}20html_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}101102# Add any paths that contain custom themes here, relative to this directory.103#html_theme_path = ['_themes']104105# The name for this set of Sphinx documents. If None, it defaults to106# "<project> v<release> documentation".107html_title = 'click'108109# A shorter title for the navigation bar. Default is the same as html_title.110#html_short_title = None111112# The name of an image file (relative to this directory) to place at the top113# of the sidebar.114#html_logo = None115116# 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 = None120121# 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".124html_static_path = ['_static']125126# 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'129130# If true, SmartyPants will be used to convert quotes and dashes to131# typographically correct entities.132#html_use_smartypants = True133134# Custom sidebar templates, maps document names to template names.29html_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}33singlehtml_sidebars = {"index": ["project.html", "versions.html", "localtoc.html"]}34html_static_path = ["_static"]35html_favicon = "_static/click-icon.png"36html_logo = "_static/click-logo-sidebar.png"37html_title = "{} Documentation ({})".format(project, version)38html_show_sourcelink = False39html_domain_indices = False40html_experimental_html5_writer = True41141# Additional templates that should be rendered to pages, maps page names to142# template names.143#html_additional_pages = {}42# LaTeX ----------------------------------------------------------------43145# If false, no module index is generated.146#html_domain_indices = True147148# If false, no index is generated.149#html_use_index = True150151# If true, the index is split into individual pages for each letter.152#html_split_index = False153154# If true, links to the reST sources are added to the pages.155#html_show_sourcelink = True156157# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.158#html_show_sphinx = True159160# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.161#html_show_copyright = True162163# 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 = ''167168# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").169#html_file_suffix = ''170171# Output file base name for HTML help builder.172htmlhelp_basename = 'clickdoc'173174175# -- Options for LaTeX output --------------------------------------------------176177# The paper size ('letter' or 'a4').178#latex_paper_size = 'letter'179180# The font size ('10pt', '11pt' or '12pt').181#latex_font_size = '10pt'182183# Grouping the document tree into LaTeX files. List of tuples184# (source start file, target name, title, author, documentclass [howto/manual]).44latex_documents = [186 ('index', 'click.tex', u'click documentation',187 u'Armin Ronacher', 'manual'),45 (master_doc, "Click.tex", "Click Documentation", "Pallets Team", "manual")46]47190# 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 --------------------------------------------------49194# For "manual" documents, if this is true, then toplevel headings are parts,195# not chapters.196#latex_use_parts = False50198# Additional stuff for the LaTeX preamble.199#latex_preamble = ''51def setup(app):52 from click.testing import CliRunner53201# Documents to append as an appendix to all manuals.202#latex_appendices = []54 orig_invoke = CliRunner.invoke55204# 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)59207208# -- Options for manual page output --------------------------------------------209210# One entry per manual page. List of tuples211# (source start file, name, description, authors, manual section).212man_pages = [213 ('index', 'click', u'click documentation',214 [u'Armin Ronacher'], 1)215]216217intersphinx_mapping = {218 'http://docs.python.org/dev': None219}60 CliRunner.invoke = invoke
modified:docs/index.rst+11 added-4 removed
1Welcome to the Click Documentation2==================================1.. rst-class:: hide-header23Welcome to Click4================56.. image:: _static/click-logo.png7 :align: center8 :scale: 50%9 :target: https://palletsprojects.com/p/click/1011Click is a Python package for creating beautiful command line interfaces12in a composable way with as little code as necessary. It's the "Command13Line Interface Creation Kit". It's highly configurable but comes with14sensible defaults out of the box.
41 unmodified lines
56You can get the library directly from PyPI::5758 pip install click5953Documentation Contents54----------------------60Documentation61-------------6263This part of the documentation guides you through all of the library's64usage patterns.65
41 unmodified lines
modified:docs/make.bat+18 added-137 removed
1@ECHO OFF23pushd %~dp045REM Command file for Sphinx documentation67if "%SPHINXBUILD%" == "" (8 set SPHINXBUILD=sphinx-build9)10set SOURCEDIR=.11set BUILDDIR=_build9set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .10if NOT "%PAPER%" == "" (11 set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%12)12set SPHINXPROJ=Jinja1314if "%1" == "" goto help1516if "%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)3637if "%1" == "clean" (38 for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i39 del /q /s %BUILDDIR%\*40 goto end41)4243if "%1" == "html" (44 %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html16%SPHINXBUILD% >NUL 2>NUL17if errorlevel 9009 (18 echo.46 echo.Build finished. The HTML pages are in %BUILDDIR%/html.47 goto end48)4950if "%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)2857if "%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%30goto end3164if "%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%3471if "%1" == "json" (72 %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json73 echo.74 echo.Build finished; now you can process the JSON files.75 goto end76)7778if "%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)8586if "%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)9697if "%1" == "devhelp" (98 %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp99 echo.100 echo.Build finished.101 goto end102)103104if "%1" == "epub" (105 %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub106 echo.107 echo.Build finished. The epub file is in %BUILDDIR%/epub.108 goto end109)110111if "%1" == "latex" (112 %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex113 echo.114 echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.115 goto end116)117118if "%1" == "text" (119 %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text120 echo.121 echo.Build finished. The text files are in %BUILDDIR%/text.122 goto end123)124125if "%1" == "man" (126 %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man127 echo.128 echo.Build finished. The manual pages are in %BUILDDIR%/man.129 goto end130)131132if "%1" == "changes" (133 %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes134 echo.135 echo.The overview file is in %BUILDDIR%/changes.136 goto end137)138139if "%1" == "linkcheck" (140 %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck141 echo.142 echo.Link check complete; look for any errors in the above output ^143or in %BUILDDIR%/linkcheck/output.txt.144 goto end145)146147if "%1" == "doctest" (148 %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest149 echo.150 echo.Testing of doctests in the sources finished, look at the ^151results in %BUILDDIR%/doctest/output.txt.152 goto end153)15435:end36popd
modified:docs/Makefile+10 added-120 removed
1# Makefile for Sphinx documentation1# Minimal makefile for Sphinx documentation2#34# You can set these variables from the command line.5SPHINXOPTS =6SPHINXBUILD = sphinx-build7PAPER =7SPHINXPROJ = Jinja8SOURCEDIR = .9BUILDDIR = _build1010# Internal variables.11PAPEROPT_a4 = -D latex_paper_size=a412PAPEROPT_letter = -D latex_paper_size=letter13ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .1415.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest1611# Put it first so that "make" without argument is like "make help".12help: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)1436clean:37 -rm -rf $(BUILDDIR)/*15.PHONY: help Makefile1639html:40 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html41 @echo42 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."4344dirhtml:45 $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml46 @echo47 @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."4849singlehtml:50 $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml51 @echo52 @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."5354pickle:55 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle56 @echo57 @echo "Build finished; now you can process the pickle files."5859json:60 $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json61 @echo62 @echo "Build finished; now you can process the JSON files."6364htmlhelp: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."6970qthelp: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"7879devhelp: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"8788epub:89 $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub90 @echo91 @echo "Build finished. The epub file is in $(BUILDDIR)/epub."9293latex: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."99100latexpdf: 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."105106text:107 $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text108 @echo109 @echo "Build finished. The text files are in $(BUILDDIR)/text."110111man:112 $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man113 @echo114 @echo "Build finished. The manual pages are in $(BUILDDIR)/man."115116changes:117 $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes118 @echo119 @echo "The overview file is in $(BUILDDIR)/changes."120121linkcheck: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."126127doctest: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)
modified:docs/options.rst+2 added-2 removed
68 unmodified lines
6970.. click:example::7172 @click.command()73 @click.option('--item', type=(unicode, int))73 @click.option('--item', type=(str, int))74 def putitem(item):75 click.echo('name=%s id=%d' % item)7677And on the command line:
8 unmodified lines
8687.. click:example::8889 @click.command()90 @click.option('--item', nargs=2, type=click.Tuple([unicode, int]))90 @click.option('--item', nargs=2, type=click.Tuple([str, int]))91 def putitem(item):92 click.echo('name=%s id=%d' % item)9394Multiple Options
578 unmodified lines
added:docs/requirements.txt+2 added
1Sphinx~=1.7.72Pallets-Sphinx-Themes~=1.1.0