Skip to content
Myr

Make examples section nicer.

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

authored by unknown · committed by unknown · parent ce6e066 · Browse files · 1 file+14 added−26 removed
This commit

State

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

Diff stats

1 file+14 added−26 removed

  • other:+14 added−26 removed

1 file+14 added−26 removed

modified:docs/quickstart.rst+14 added-26 removed
62 unmodified lines
63 $ pip install click6465A few seconds later and you are good to go.6667Screencast and Examples67Examples68-----------------------6970There is a screencast available which shows the basic API of Click and71how to build simple applications with it. It also explores how to build72commands with subcommands.70Some stand alone examples of Click applications are packaged with Click. They are available in the `examples folder <https://github.com/pallets/click/tree/main/examples>`_ of the repo.7172* `inout <https://github.com/pallets/click/tree/main/examples/inout>`_ : A very simple example of an application that can read from files and write to files and also accept input from stdin or write to stdout.73* `validation <https://github.com/pallets/click/tree/main/examples/validation>`_ : A simple example of an application that performs custom validation of parameters in different ways.74* `naval <https://github.com/pallets/click/tree/main/examples/naval>`_ : Port of the `docopt <http://docopt.org/>`_ naval example.75* `colors <https://github.com/pallets/click/tree/main/examples/colors>`_ : A simple example that colorizes text. Uses colorama on Windows.76* `aliases <https://github.com/pallets/click/tree/main/examples/aliases>`_ : An advanced example that implements :ref:`aliases`.77* `imagepipe <https://github.com/pallets/click/tree/main/examples/imagepipe>`_ : A complex example that implements some :ref:`multi-command-chaining` . It chains together image processing instructions. Requires pillow.78* `repo <https://github.com/pallets/click/tree/main/examples/repo>`_ : An advanced example that implements a Git-/Mercurial-like command line interface.79* `complex <https://github.com/pallets/click/tree/main/examples/complex>`_ : A very advanced example that implements loading subcommands dynamically from a plugin folder.80* `termui <https://github.com/pallets/click/tree/main/examples/termui>`_ : A simple example that showcases terminal UI helpers provided by click.8182If you prefer video, an older screencast (2014) is available. It shows shows the basics of Click, how to build simple applications with it, and how to build commands with subcommands.8384* `Building Command Line Applications with Click85 <https://www.youtube.com/watch?v=kNke39OZ2k0>`_8677Examples of Click applications can be found in the documentation as well78as in the GitHub repository together with readme files:7980* ``inout``: `File input and output81 <https://github.com/pallets/click/tree/main/examples/inout>`_82* ``naval``: `Port of docopt naval example83 <https://github.com/pallets/click/tree/main/examples/naval>`_84* ``aliases``: `Command alias example85 <https://github.com/pallets/click/tree/main/examples/aliases>`_86* ``repo``: `Git-/Mercurial-like command line interface87 <https://github.com/pallets/click/tree/main/examples/repo>`_88* ``complex``: `Complex example with plugin loading89 <https://github.com/pallets/click/tree/main/examples/complex>`_90* ``validation``: `Custom parameter validation example91 <https://github.com/pallets/click/tree/main/examples/validation>`_92* ``colors``: `Color support demo93 <https://github.com/pallets/click/tree/main/examples/colors>`_94* ``termui``: `Terminal UI functions demo95 <https://github.com/pallets/click/tree/main/examples/termui>`_96* ``imagepipe``: `Multi command chaining demo97 <https://github.com/pallets/click/tree/main/examples/imagepipe>`_9887Basic Concepts - Creating a Command88-----------------------------------8990Click is based on declaring commands through decorators. Internally, there
178 unmodified lines