Merge pull request #1100 from pallets/sphinx
Before adoption: this commit came in with the history the project adopted, so no landing records it.
use pallets-sphinx-themes
authored by David Lord · committed by GitHub · parents 8df9a6b, dff4fb4 · Browse files · 20 files·+109 added−796 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
20 files+109 added−796 removed
- other:+109 added−796 removed
Provenance
- Commit
b1b8c48- Tree
4dad055- Author
David Lord <davidism@gmail.com>- Committer
GitHub <noreply@github.com>- Parent 1
8df9a6b- Parent 2
dff4fb4
20 files changed+109 added−796 removed
modified:click/types.py+7 added-6 removed
124 unmodified lines125 return 'STRING'126 127 128 class Choice(ParamType):129- """The choice type allows a value to be checked against a fixed set of130- supported values. All of these values have to be strings.129+ """The choice type allows a value to be checked against a fixed set130+ of supported values. All of these values have to be strings.131 132- You should only pass *choices* as list or tuple. Other iterables (like133- generators) may lead to surprising results.132+ You should only pass a list or tuple of choices. Other iterables133+ (like generators) may lead to surprising results.134 135 See :ref:`choice-opts` for an example.136 137- :param case_sensitive: Set to false to make choices case insensitive.138- Defaults to true.137+ :param case_sensitive: Set to false to make choices case138+ insensitive. Defaults to true.139 """140+141 name = 'choice'142 143 def __init__(self, choices, case_sensitive=True):144 self.choices = choices470 unmodified linesadded: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="https://pypi.org/project/click/">click @ PyPI</a></li> <li><a href="http://github.com/pallets/click">click @ github</a></li> <li><a href="http://github.com/pallets/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>modified:docs/changelog.rst+1 added-1 removed
1 .. currentmodule:: click2 3-.. include:: ../CHANGES3+.. include:: ../CHANGES.rstdeleted:docs/clickdoctools.py-282 removed
1-import os2-import sys3-import click4-import shutil5-import tempfile6-import contextlib7-import subprocess8-9-try:10- from StringIO import StringIO11-except ImportError:12- from io import StringIO13-14-from docutils import nodes15-from docutils.statemachine import ViewList16-17-from sphinx.domains import Domain18-from docutils.parsers.rst import Directive19-20-PY2 = sys.version_info[0] == 221-22-if PY2:23- text_type = unicode24-else:25- text_type = str26- 27-28-class EchoingStdin(object):29-30- def __init__(self, input, output):31- self._input = input32- self._output = output33-34- def __getattr__(self, x):35- return getattr(self._input, x)36-37- def _echo(self, rv):38- mark = False39- if rv.endswith('\xff'):40- rv = rv[:-1]41- mark = True42- self._output.write(rv)43- if mark:44- self._output.write('^D\n')45- return rv46-47- def read(self, n=-1):48- return self._echo(self._input.read(n))49-50- def readline(self, n=-1):51- return self._echo(self._input.readline(n))52-53- def readlines(self):54- return [self._echo(x) for x in self._input.readlines()]55-56- def __iter__(self):57- return iter(self._echo(x) for x in self._input)58-59-60-@contextlib.contextmanager61-def fake_modules():62- old_call = subprocess.call63- def dummy_call(*args, **kwargs):64- with tempfile.TemporaryFile('wb+') as f:65- kwargs['stdout'] = f66- kwargs['stderr'] = f67- rv = subprocess.Popen(*args, **kwargs).wait()68- f.seek(0)69- click.echo(f.read().decode('utf-8', 'replace').rstrip())70- return rv71- subprocess.call = dummy_call72- try:73- yield74- finally:75- subprocess.call = old_call76-77-78-@contextlib.contextmanager79-def isolation(input=None, env=None):80- if isinstance(input, text_type):81- input = input.encode('utf-8')82- input = StringIO(input or '')83- output = StringIO()84- sys.stdin = EchoingStdin(input, output)85- sys.stdin.encoding = 'utf-8'86-87- def visible_input(prompt=None):88- sys.stdout.write(prompt or '')89- val = input.readline().rstrip('\r\n')90- sys.stdout.write(val + '\n')91- sys.stdout.flush()92- return val93-94- def hidden_input(prompt=None):95- sys.stdout.write((prompt or '') + '\n')96- sys.stdout.flush()97- return input.readline().rstrip('\r\n')98-99- sys.stdout = output100- sys.stderr = output101- old_visible_prompt_func = click.termui.visible_prompt_func102- old_hidden_prompt_func = click.termui.hidden_prompt_func103- click.termui.visible_prompt_func = visible_input104- click.termui.hidden_prompt_func = hidden_input105-106- old_env = {}107- try:108- if env:109- for key, value in env.iteritems():110- old_env[key] = os.environ.get(value)111- os.environ[key] = value112- yield output113- finally:114- for key, value in old_env.iteritems():115- if value is None:116- try:117- del os.environ[key]118- except Exception:119- pass120- else:121- os.environ[key] = value122- sys.stdout = sys.__stdout__123- sys.stderr = sys.__stderr__124- click.termui.visible_prompt_func = old_visible_prompt_func125- click.termui.hidden_prompt_func = old_hidden_prompt_func126-127-128-@contextlib.contextmanager129-def isolated_filesystem():130- cwd = os.getcwd()131- t = tempfile.mkdtemp()132- os.chdir(t)133- try:134- yield135- finally:136- os.chdir(cwd)137- try:138- shutil.rmtree(t)139- except (OSError, IOError):140- pass141-142-143-class ExampleRunner(object):144-145- def __init__(self):146- self.namespace = {147- 'click': click,148- '__file__': 'dummy.py',149- }150-151- def declare(self, source):152- with fake_modules():153- code = compile(source, '<docs>', 'exec')154- eval(code, self.namespace)155-156- def run(self, source):157- code = compile(source, '<docs>', 'exec')158- buffer = []159-160- def invoke(cmd, args=None, prog_name=None,161- input=None, terminate_input=False, env=None,162- **extra):163- if env:164- for key, value in sorted(env.items()):165- if ' ' in value:166- value = '"%s"' % value167- buffer.append('$ export %s=%s' % (key, value))168- args = args or []169- if prog_name is None:170- prog_name = cmd.name.replace('_', '-')171- buffer.append(('$ %s %s' % (172- prog_name,173- ' '.join(('"%s"' % x) if ' ' in x else x for x in args)174- )).rstrip())175- if isinstance(input, (tuple, list)):176- input = '\n'.join(input) + '\n'177- if terminate_input:178- input += '\xff'179- with isolation(input=input, env=env) as output:180- try:181- cmd.main(args=args, prog_name=prog_name.split()[-1],182- **extra)183- except SystemExit:184- pass185- buffer.extend(output.getvalue().splitlines())186-187- def println(text=''):188- buffer.append(text)189-190- eval(code, self.namespace, {191- 'invoke': invoke,192- 'println': println,193- 'isolated_filesystem': isolated_filesystem,194- })195- return buffer196-197- def close(self):198- pass199-200-201-def parse_rst(state, content_offset, doc):202- node = nodes.section()203- # hack around title style bookkeeping204- surrounding_title_styles = state.memo.title_styles205- surrounding_section_level = state.memo.section_level206- state.memo.title_styles = []207- state.memo.section_level = 0208- state.nested_parse(doc, content_offset, node, match_titles=1)209- state.memo.title_styles = surrounding_title_styles210- state.memo.section_level = surrounding_section_level211- return node.children212-213-214-def get_example_runner(document):215- runner = getattr(document, 'click_example_runner', None)216- if runner is None:217- runner = document.click_example_runner = ExampleRunner()218- return runner219-220-221-class ExampleDirective(Directive):222- has_content = True223- required_arguments = 0224- optional_arguments = 0225- final_argument_whitespace = False226-227- def run(self):228- doc = ViewList()229- runner = get_example_runner(self.state.document)230- try:231- runner.declare('\n'.join(self.content))232- except:233- runner.close()234- raise235- doc.append('.. sourcecode:: python', '')236- doc.append('', '')237- for line in self.content:238- doc.append(' ' + line, '')239- return parse_rst(self.state, self.content_offset, doc)240-241-242-class RunExampleDirective(Directive):243- has_content = True244- required_arguments = 0245- optional_arguments = 0246- final_argument_whitespace = False247-248- def run(self):249- doc = ViewList()250- runner = get_example_runner(self.state.document)251- try:252- rv = runner.run('\n'.join(self.content))253- except:254- runner.close()255- raise256- doc.append('.. sourcecode:: text', '')257- doc.append('', '')258- for line in rv:259- doc.append(' ' + line, '')260- return parse_rst(self.state, self.content_offset, doc)261-262-263-class ClickDomain(Domain):264- name = 'click'265- label = 'Click'266- directives = {267- 'example': ExampleDirective,268- 'run': RunExampleDirective,269- }270-271-272-def delete_example_runner_state(app, doctree):273- runner = getattr(doctree, 'click_example_runner', None)274- if runner is not None:275- runner.close()276- del doctree.click_example_runner277-278-279-def setup(app):280- app.add_domain(ClickDomain)281-282- app.connect('doctree-read', delete_example_runner_state)modified:docs/conf.py+33 added-205 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, os15-import datetime3+# Project --------------------------------------------------------------4 17-# 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.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")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'%d, Armin Ronacher' % datetime.datetime.utcnow().year48-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 = 'default'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.18+html_theme = "click"19 html_theme_options = {20+ "index_sidebar_logo": False,21 }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.22+html_context = {23+ "project_links": [24+ ProjectLink("Donate to Pallets", "https://palletsprojects.com/donate"),25+ ProjectLink("Click Website", "https://palletsprojects.com/p/click/"),26+ ProjectLink("PyPI releases", "https://pypi.org/project/Click/"),27+ ProjectLink("Source Code", "https://github.com/pallets/click/"),28+ ProjectLink("Issue Tracker", "https://github.com/pallets/click/issues/"),29+ ]30+}31 html_sidebars = {136- 'index': ['sidebarintro.html', 'sourcelink.html', 'searchbox.html'],137- '**': ['sidebarlogo.html', 'localtoc.html', 'relations.html',138- 'sourcelink.html', 'searchbox.html']32+ "index": ["project.html", "versions.html", "searchbox.html"],33+ "**": ["localtoc.html", "relations.html", "versions.html", "searchbox.html"],34 }35+singlehtml_sidebars = {"index": ["project.html", "versions.html", "localtoc.html"]}36+html_static_path = ["_static"]37+html_favicon = "_static/click-icon.png"38+html_logo = "_static/click-logo-sidebar.png"39+html_show_sourcelink = False40+html_domain_indices = False41+html_experimental_html5_writer = True42 141-# Additional templates that should be rendered to pages, maps page names to142-# template names.143-#html_additional_pages = {}43+# LaTeX ----------------------------------------------------------------44 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]).45 latex_documents = [186- ('index', 'click.tex', u'click documentation',187- u'Armin Ronacher', 'manual'),46+ (master_doc, "Click.tex", "Click Documentation", "Pallets Team", "manual")47 ]189-190-# The name of an image file (relative to this directory) to place at the top of191-# the title page.192-#latex_logo = None193-194-# For "manual" documents, if this is true, then toplevel headings are parts,195-# not chapters.196-#latex_use_parts = False197-198-# Additional stuff for the LaTeX preamble.199-#latex_preamble = ''200-201-# Documents to append as an appendix to all manuals.202-#latex_appendices = []203-204-# If false, no module index is generated.205-#latex_domain_indices = True206-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-}modified: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 42 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)modified:docs/options.rst+2 added-2 removed
122 unmodified lines123 124 .. click:example::125 126 @click.command()127- @click.option('--item', type=(unicode, int))127+ @click.option('--item', type=(str, int))128 def putitem(item):129 click.echo('name=%s id=%d' % item)130 131 And on the command line:8 unmodified lines140 141 .. click:example::142 143 @click.command()144- @click.option('--item', nargs=2, type=click.Tuple([unicode, int]))144+ @click.option('--item', nargs=2, type=click.Tuple([str, int]))145 def putitem(item):146 click.echo('name=%s id=%d' % item)147 148 Multiple Options648 unmodified linesadded:docs/requirements.txt+2 added
1+Sphinx2+Pallets-Sphinx-Themesmodified:README.rst+22 added-22 removed
1 \$ click\_2 ==========3 4-What's Click?5--------------6-4 Click is a Python package for creating beautiful command line interfaces5 in a composable way with as little code as necessary. It's the "Command6 Line Interface Creation Kit". It's highly configurable but comes with7 sensible defaults out of the box.8 9 It aims to make the process of writing command line tools quick and fun13-while also preventing any frustration caused by the inability to implement14-an intended CLI API.10+while also preventing any frustration caused by the inability to11+implement an intended CLI API.12 13 Click in three points:17- - arbitrary nesting of commands18- - automatic help page generation19- - supports lazy loading of subcommands at runtime14 15+- arbitrary nesting of commands16+- automatic help page generation17+- supports lazy loading of subcommands at runtime18 19+20 Installing21 ----------22 23 Install and update using `pip`_:1 unmodified line25 .. code-block:: text26 27 $ pip install click28 31-Click supports Python 3.4 and newer, Python 2.7, and PyPy29+Click supports Python 3.4 and newer, Python 2.7, and PyPy.30 31+.. _pip: https://pip.pypa.io/en/stable/quickstart/32+33+34 A Simple Example35 ----------------36 37 What does it look like? Here is an example of a simple Click program:23 unmodified lines61 Hello John!62 Hello John!63 Hello John!64 65+66 Donate67 ------68 69 The Pallets organization develops and supports Flask and the libraries70 it uses. In order to grow the community of contributors and users, and71 allow the maintainers to devote more time to the projects, `please72 donate today`_.73 72-.. _please donate today: https://psfmember.org/civicrm/contribute/transact?reset=1&id=2074+.. _please donate today: https://palletsprojects.com/donate75 76 77 Links78 -----79 78-* Website: https://www.palletsprojects.com/p/click/79-* Documentation: http://click.pocoo.org/80-* License: `BSD <https://github.com/pallets/click/blob/master/LICENSE>`_81-* Releases: https://pypi.org/project/click/82-* Code: https://github.com/pallets/click83-* Issue tracker: https://github.com/pallets/click/issues84-* Test status:80+* Website: https://palletsprojects.com/p/click/81+* Documentation: https://click.palletsprojects.com/82+* License: `BSD <https://github.com/pallets/click/blob/master/LICENSE>`_83+* Releases: https://pypi.org/project/click/84+* Code: https://github.com/pallets/click85+* Issue tracker: https://github.com/pallets/click/issues86+* Test status:87 86- * Linux, Mac: https://travis-ci.org/pallets/click87- * Windows: https://ci.appveyor.com/project/pallets/click88+ * Linux, Mac: https://travis-ci.org/pallets/click89+ * Windows: https://ci.appveyor.com/project/pallets/click90 89-* Test coverage: https://codecov.io/gh/pallets/click90-91-.. _pip: https://pip.pypa.io/en/stable/quickstart/91+* Test coverage: https://codecov.io/gh/pallets/clickmodified:setup.py+3 added-1 removed
15 unmodified lines16 17 setup(18 name='click',19 version=version,20- url='https://www.palletsprojects.com/p/click/',20+ url='https://palletsprojects.com/p/click/',21 author='Armin Ronacher',22 author_email='armin.ronacher@active-4.com',23 maintainer='Pallets team',24 maintainer_email='contact@palletsprojects.com',10 unmodified lines35 'sphinx',36 ],37 'docs': [38 'sphinx',39+ 'Pallets-Sphinx-Themes',40 ]41 },42 classifiers=[43 'Development Status :: 5 - Production/Stable',6 unmodified lines50 'Programming Language :: Python :: 3',51 'Programming Language :: Python :: 3.4',52 'Programming Language :: Python :: 3.5',53 'Programming Language :: Python :: 3.6',54+ 'Programming Language :: Python :: 3.7',55 ],56 python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",57 )