:bug: Fix docs format with hl_lines (#65)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sebastián Ramírez · committed by GitHub · parent 67ecde5 · Browse files · 3 files·+12 added−12 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+12 added−12 removed
- other:+12 added−12 removed
Provenance
- Commit
12eef05- Tree
3347795- Author
Sebastián Ramírez <tiangolo@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
67ecde5
3 files changed+12 added−12 removed
modified:docs/tutorial/subcommands/add-typer.md+2 added-2 removed
6 unmodified lines7891011111213141513 unmodified lines29303132333334353637132 unmodified linesExpand all6 unmodified linesLet's imagine that you are creating a *CLI program* to manage items in some distant land.
It could be in an `items.py` file with this:
```Python hl_lines=""```Python{!./src/subcommands/tutorial001/items.py!}```
And you would use it like:13 unmodified linesBut then you realize that you also have to manage users from your *CLI app*.
It could be a file `users.py` with something like:
```Python hl_lines=""```Python{!./src/subcommands/tutorial001/users.py!}```
And you would use it like:132 unmodified linesExpand allmodified:docs/tutorial/subcommands/nested-subcommands.md+9 added-9 removed
8 unmodified lines9 ## A CLI app for reigns10 11 Let's start with a file `reigns.py`:12 13-```Python hl_lines=""13+```Python14 {!./src/subcommands/tutorial003/reigns.py!}15 ```16 17 This is already a simple *CLI program* to manage reigns:30 unmodified lines48 ## A CLI app for towns49 50 And now the equivalent for managing towns in `towns.py`:51 52-```Python hl_lines=""52+```Python53 {!./src/subcommands/tutorial003/towns.py!}54 ```55 56 With it, you can manage towns:30 unmodified lines87 ## Manage the land in a CLI app88 89 Now let's put the `reigns` and `towns` together in the same *CLI program* in `lands.py`:90 91-```Python hl_lines=""91+```Python92 {!./src/subcommands/tutorial003/lands.py!}93 ```94 95 And now we have a single *CLI program* with a command (or command group) `reigns` that has its own commands. And another command `towns` with its own subcommands.147 unmodified lines243 Here are all the files if you want to review/copy them:244 245 `reigns.py`:246 247-```Python hl_lines=""247+```Python248 {!./src/subcommands/tutorial003/reigns.py!}249 ```250 251 `towns.py`:252 253-```Python hl_lines=""253+```Python254 {!./src/subcommands/tutorial003/towns.py!}255 ```256 257 `lands.py`:258 259-```Python hl_lines=""259+```Python260 {!./src/subcommands/tutorial003/lands.py!}261 ```262 263 `users.py`:264 265-```Python hl_lines=""265+```Python266 {!./src/subcommands/tutorial003/users.py!}267 ```268 269 `items.py`:270 271-```Python hl_lines=""271+```Python272 {!./src/subcommands/tutorial003/items.py!}273 ```274 275 `main.py`:276 277-```Python hl_lines=""277+```Python278 {!./src/subcommands/tutorial003/main.py!}279 ```280 281 !!! tip14 unmodified linesmodified:docs/tutorial/subcommands/single-file.md+1 added-1 removed
1 In some cases, it's possible that your application code needs to live on a single file.2 3 You can still use the same ideas:4 5-```Python hl_lines=""5+```Python6 {!./src/subcommands/tutorial002/main.py!}7 ```8 9 There are several things to notice here...139 unmodified lines