Skip to content

Commit 152d117

Browse files
committed
Fixed rest of Markdown and got basic API documentation workign well
1 parent 7418560 commit 152d117

29 files changed

+375
-840
lines changed

docs/api/ansi.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
# cmd2.ansi
22

3-
TODO replace with mkdocstrings:
4-
5-
> ::: {.automodule members=""}
6-
> cmd2.ansi
7-
> :::
3+
::: cmd2.ansi

docs/api/argparse_completer.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# cmd2.argparse[completer]{#completer}
1+
# cmd2.argparse_completer
22

3-
TODO replace with mkdocstrings:
4-
5-
> ::: {.automodule members=""}
6-
> cmd2.argparse[completer]{#completer}
7-
> :::
3+
::: cmd2.argparse_completer

docs/api/argparse_custom.md

Lines changed: 2 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,3 @@
1-
# cmd2.argparse[custom]{#custom}
1+
# cmd2.argparse_custom
22

3-
TODO replace with mkdocstrings:
4-
5-
> ::: {.automodule members=""}
6-
> cmd2.argparse[custom]{#custom}
7-
> :::
8-
9-
## Added Accessor Methods
10-
11-
TODO replace with mkdocstrings:
12-
13-
> ::: autofunction
14-
> [action_get_choices_callable]{#action_get_choices_callable}
15-
> :::
16-
>
17-
> ::: autofunction
18-
> [action_set_choices_provider]{#action_set_choices_provider}
19-
> :::
20-
>
21-
> ::: autofunction
22-
> [action_set_completer]{#action_set_completer}
23-
> :::
24-
>
25-
> ::: autofunction
26-
> [action_get_descriptive_header]{#action_get_descriptive_header}
27-
> :::
28-
>
29-
> ::: autofunction
30-
> [action_set_descriptive_header]{#action_set_descriptive_header}
31-
> :::
32-
>
33-
> ::: autofunction
34-
> [action_get_nargs_range]{#action_get_nargs_range}
35-
> :::
36-
>
37-
> ::: autofunction
38-
> [action_set_nargs_range]{#action_set_nargs_range}
39-
> :::
40-
>
41-
> ::: autofunction
42-
> [action_get_suppress_tab_hint]{#action_get_suppress_tab_hint}
43-
> :::
44-
>
45-
> ::: autofunction
46-
> [action_set_suppress_tab_hint]{#action_set_suppress_tab_hint}
47-
> :::
48-
>
49-
> ::: autofunction
50-
> [ArgumentParser_get_ap_completer_type]{#argumentparser_get_ap_completer_type}
51-
> :::
52-
>
53-
> ::: autofunction
54-
> [ArgumentParser_set_ap_completer_type]{#argumentparser_set_ap_completer_type}
55-
> :::
56-
57-
## Subcommand Removal
58-
59-
TODO replace with mkdocstrings:
60-
61-
> ::: autofunction
62-
> [SubParsersAction_remove_parser]{#subparsersaction_remove_parser}
63-
> :::
3+
::: cmd2.argparse_custom

docs/api/cmd.md

Lines changed: 1 addition & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,3 @@
11
# cmd2.Cmd
22

3-
TODO replace with mkdocstrings:
4-
5-
> :::::::::::::::: {.autoclass members=""}
6-
> cmd2.Cmd
7-
>
8-
> ::: automethod
9-
> :::
10-
>
11-
> ::: attribute
12-
> default[error]{#error}
13-
>
14-
> The error message displayed when a non-existent command is run. Default: `{} is not a recognized command, alias, or macro.`
15-
> :::
16-
>
17-
> ::: attribute
18-
> help[error]{#error}
19-
>
20-
> The error message displayed to the user when they request help for a command with no help defined. Default: `No help on {}`
21-
> :::
22-
>
23-
> ::: attribute
24-
> prompt
25-
>
26-
> The prompt issued to solicit input. The default value is `(Cmd)`. See `features/prompt:Prompt`{.interpreted-text role="ref"} for more information.
27-
> :::
28-
>
29-
> ::: attribute
30-
> continuation[prompt]{#prompt}
31-
>
32-
> The prompt issued to solicit input for the 2nd and subsequent lines of a `multiline command <features/multiline_commands:Multiline Commands>`{.interpreted-text role="ref"} Default: `>`.
33-
> :::
34-
>
35-
> ::: attribute
36-
> echo
37-
>
38-
> If `True`, output the prompt and user input before executing the command. When redirecting a series of commands to an output file, this allows you to see the command in the output.
39-
> :::
40-
>
41-
> ::: attribute
42-
> settable
43-
>
44-
> This dictionary contains the name and description of all settings available to users.
45-
>
46-
> Users use the `features/builtin_commands:set`{.interpreted-text role="ref"} command to view and modify settings. Settings are stored in instance attributes with the same name as the setting.
47-
> :::
48-
>
49-
> ::: attribute
50-
> history
51-
>
52-
> A record of previously entered commands.
53-
>
54-
> This attribute is an instance of `cmd2.history.History`{.interpreted-text role="class"}, and each command is an instance of `cmd2.Statement`{.interpreted-text role="class"}.
55-
> :::
56-
>
57-
> ::: attribute
58-
> statement[parser]{#parser}
59-
>
60-
> An instance of `cmd2.parsing.StatementParser`{.interpreted-text role="class"} initialized and configured appropriately for parsing user input.
61-
> :::
62-
>
63-
> ::: attribute
64-
> intro
65-
>
66-
> Set an introduction message which is displayed to the user before the `features/hooks:Command Processing Loop`{.interpreted-text role="ref"} begins.
67-
> :::
68-
>
69-
> ::: attribute
70-
> py[bridge_name]{#bridge_name}
71-
>
72-
> The symbol name which `features/scripting:Python Scripts`{.interpreted-text role="ref"} run using the `features/builtin_commands:run_pyscript`{.interpreted-text role="ref"} command can use to reference the parent `cmd2` application.
73-
> :::
74-
>
75-
> ::: attribute
76-
> allow[clipboard]{#clipboard}
77-
>
78-
> If `True`, `cmd2` will allow output to be written to or appended to the operating system pasteboard. If `False`, this capability will not be allowed. See `features/clipboard:Clipboard Integration`{.interpreted-text role="ref"} for more information.
79-
> :::
80-
>
81-
> ::: attribute
82-
> suggest[similar_command]{#similar_command}
83-
>
84-
> If `True`, `cmd2` will attempt to suggest the most similar command when the user types a command that does not exist. Default: `False`.
85-
> :::
86-
> ::::::::::::::::
3+
::: cmd2.Cmd

docs/api/command_definition.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# cmd2.command[definition]{#definition}
1+
# cmd2.command_definition
22

3-
TODO replace with mkdocstrings:
4-
5-
> ::: {.automodule members=""}
6-
> cmd2.command[definition]{#definition}
7-
> :::
3+
::: cmd2.command_definition

docs/api/constants.md

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,3 @@
11
# cmd2.constants
22

3-
TODO replace with mkdocstrings:
4-
5-
> ::::: automodule
6-
> cmd2.constants
7-
>
8-
> ::: data
9-
> DEFAULT[SHORTCUTS]{#shortcuts}
10-
>
11-
> If you do not supply shortcuts to `cmd2.Cmd.__init__`{.interpreted-text role="meth"}, the shortcuts defined here will be used instead.
12-
> :::
13-
>
14-
> ::: data
15-
> COMMAND[NAME]{#name}
16-
>
17-
> Used by `cmd2.Cmd.disable_command`{.interpreted-text role="meth"} and `cmd2.Cmd.disable_category`{.interpreted-text role="meth"}. Those methods allow you to selectively disable single commands or an entire category of commands. Should you want to include the name of the command in the error message displayed to the user when they try and run a disabled command, you can include this constant in the message where you would like the name of the command to appear. `cmd2` will replace this constant with the name of the command the user tried to run before displaying the error message.
18-
>
19-
> This constant is imported into the package namespace; the preferred syntax to import and reference it is:
20-
>
21-
> import cmd2
22-
> errmsg = "The {} command is currently disabled.".format(cmd2.COMMAND_NAME)
23-
>
24-
> See `src/examples/help_categories.py` for an example.
25-
> :::
26-
> :::::
3+
::: cmd2.constants

docs/api/exceptions.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
11
# cmd2.exceptions
22

3-
Custom cmd2 exceptions
4-
5-
TODO replace with mkdocstrings:
6-
7-
> ::: {.autoclass members=""}
8-
> cmd2.exceptions.SkipPostcommandHooks
9-
> :::
10-
>
11-
> ::: {.autoclass members=""}
12-
> cmd2.exceptions.Cmd2ArgparseError
13-
> :::
14-
>
15-
> ::: {.autoclass members=""}
16-
> cmd2.exceptions.CommandSetRegistrationError
17-
> :::
18-
>
19-
> ::: {.autoclass members=""}
20-
> cmd2.exceptions.CompletionError
21-
> :::
22-
>
23-
> ::: {.autoclass members=""}
24-
> cmd2.exceptions.PassThroughException
25-
> :::
3+
::: cmd2.exceptions

docs/api/history.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
11
# cmd2.history
22

3-
Classes for storing the history of previously entered commands.
4-
5-
TODO replace with mkdocstrings:
6-
7-
> ::: {.autoclass members=""}
8-
> cmd2.history.History
9-
> :::
10-
>
11-
> ::::: {.autoclass members=""}
12-
> cmd2.history.HistoryItem
13-
>
14-
> ::: attribute
15-
> statement
16-
>
17-
> The `~cmd2.Statement`{.interpreted-text role="class"} object parsed from user input
18-
> :::
19-
>
20-
> ::: attribute
21-
> idx
22-
>
23-
> The 1-based index of this statement in the history list
24-
> :::
25-
> :::::
3+
::: cmd2.history

docs/api/index.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ If a release of this library changes any of the items documented here, the versi
1010

1111
This documentation is for `cmd2` version {{ version }}.
1212

13-
**Modules**
13+
## Modules
1414

15-
- `api/cmd:cmd2.Cmd`{.interpreted-text role="ref"} - functions and attributes of the main class in this library
16-
- `api/ansi:cmd2.ansi`{.interpreted-text role="ref"} - convenience classes and functions for generating ANSI escape sequences to style text in the terminal
17-
- `api/argparse_completer:cmd2.argparse_completer`{.interpreted-text role="ref"} - classes for `argparse`-based tab completion
18-
- `api/argparse_custom:cmd2.argparse_custom`{.interpreted-text role="ref"} - classes and functions for extending `argparse`
19-
- `api/command_definition:cmd2.command_definition`{.interpreted-text role="ref"} - supports the definition of commands in separate classes to be composed into cmd2.Cmd
20-
- `api/constants:cmd2.constants`{.interpreted-text role="ref"} - just like it says on the tin
21-
- `api/decorators:cmd2.decorators`{.interpreted-text role="ref"} - decorators for `cmd2` commands
22-
- `api/exceptions:cmd2.exceptions`{.interpreted-text role="ref"} - custom `cmd2` exceptions
23-
- `api/history:cmd2.history`{.interpreted-text role="ref"} - classes for storing the history of previously entered commands
24-
- `api/parsing:cmd2.parsing`{.interpreted-text role="ref"} - classes for parsing and storing user input
25-
- `api/plugin:cmd2.plugin`{.interpreted-text role="ref"} - data classes for hook methods
26-
- `api/py_bridge:cmd2.py_bridge`{.interpreted-text role="ref"} - classes for bridging calls from the embedded python environment to the host app
27-
- `api/table_creator:cmd2.table_creator`{.interpreted-text role="ref"} - table creation module
28-
- `api/utils:cmd2.utils`{.interpreted-text role="ref"} - various utility classes and functions
29-
- `api/plugin_external_test:cmd2_ext_test`{.interpreted-text role="ref"} - External test plugin
15+
- [cmd2.Cmd](./cmd.md) - functions and attributes of the main class in this library
16+
- [cmd2.ansi](./ansi.md) - convenience classes and functions for generating ANSI escape sequences to style text in the terminal
17+
- [cmd2.argparse_completer](./argparse_completer.md) - classes for `argparse`-based tab completion
18+
- [cmd2.argparse_custom](./argparse_custom.md) - classes and functions for extending `argparse`
19+
- [cmd2.command_definition](./command_definition.md) - supports the definition of commands in separate classes to be composed into cmd2.Cmd
20+
- [cmd2.constants](./constants.md) - just like it says on the tin
21+
- [cmd2.decorators](./decorators.md) - decorators for `cmd2` commands
22+
- [cmd2.exceptions](./exceptions.md) - custom `cmd2` exceptions
23+
- [cmd2.history](./history.md) - classes for storing the history of previously entered commands
24+
- [cmd2.parsing](./parsing.md) - classes for parsing and storing user input
25+
- [cmd2.plugin](./plugin.md) - data classes for hook methods
26+
- [cmd2.py_bridge](./py_bridge.md) - classes for bridging calls from the embedded python environment to the host app
27+
- [cmd2.table_creator](./table_creator.md) - table creation module
28+
- [cmd2.utils](./utils.md) - various utility classes and functions
29+
- [cmd2_ext_test](./plugin_external_test.md) - External test plugin

docs/api/parsing.md

Lines changed: 1 addition & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,3 @@
11
# cmd2.parsing
22

3-
Classes for parsing and storing user input.
4-
5-
TODO replace with mkdocstrings:
6-
7-
> :::: {.autoclass members=""}
8-
> cmd2.parsing.StatementParser
9-
>
10-
> ::: automethod
11-
> :::
12-
> ::::
13-
>
14-
> ::::::::::::: {.autoclass members=""}
15-
> cmd2.Statement
16-
>
17-
> ::: attribute
18-
> command
19-
>
20-
> The name of the command after shortcuts and macros have been expanded
21-
> :::
22-
>
23-
> ::: attribute
24-
> args
25-
>
26-
> The arguments to the command as a string with spaces between the words, excluding output redirection and command terminators. If the user used quotes in their input, they remain here, and you will have to handle them on your own.
27-
> :::
28-
>
29-
> ::: attribute
30-
> arg[list]{#list}
31-
>
32-
> The arguments to the command as a list, excluding output redirection and command terminators. Each argument is represented as an element in the list. Quoted arguments remain quoted. If you want to remove the quotes, use `cmd2.utils.strip_quotes`{.interpreted-text role="func"} or use `argv[1:]`
33-
> :::
34-
>
35-
> ::: attribute
36-
> raw
37-
>
38-
> If you want full access to exactly what the user typed at the input prompt you can get it, but you'll have to parse it on your own, including:
39-
>
40-
> > - shortcuts and aliases
41-
> > - quoted commands and arguments
42-
> > - output redirection
43-
> > - multi-line command terminator handling
44-
>
45-
> If you use multiline commands, all the input will be passed to you in this string, but there will be embedded newlines where the user hit return to continue the command on the next line.
46-
> :::
47-
>
48-
> ::: attribute
49-
> multiline[command]{#command}
50-
>
51-
> If the command is a multi-line command, the name of the command will be in this attribute. Otherwise, it will be an empty string.
52-
> :::
53-
>
54-
> ::: attribute
55-
> terminator
56-
>
57-
> If the command is a multi-line command, this attribute contains the termination character entered by the user to signal the end of input
58-
> :::
59-
>
60-
> ::: attribute
61-
> suffix
62-
>
63-
> Any characters present between the input terminator and the output redirection tokens.
64-
> :::
65-
>
66-
> ::: attribute
67-
> pipe[to]{#to}
68-
>
69-
> If the user piped the output to a shell command, this attribute contains the entire shell command as a string. Otherwise it is an empty string.
70-
> :::
71-
>
72-
> ::: attribute
73-
> output
74-
>
75-
> If output was redirected by the user, this contains the redirection token, i.e. `>>`.
76-
> :::
77-
>
78-
> ::: attribute
79-
> output[to]{#to}
80-
>
81-
> If output was redirected by the user, this contains the requested destination with quotes preserved.
82-
> :::
83-
> :::::::::::::
3+
::: cmd2.parsing

0 commit comments

Comments
 (0)