Skip to content

Commit 51ea4ba

Browse files
committed
Revise menu structure
- collapse menu structure in sidebar so not everything is always shown - updates to Getting Started section
1 parent 11da5ba commit 51ea4ba

11 files changed

Lines changed: 248 additions & 165 deletions

File tree

docs/api/index.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
API
2+
===
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
7+
cmd
8+
decorators
9+
exceptions
10+
utility_functions
11+
utility_classes

docs/examples/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Examples
2+
========
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
7+
quickstart

docs/features/index.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Features
2+
========
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
7+
generating_output
8+
argument_processing
9+
prompt
10+
help
11+
history
12+
startup_commands
13+
shortcuts_aliases_macros
14+
settings
15+
completion
16+
os
17+
multiline
18+
disable_commands
19+
clipboard
20+
transcript
21+
hooks
22+
plugins
23+
scripting
24+
embedded_python_shells

docs/index.rst

Lines changed: 14 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,16 @@ The basic use of ``cmd2`` is identical to that of cmd_.
2424
app.cmdloop()
2525

2626

27-
Overview
28-
--------
27+
Getting Started
28+
---------------
2929

30-
[create links with short descriptions to the various overview pages here]
30+
.. include:: overview/summary.rst
3131

3232
.. toctree::
3333
:maxdepth: 2
3434
:hidden:
35-
:caption: Overview
3635

37-
overview/featuretour
38-
overview/installation
39-
overview/alternatives
40-
overview/resources
41-
examples/quickstart
36+
overview/index
4237

4338

4439
Migrating from cmd
@@ -48,14 +43,8 @@ Migrating from cmd
4843

4944
.. toctree::
5045
:maxdepth: 2
51-
:hidden:
52-
:caption: Migrating from cmd
5346

54-
migrating/why
55-
migrating/incompatibilities
56-
migrating/minimum
57-
migrating/free_features
58-
migrating/nextsteps
47+
migrating/index
5948

6049

6150
Features
@@ -65,55 +54,28 @@ Features
6554

6655
.. toctree::
6756
:maxdepth: 2
68-
:hidden:
69-
:caption: Features
70-
71-
features/generating_output
72-
features/argument_processing
73-
features/prompt
74-
features/help
75-
features/history
76-
features/startup_commands
77-
features/shortcuts_aliases_macros
78-
features/settings
79-
features/completion
80-
features/os
81-
features/multiline
82-
features/disable_commands
83-
features/clipboard
84-
features/transcript
85-
features/hooks
86-
features/plugins
87-
features/scripting
88-
features/embedded_python_shells
8957

58+
features/index
9059

91-
Examples
92-
--------------------
9360

94-
[create links with short descriptions to the various examples pages here]
61+
API Reference
62+
-------------
9563

9664
.. toctree::
9765
:maxdepth: 2
98-
:hidden:
99-
:caption: Examples
10066

101-
examples/quickstart
67+
api/index
10268

10369

104-
API Reference
105-
-------------
70+
Examples
71+
--------------------
72+
73+
[create links with short descriptions to the various examples pages here]
10674

10775
.. toctree::
10876
:maxdepth: 2
109-
:hidden:
110-
:caption: API Reference
11177

112-
api/cmd
113-
api/decorators
114-
api/exceptions
115-
api/utility_functions
116-
api/utility_classes
78+
examples/index
11779

11880

11981
Meta

docs/migrating/index.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Migrating from cmd
2+
==================
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
7+
why
8+
incompatibilities
9+
minimum
10+
free_features
11+
nextsteps

docs/overview/alternatives.rst

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,55 @@
1-
============================
2-
Alternatives to cmd and cmd2
3-
============================
1+
Alternatives
2+
============
43

5-
For programs that do not interact with the user in a continuous loop -
6-
programs that simply accept a set of arguments from the command line, return
7-
results, and do not keep the user within the program's environment - all
8-
you need are sys_\ .argv (the command-line arguments) and argparse_
9-
(for parsing UNIX-style options and flags). Though some people may prefer docopt_
10-
or click_ to argparse_.
4+
For programs that do not interact with the user in a continuous loop - programs
5+
that simply accept a set of arguments from the command line, return results, and
6+
do not keep the user within the program's environment - all you need are sys_\
7+
.argv (the command-line arguments) and argparse_ (for parsing UNIX-style options
8+
and flags). Though some people may prefer docopt_ or click_ to argparse_.
119

1210
.. _sys: https://docs.python.org/3/library/sys.html
1311
.. _argparse: https://docs.python.org/3/library/argparse.html
1412
.. _docopt: https://pypi.python.org/pypi/docopt
1513
.. _click: http://click.pocoo.org
1614

1715

18-
The curses_ module produces applications that interact via a plaintext
19-
terminal window, but are not limited to simple text input and output;
20-
they can paint the screen with options that are selected from using the
21-
cursor keys. However, programming a curses_-based application is not as
22-
straightforward as using cmd_.
16+
The curses_ module produces applications that interact via a plaintext terminal
17+
window, but are not limited to simple text input and output; they can paint the
18+
screen with options that are selected from using the cursor keys. However,
19+
programming a curses_-based application is not as straightforward as using cmd_.
2320

2421
.. _curses: https://docs.python.org/3/library/curses.html
2522
.. _cmd: https://docs.python.org/3/library/cmd.html
2623

2724
Several Python packages exist for building interactive command-line applications
28-
approximately similar in concept to cmd_ applications. None of them
29-
share ``cmd2``'s close ties to cmd_, but they may be worth investigating
30-
nonetheless. Two of the most mature and full featured are:
25+
approximately similar in concept to cmd_ applications. None of them share
26+
``cmd2``'s close ties to cmd_, but they may be worth investigating nonetheless.
27+
Two of the most mature and full featured are:
3128

3229
* `Python Prompt Toolkit`_
3330
* Click_
3431

3532
.. _`Python Prompt Toolkit`: https://github.com/jonathanslenders/python-prompt-toolkit
3633

37-
`Python Prompt Toolkit`_ is a library for building powerful interactive command lines and terminal applications in
38-
Python. It provides a lot of advanced visual features like syntax highlighting, bottom bars, and the ability to
39-
create fullscreen apps.
34+
`Python Prompt Toolkit`_ is a library for building powerful interactive command
35+
lines and terminal applications in Python. It provides a lot of advanced visual
36+
features like syntax highlighting, bottom bars, and the ability to create
37+
fullscreen apps.
4038

41-
Click_ is a Python package for creating beautiful command line interfaces in a composable way with as little code as
42-
necessary. It is more geared towards command line utilities instead of command line interpreters, but it can be used
39+
Click_ is a Python package for creating beautiful command line interfaces in a
40+
composable way with as little code as necessary. It is more geared towards
41+
command line utilities instead of command line interpreters, but it can be used
4342
for either.
4443

45-
Getting a working command-interpreter application based on either `Python Prompt Toolkit`_ or Click_ requires a good
46-
deal more effort and boilerplate code than ``cmd2``. ``cmd2`` focuses on providing an excellent out-of-the-box experience
47-
with as many useful features as possible built in for free with as little work required on the developer's part as
48-
possible. We believe that ``cmd2`` provides developers the easiest way to write a command-line interpreter, while
49-
allowing a good experience for end users. If you are seeking a visually richer end-user experience and don't
50-
mind investing more development time, we would recommend checking out `Python Prompt Toolkit`_.
51-
52-
In the future, we may investigate options for incorporating the usage of `Python Prompt Toolkit`_ and/or Click_ into
53-
``cmd2`` applications.
44+
Getting a working command-interpreter application based on either `Python Prompt
45+
Toolkit`_ or Click_ requires a good deal more effort and boilerplate code than
46+
``cmd2``. ``cmd2`` focuses on providing an excellent out-of-the-box experience
47+
with as many useful features as possible built in for free with as little work
48+
required on the developer's part as possible. We believe that ``cmd2`` provides
49+
developers the easiest way to write a command-line interpreter, while allowing a
50+
good experience for end users. If you are seeking a visually richer end-user
51+
experience and don't mind investing more development time, we would recommend
52+
checking out `Python Prompt Toolkit`_.
53+
54+
In the future, we may investigate options for incorporating the usage of `Python
55+
Prompt Toolkit`_ and/or Click_ into ``cmd2`` applications.

docs/overview/featuretour.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
Features
2-
========
3-
4-
Briefly describe the list of major features, linking to the more detailed description
5-
of each features elsewhere in the documentation.
1+
Feature Highlights
2+
==================
63

4+
[Briefly describe the list of major features, linking to the more detailed description
5+
of each features elsewhere in the documentation.]

docs/overview/index.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Getting Started
2+
===============
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
:hidden:
7+
8+
featuretour
9+
installation
10+
integrating
11+
alternatives
12+
resources
13+
../examples/quickstart
14+
15+
.. include:: summary.rst

0 commit comments

Comments
 (0)