diff --git a/README.md b/README.md
index 87b5f03118..80b0b20ebd 100644
--- a/README.md
+++ b/README.md
@@ -6,24 +6,24 @@
Typer, build great CLIs. Easy to code. Based on Python type hints.
@@ -354,9 +354,9 @@ For a more complete example including more features, see the
Click: a popular tool for building CLIs in Python. Typer is based on it.
-*
rich: to show nicely formatted errors automatically.
-*
shellingham: to automatically detect the current shell when installing completion.
+* [Click](https://click.palletsprojects.com/): a popular tool for building CLIs in Python. Typer is based on it.
+* [`rich`](https://rich.readthedocs.io/en/stable/index.html): to show nicely formatted errors automatically.
+* [`shellingham`](https://github.com/sarugaku/shellingham): to automatically detect the current shell when installing completion.
### `typer-slim`
diff --git a/docs/alternatives.md b/docs/alternatives.md
index 1f1b7904de..9b7a1882b2 100644
--- a/docs/alternatives.md
+++ b/docs/alternatives.md
@@ -10,7 +10,7 @@ There have been many tools created before that have helped inspire its creation.
## Previous tools
-###
`argparse`
+### [`argparse`](https://docs.python.org/3/library/argparse.html)
`argparse` is the Python standard library's module to write CLIs.
@@ -22,7 +22,7 @@ Provide a better development experience than just reading *CLI Parameters* by ha
///
-###
Hug
+### [Hug](https://hugapi.github.io/hug/)
Hug is a library to create APIs and CLIs, it uses parameters in functions to declare the required data.
@@ -34,7 +34,7 @@ Use function parameters to declare *CLI arguments* and *CLI options* as it simpl
///
-###
Plac
+### [Plac](https://plac.readthedocs.io/en/latest/)
Plac is another library to create CLIs using parameters in functions, similar to Hug.
@@ -44,7 +44,7 @@ Provide a simple way to use a function as a command line app, without having to
///
-###
Pydantic
+### [Pydantic](https://pydantic-docs.helpmanual.io/)
Pydantic is a library to handle data validation using standard modern Python type annotations.
@@ -58,7 +58,7 @@ Use standard Python type annotations to declare types instead of library-specifi
///
-###
Click
+### [Click](https://click.palletsprojects.com)
Click is one of the most widely used libraries to create CLIs in Python.
@@ -76,11 +76,11 @@ Everything. π
**Typer** mainly adds a layer on top of Click, making the code simpler and easier to use, with autocompletion everywhere, etc, but providing all the powerful features of Click underneath.
-As someone pointed out:
"Nice to see it is built on Click but adds the type stuff. Me gusta!"
+As someone pointed out:
["Nice to see it is built on Click but adds the type stuff. Me gusta!"](https://twitter.com/fishnets88/status/1210126833745838080)
///
-###
`click-completion`
+### [`click-completion`](https://github.com/click-contrib/click-completion)
`click-completion` is a plug-in for Click. It was created to extend completion support for shells when Click only had support for Bash completion.
@@ -94,9 +94,9 @@ Provide auto completion for all the shells.
///
-###
FastAPI
+### [FastAPI](https://fastapi.tiangolo.com/)
-I created **FastAPI** to provide an easy way to build APIs with autocompletion for everything in the code (and some other
features).
+I created **FastAPI** to provide an easy way to build APIs with autocompletion for everything in the code (and some other [features](https://fastapi.tiangolo.com/features/)).
**Typer** is the "FastAPI of CLIs".
diff --git a/docs/contributing.md b/docs/contributing.md
index f7cbb5badd..33ad5472e3 100644
--- a/docs/contributing.md
+++ b/docs/contributing.md
@@ -1,10 +1,10 @@
# Development - Contributing
-First, you might want to see the basic ways to [help Typer and get help](help-typer.md){.internal-link target=_blank}.
+First, you might want to see the basic ways to [help Typer and get help](help-typer.md).
## Developing
-If you already cloned the
typer repository and you want to deep dive in the code, here are some guidelines to set up your environment.
+If you already cloned the [typer repository](https://github.com/fastapi/typer) and you want to deep dive in the code, here are some guidelines to set up your environment.
### Install Requirements Using `uv`
@@ -253,7 +253,7 @@ $ mkdocs serve --dev-addr 8008
The instructions here show you how to use the script at `./scripts/docs.py` with the `python` program directly.
-But you can also use
Typer CLI, and you will get autocompletion in your terminal for the commands after installing completion.
+But you can also use [Typer CLI](https://typer.tiangolo.com/typer-cli/), and you will get autocompletion in your terminal for the commands after installing completion.
If you install Typer CLI, you can install completion with:
@@ -270,7 +270,7 @@ Completion will take effect once you restart the terminal.
### Docs Structure
-The documentation uses
MkDocs.
+The documentation uses [MkDocs](https://www.mkdocs.org/).
And there are extra tools/scripts in place in `./scripts/docs.py`.
@@ -316,7 +316,7 @@ The same applies to comments and descriptions, please don't copy paste the conte
### Human Effort Denial of Service
-Using automated tools and AI to submit PRs or comments that we have to carefully review and handle would be the equivalent of a
Denial-of-service attack on our human effort.
+Using automated tools and AI to submit PRs or comments that we have to carefully review and handle would be the equivalent of a [Denial-of-service attack](https://en.wikipedia.org/wiki/Denial-of-service_attack) on our human effort.
It would be very little effort from the person submitting the PR (an LLM prompt) that generates a large amount of effort on our side (carefully reviewing code).
diff --git a/docs/environment-variables.md b/docs/environment-variables.md
index d1dab46313..f351b4aab7 100644
--- a/docs/environment-variables.md
+++ b/docs/environment-variables.md
@@ -67,7 +67,7 @@ print(f"Hello {name} from Python")
/// tip
-The second argument to
`os.getenv()` is the default value to return.
+The second argument to [`os.getenv()`](https://docs.python.org/3.8/library/os.html#os.getenv) is the default value to return.
If not provided, it's `None` by default, here we provide `"World"` as the default value to use.
@@ -155,7 +155,7 @@ Hello World from Python
/// tip
-You can read more about it at
The Twelve-Factor App: Config.
+You can read more about it at [The Twelve-Factor App: Config](https://12factor.net/config).
///
@@ -165,7 +165,7 @@ These environment variables can only handle **text strings**, as they are extern
That means that **any value** read in Python from an environment variable **will be a `str`**, and any conversion to a different type or any validation has to be done in code.
-You will learn more about using environment variables for your
CLI applications later in the section about [CLI Arguments with Environment Variables](./tutorial/arguments/envvar.md){.internal-link target=_blank}.
+You will learn more about using environment variables for your
CLI applications later in the section about [CLI Arguments with Environment Variables](./tutorial/arguments/envvar.md).
## `PATH` Environment Variable
@@ -283,7 +283,7 @@ $ C:\opt\custompython\bin\python
////
-This information will be useful when learning about [Virtual Environments](virtual-environments.md){.internal-link target=_blank}.
+This information will be useful when learning about [Virtual Environments](virtual-environments.md).
It will also be useful when you **create your own CLI programs** as, for them to be available for your users, they will need to be somewhere in the `PATH` environment variable.
@@ -291,7 +291,7 @@ It will also be useful when you **create your own CLI programs** as, for them to
With this you should have a basic understanding of what **environment variables** are and how to use them in Python.
-You can also read more about them in the
Wikipedia for Environment Variable.
+You can also read more about them in the [Wikipedia for Environment Variable](https://en.wikipedia.org/wiki/Environment_variable).
In many cases it's not very obvious how environment variables would be useful and applicable right away. But they keep showing up in many different scenarios when you are developing, so it's good to know about them.
diff --git a/docs/features.md b/docs/features.md
index e8e7f46195..bd11fa5a9d 100644
--- a/docs/features.md
+++ b/docs/features.md
@@ -2,9 +2,9 @@
## Design based on **FastAPI**
-

+

-**Typer** is
FastAPI's little sibling.
+**Typer** is [FastAPI](https://fastapi.tiangolo.com)'s little sibling.
It follows the same design and ideas. If you know **FastAPI**, you already know **Typer**... more or less.
@@ -12,9 +12,9 @@ It follows the same design and ideas. If you know **FastAPI**, you already know
It's all based on standard **Python type** declarations. No new syntax to learn. Just standard modern Python.
-If you need a 2 minute refresher of how to use Python types (even if you don't use FastAPI or Typer), check the FastAPI tutorial section:
Python types intro.
+If you need a 2 minute refresher of how to use Python types (even if you don't use FastAPI or Typer), check the FastAPI tutorial section: [Python types intro](https://fastapi.tiangolo.com/python-types/).
-You will also see a 20 seconds refresher on the section [Tutorial - User Guide: First Steps](tutorial/first-steps.md){.internal-link target=_blank}.
+You will also see a 20 seconds refresher on the section [Tutorial - User Guide: First Steps](tutorial/first-steps.md).
## Editor support
@@ -24,11 +24,11 @@ You will rarely need to come back to the docs.
Here's how your editor might help you:
-* in
Visual Studio Code:
+* in [Visual Studio Code](https://code.visualstudio.com/):

-* in
PyCharm:
+* in [PyCharm](https://www.jetbrains.com/pycharm/):

diff --git a/docs/help-typer.md b/docs/help-typer.md
index a80d8c9288..b0c21ff66e 100644
--- a/docs/help-typer.md
+++ b/docs/help-typer.md
@@ -12,7 +12,7 @@ And there are several ways to get help too.
## Subscribe to the newsletter
-You can subscribe to the (infrequent) [**FastAPI and friends** newsletter](/newsletter/){.internal-link target=_blank} to stay updated about:
+You can subscribe to the (infrequent) [**FastAPI and friends** newsletter](/newsletter/) to stay updated about:
* News about FastAPI and friends, including Typer π
* Guides π
@@ -22,13 +22,13 @@ You can subscribe to the (infrequent) [**FastAPI and friends** newsletter](/news
## Star **Typer** in GitHub
-You can "star" Typer in GitHub (clicking the star button at the top right):
https://github.com/fastapi/typer.
+You can "star" Typer in GitHub (clicking the star button at the top right): [https://github.com/fastapi/typer](https://github.com/fastapi/typer).
By adding a star, other users will be able to find it more easily and see that it has been already useful for others.
## Watch the GitHub repository for releases
-You can "watch" Typer in GitHub (clicking the "watch" button at the top right):
https://github.com/fastapi/typer.
+You can "watch" Typer in GitHub (clicking the "watch" button at the top right): [https://github.com/fastapi/typer](https://github.com/fastapi/typer).
There you can select "Releases only".
@@ -36,25 +36,25 @@ By doing it, you will receive notifications (in your email) whenever there's a n
## Connect with the author
-You can connect with
me (SebastiΓ‘n RamΓrez / `tiangolo`), the author.
+You can connect with [me (SebastiΓ‘n RamΓrez / `tiangolo`)](https://tiangolo.com), the author.
You can:
-*
Follow me on **GitHub**.
+* [Follow me on **GitHub**](https://github.com/tiangolo).
* See other Open Source projects I have created that could help you.
* Follow me to see when I create a new Open Source project.
-*
Follow me on **Twitter**.
+* [Follow me on **Twitter**](https://twitter.com/tiangolo).
* Tell me how you use Typer (I love to hear that).
* Hear when I make announcements or release new tools.
-*
Connect with me on **Linkedin**.
+* [Connect with me on **Linkedin**](https://www.linkedin.com/in/tiangolo/).
* Hear when I make announcements or release new tools (although I use Twitter more often π€·ββ).
-* Read what I write (or follow me) on
**Dev.to** or
**Medium**.
+* Read what I write (or follow me) on [**Dev.to**](https://dev.to/tiangolo) or [**Medium**](https://medium.com/@tiangolo).
* Read other ideas, articles, and read about tools I have created.
* Follow me to read when I publish something new.
## Tweet about **Typer**
-
Tweet about **Typer** and let me and others know why you like it.
+[Tweet about **Typer**](https://twitter.com/compose/tweet?text=I'm loving Typer because... https://github.com/fastapi/typer cc @tiangolo) and let me and others know why you like it.
I love to hear about how **Typer** is being used, what have you liked in it, in which project/company you are using it, etc.
@@ -62,8 +62,8 @@ I love to hear about how **Typer** is being used, what have you liked in it, in
You can try and help others with their questions in:
-*
GitHub Discussions
-*
GitHub Issues
+* [GitHub Discussions](https://github.com/fastapi/typer/discussions/categories/questions?discussions_q=category%3AQuestions+is%3Aunanswered)
+* [GitHub Issues](https://github.com/fastapi/typer/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Aquestion+-label%3Aanswered+)
In many cases you might already know the answer for those questions. π€
@@ -91,7 +91,7 @@ For most of the cases and most of the questions there's something related to the
In many cases they will only copy a fragment of the code, but that's not enough to **reproduce the problem**.
-* You can ask them to provide a
minimal, reproducible, example, that you can **copy-paste** and run locally to see the same error or behavior they are seeing, or to understand their use case better.
+* You can ask them to provide a [minimal, reproducible, example](https://stackoverflow.com/help/minimal-reproducible-example), that you can **copy-paste** and run locally to see the same error or behavior they are seeing, or to understand their use case better.
* If you are feeling too generous, you can try to **create an example** like that yourself, just based on the description of the problem. Just have in mind that this might take a lot of time and it might be better to ask them to clarify the problem first.
@@ -112,7 +112,7 @@ If they reply, there's a high chance you would have solved their problem, congra
## Watch the GitHub repository
-You can "watch" Typer in GitHub (clicking the "watch" button at the top right):
https://github.com/fastapi/typer.
+You can "watch" Typer in GitHub (clicking the "watch" button at the top right): [https://github.com/fastapi/typer](https://github.com/fastapi/typer).
If you select "Watching" instead of "Releases only" you will receive notifications when someone creates a new issue or question. You can also specify that you only want to be notified about new issues, or discussions, or PRs, etc.
@@ -120,7 +120,7 @@ Then you can try and help them solve those questions.
## Ask Questions
-You can
create a new question in the GitHub repository, for example to:
+You can [create a new question](https://github.com/fastapi/typer/discussions/new?category=questions) in the GitHub repository, for example to:
* Ask a **question** or ask about a **problem**.
* Suggest a new **feature**.
@@ -183,7 +183,7 @@ So, it's really important that you actually read and run the code, and let me kn
## Create a Pull Request
-You can [contribute](contributing.md){.internal-link target=_blank} to the source code with Pull Requests, for example:
+You can [contribute](contributing.md) to the source code with Pull Requests, for example:
* To fix a typo you found on the documentation.
* To propose new documentation sections.
@@ -201,8 +201,8 @@ There's a lot of work to do, and for most of it, **YOU** can do it.
The main tasks that you can do right now are:
-* [Help others with questions in GitHub](#help-others-with-questions-in-github){.internal-link target=_blank} (see the section above).
-* [Review Pull Requests](#review-pull-requests){.internal-link target=_blank} (see the section above).
+* [Help others with questions in GitHub](#help-others-with-questions-in-github) (see the section above).
+* [Review Pull Requests](#review-pull-requests) (see the section above).
Those two tasks are what **consume time the most**. That's the main work of maintaining Typer.
@@ -210,11 +210,11 @@ If you can help me with that, **you are helping me maintain Typer** and making s
## Join the chat
-Join the π₯
FastAPI and Friends Discord chat server π₯ and hang out with others in the community. There's a `#typer` channel.
+Join the π₯ [FastAPI and Friends Discord chat server](https://discord.gg/VQjSZaeJmf) π₯ and hang out with others in the community. There's a `#typer` channel.
/// tip
-For questions, ask them in
GitHub Discussions, there's a much better chance you will receive help there.
+For questions, ask them in [GitHub Discussions](https://github.com/fastapi/typer/discussions/new?category=questions), there's a much better chance you will receive help there.
Use the chat only for other general conversations.
@@ -232,7 +232,7 @@ On the other side, there are thousands of users in the chat, so there's a high c
## Sponsor the author
-You can also financially support the author (me) through
GitHub sponsors.
+You can also financially support the author (me) through [GitHub sponsors](https://github.com/sponsors/tiangolo).
There you could buy me a coffee βοΈ to say thanks. π
@@ -242,7 +242,7 @@ As you have seen in the documentation, Typer is built on top of Click.
You can also sponsor:
-* Pallets Project (Click maintainers)
via the PSF or
via Tidelift
+* Pallets Project (Click maintainers) [via the PSF](https://palletsprojects.com/donate) or [via Tidelift](https://tidelift.com/subscription/pkg/pypi-click)
---
diff --git a/docs/index.md b/docs/index.md
index 0e71eab196..314fc921ee 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -12,24 +12,24 @@
Typer, build great CLIs. Easy to code. Based on Python type hints.
-
+
-
+
-
+
-
+
---
-**Documentation**:
https://typer.tiangolo.com
+**Documentation**: [https://typer.tiangolo.com](https://typer.tiangolo.com)
-**Source Code**:
https://github.com/fastapi/typer
+**Source Code**: [https://github.com/fastapi/typer](https://github.com/fastapi/typer)
---
@@ -48,11 +48,11 @@ The key features are:
## FastAPI of CLIs
-**Typer** is
FastAPI's little sibling, it's the FastAPI of CLIs.
+**Typer** is [FastAPI](https://fastapi.tiangolo.com)'s little sibling, it's the FastAPI of CLIs.
## Installation
-Create and activate a
virtual environment and then install **Typer**:
+Create and activate a [virtual environment](https://typer.tiangolo.com/virtual-environments/) and then install **Typer**:
@@ -360,9 +360,9 @@ For a more complete example including more features, see the
Click: a popular tool for building CLIs in Python. Typer is based on it.
-*
rich: to show nicely formatted errors automatically.
-*
shellingham: to automatically detect the current shell when installing completion.
+* [Click](https://click.palletsprojects.com/): a popular tool for building CLIs in Python. Typer is based on it.
+* [`rich`](https://rich.readthedocs.io/en/stable/index.html): to show nicely formatted errors automatically.
+* [`shellingham`](https://github.com/sarugaku/shellingham): to automatically detect the current shell when installing completion.
### `typer-slim`
diff --git a/docs/management-tasks.md b/docs/management-tasks.md
index cede9f3088..0b38bb9d91 100644
--- a/docs/management-tasks.md
+++ b/docs/management-tasks.md
@@ -1,6 +1,6 @@
# Repository Management Tasks
-These are the tasks that can be performed to manage the Typer repository by [team members](./management.md#team){.internal-link target=_blank}.
+These are the tasks that can be performed to manage the Typer repository by [team members](./management.md#team).
/// tip
@@ -8,9 +8,9 @@ This section is useful only to a handful of people, team members with permission
///
-...so, you are a [team member of Typer](./management.md#team){.internal-link target=_blank}? Wow, you are so cool! π
+...so, you are a [team member of Typer](./management.md#team)? Wow, you are so cool! π
-You can help with everything on [Help Typer - Get Help](./help-typer.md){.internal-link target=_blank} the same ways as external contributors. But additionally, there are some tasks that only you (as part of the team) can perform.
+You can help with everything on [Help Typer - Get Help](./help-typer.md) the same ways as external contributors. But additionally, there are some tasks that only you (as part of the team) can perform.
Here are the general instructions for the tasks you can perform.
@@ -40,22 +40,22 @@ For conversations that are more difficult, for example to reject a PR, you can a
## Edit PR Titles
-* Edit the PR title to start with an emoji from
gitmoji.
+* Edit the PR title to start with an emoji from [gitmoji](https://gitmoji.dev/).
* Use the emoji character, not the GitHub code. So, use `π` instead of `:bug:`. This is so that it shows up correctly outside of GitHub, for example in the release notes.
* Start the title with a verb. For example `Add`, `Refactor`, `Fix`, etc. This way the title will say the action that the PR does. Like `Add support for teleporting`, instead of `Teleporting wasn't working, so this PR fixes it`.
* Edit the text of the PR title to start in "imperative", like giving an order. So, instead of `Adding support for teleporting` use `Add support for teleporting`.
* Try to make the title descriptive about what it achieves. If it's a feature, try to describe it, for example `Add support for teleporting` instead of `Create TeleportAdapter class`.
* Do not finish the title with a period (`.`).
-Once the PR is merged, a GitHub Action (
latest-changes) will use the PR title to update the latest changes automatically.
+Once the PR is merged, a GitHub Action ([latest-changes](https://github.com/tiangolo/latest-changes)) will use the PR title to update the latest changes automatically.
So, having a nice PR title will not only look nice in GitHub, but also in the release notes. π
## Add Labels to PRs
-The same GitHub Action
latest-changes uses one label in the PR to decide the section in the release notes to put this PR in.
+The same GitHub Action [latest-changes](https://github.com/tiangolo/latest-changes) uses one label in the PR to decide the section in the release notes to put this PR in.
-Make sure you use a supported label from the
latest-changes list of labels:
+Make sure you use a supported label from the [latest-changes list of labels](https://github.com/tiangolo/latest-changes#using-labels):
* `breaking`: Breaking Changes
* Existing code will break if they update the version without changing their code. This rarely happens, so this label is not frequently used.
@@ -114,4 +114,4 @@ Dependabot will create PRs to update dependencies for several things, and those
When a question in GitHub Discussions has been answered, mark the answer by clicking "Mark as answer".
-You can filter discussions by
`Questions` that are `Unanswered`.
+You can filter discussions by [`Questions` that are `Unanswered`](https://github.com/fastapi/typer/discussions/categories/questions?discussions_q=category:Questions+is:open+is:unanswered).
diff --git a/docs/management.md b/docs/management.md
index 5c1f66e90c..46e8303b56 100644
--- a/docs/management.md
+++ b/docs/management.md
@@ -4,15 +4,15 @@ Here's a short description of how the Typer repository is managed and maintained
## Owner
-I,
@tiangolo, am the creator and owner of the Typer repository. π€
+I, [@tiangolo](https://github.com/tiangolo), am the creator and owner of the Typer repository. π€
-I normally give the final review to each PR before merging them. I make the final decisions on the project, I'm the
BDFL. π
+I normally give the final review to each PR before merging them. I make the final decisions on the project, I'm the [
BDFL](https://en.wikipedia.org/wiki/Benevolent_dictator_for_life). π
## Team
There's a team of people that help manage and maintain the project. π
-They have different levels of permissions and [specific instructions](./management-tasks.md){.internal-link target=_blank}.
+They have different levels of permissions and [specific instructions](./management-tasks.md).
Some of the tasks they can perform include:
@@ -31,7 +31,7 @@ This is the current list of team members. π
{% for user in members["members"] %}
-
+
{% endfor %}
@@ -42,4 +42,4 @@ Additional to them, there's a large community of people helping each other and g
External contributions are very welcome and appreciated, including answering questions, submitting PRs, etc. πββοΈ
-There are many ways to [help maintain Typer](./help-typer.md){.internal-link target=_blank}.
+There are many ways to [help maintain Typer](./help-typer.md).
diff --git a/docs/tutorial/app-dir.md b/docs/tutorial/app-dir.md
index d85ec31f52..e79fcc9587 100644
--- a/docs/tutorial/app-dir.md
+++ b/docs/tutorial/app-dir.md
@@ -32,7 +32,7 @@ If the first element is a `Path` object the next ones (after the `/`) can be `st
And it will create a new `Path` object from that.
-If you want a quick guide on using `Path()` you can check
this post on Real Python or
this post by Trey Hunner.
+If you want a quick guide on using `Path()` you can check [this post on Real Python](https://realpython.com/python-pathlib/) or [this post by Trey Hunner](https://treyhunner.com/2018/12/why-you-should-be-using-pathlib/).
In the code above, we are also explicitly declaring `config_path` as having type `Path` to help the editor provide completion and type checks:
diff --git a/docs/tutorial/arguments/envvar.md b/docs/tutorial/arguments/envvar.md
index 1638b5e720..53d04c9862 100644
--- a/docs/tutorial/arguments/envvar.md
+++ b/docs/tutorial/arguments/envvar.md
@@ -4,7 +4,7 @@ You can also configure a *CLI argument* to read a value from an environment vari
/// tip
-You can learn more about environment variables in the [Environment Variables](../../environment-variables.md){.internal-link target=_blank} page.
+You can learn more about environment variables in the [Environment Variables](../../environment-variables.md) page.
///
diff --git a/docs/tutorial/arguments/help.md b/docs/tutorial/arguments/help.md
index bea2c85ced..74452f5d14 100644
--- a/docs/tutorial/arguments/help.md
+++ b/docs/tutorial/arguments/help.md
@@ -185,7 +185,7 @@ Options:
You might want to show the help information for *CLI arguments* in different panels when using the `--help` option.
-If you have installed Rich as described in the docs for [Printing and Colors](../printing.md){.internal-link target=_blank}, you can set the `rich_help_panel` parameter to the name of the panel where you want this *CLI argument* to be shown:
+If you have installed Rich as described in the docs for [Printing and Colors](../printing.md), you can set the `rich_help_panel` parameter to the name of the panel where you want this *CLI argument* to be shown:
{* docs_src/arguments/help/tutorial007_an_py310.py hl[12,16] *}
@@ -220,7 +220,7 @@ In this example we have a custom *CLI arguments* panel named "`Secondary Argumen
## Help with style using Rich
-In a future section you will see how to use custom markup in the `help` for *CLI arguments* when reading about [Commands - Command Help](../commands/help.md#rich-markdown-and-markup){.internal-link target=_blank}.
+In a future section you will see how to use custom markup in the `help` for *CLI arguments* when reading about [Commands - Command Help](../commands/help.md#rich-markdown-and-markup).
If you are in a hurry you can jump there, but otherwise, it would be better to continue reading here and following the tutorial in order.
diff --git a/docs/tutorial/arguments/optional.md b/docs/tutorial/arguments/optional.md
index 8bc1e736ca..83cab5cece 100644
--- a/docs/tutorial/arguments/optional.md
+++ b/docs/tutorial/arguments/optional.md
@@ -33,7 +33,7 @@ __init__.py test_tutorial
## An alternative *CLI argument* declaration
-In the [First Steps](../first-steps.md#add-a-cli-argument){.internal-link target=_blank} you saw how to add a *CLI argument*:
+In the [First Steps](../first-steps.md#add-a-cli-argument) you saw how to add a *CLI argument*:
{* docs_src/first_steps/tutorial002_py310.py hl[4] *}
@@ -211,7 +211,7 @@ name: str = typer.Argument(default=...)
/// info
-If you hadn't seen that `...` before: it is a special single value, it is
part of Python and is called "Ellipsis".
+If you hadn't seen that `...` before: it is a special single value, it is [part of Python and is called "Ellipsis"](https://docs.python.org/3/library/constants.html#Ellipsis).
///
diff --git a/docs/tutorial/commands/context.md b/docs/tutorial/commands/context.md
index 1fd6edfea6..190a2b08c2 100644
--- a/docs/tutorial/commands/context.md
+++ b/docs/tutorial/commands/context.md
@@ -4,7 +4,7 @@ When you create a **Typer** application it always has a special, hidden object u
But you can access the context by declaring a function parameter of type `typer.Context`.
-You might have read it in [CLI Option Callback and Context](../options/callback-and-context.md){.internal-link target=_blank}.
+You might have read it in [CLI Option Callback and Context](../options/callback-and-context.md).
The same way, in commands or in the main `Typer` callback you can access the context by declaring a function parameter of type `typer.Context`.
diff --git a/docs/tutorial/commands/help.md b/docs/tutorial/commands/help.md
index c3865f8116..4eafebf4de 100644
--- a/docs/tutorial/commands/help.md
+++ b/docs/tutorial/commands/help.md
@@ -213,11 +213,11 @@ Alternatively, you can disable it globally using an environmental variable `TYPE
### Rich Markup
-If you set `rich_markup_mode="rich"` when creating the `typer.Typer()` app (which is the default), you will be able to use
Rich Console Markup in the docstring, and even in the help for the *CLI arguments* and options:
+If you set `rich_markup_mode="rich"` when creating the `typer.Typer()` app (which is the default), you will be able to use [Rich Console Markup](https://rich.readthedocs.io/en/stable/markup.html) in the docstring, and even in the help for the *CLI arguments* and options:
{* docs_src/commands/help/tutorial004_an_py310.py hl[5,11,15:17,22,25,28] *}
-With that, you can use
Rich Console Markup to format the text in the docstring for the command `create`, make the word "`create`" bold and green, and even use an
emoji.
+With that, you can use [Rich Console Markup](https://rich.readthedocs.io/en/stable/markup.html) to format the text in the docstring for the command `create`, make the word "`create`" bold and green, and even use an [emoji](https://rich.readthedocs.io/en/stable/markup.html#emoji).
You can also use markup in the help for the `username` CLI Argument.
@@ -280,7 +280,7 @@ If you set `rich_markup_mode="markdown"` when creating the `typer.Typer()` app,
{* docs_src/commands/help/tutorial005_an_py310.py hl[5,10,13:21,26,28:29] *}
-With that, you can use Markdown to format the text in the docstring for the command `create`, make the word "`create`" bold, show a list of items, and even use an
emoji.
+With that, you can use Markdown to format the text in the docstring for the command `create`, make the word "`create`" bold, show a list of items, and even use an [emoji](https://rich.readthedocs.io/en/stable/markup.html#emoji).
And the same as before, the help text overwritten for the command `delete` can also use Markdown.
@@ -348,7 +348,7 @@ Notice that in Markdown you cannot define colors. For colors you might prefer to
If you have many commands or CLI parameters, you might want to show their documentation in different panels when using the `--help` option.
-If you installed
Rich as described in [Printing and Colors](../printing.md){.internal-link target=_blank}, you can configure the panel to use for each command or CLI parameter.
+If you installed [Rich](https://rich.readthedocs.io/) as described in [Printing and Colors](../printing.md), you can configure the panel to use for each command or CLI parameter.
### Help Panels for Commands
diff --git a/docs/tutorial/index.md b/docs/tutorial/index.md
index bad806c88a..ab1a7a3381 100644
--- a/docs/tutorial/index.md
+++ b/docs/tutorial/index.md
@@ -8,9 +8,9 @@ You could consider this a **book**, a **course**, the **official** and recommend
## Python Types
-If you need a refresher about how to use Python type hints, check the first part of
FastAPI's Python types intro.
+If you need a refresher about how to use Python type hints, check the first part of [FastAPI's Python types intro](https://fastapi.tiangolo.com/python-types/).
-You can also check the
mypy cheat sheet.
+You can also check the [mypy cheat sheet](https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html).
In short (very short), you can declare a function with parameters like:
diff --git a/docs/tutorial/install.md b/docs/tutorial/install.md
index bb2db1d8ff..67ca983be5 100644
--- a/docs/tutorial/install.md
+++ b/docs/tutorial/install.md
@@ -2,7 +2,7 @@
The first step is to install **Typer**.
-First, make sure you create your [virtual environment](../virtual-environments.md){.internal-link target=_blank}, activate it, and then install it, for example with:
+First, make sure you create your [virtual environment](../virtual-environments.md), activate it, and then install it, for example with:
diff --git a/docs/tutorial/options-autocompletion.md b/docs/tutorial/options-autocompletion.md
index 9b0e296924..a81f1f199c 100644
--- a/docs/tutorial/options-autocompletion.md
+++ b/docs/tutorial/options-autocompletion.md
@@ -48,7 +48,7 @@ Hello Camila
Right now we get completion for the *CLI option* names, but not for the values.
-We can provide completion for the values creating an `autocompletion` function, similar to the `callback` functions from [CLI Option Callback and Context](./options/callback-and-context.md){.internal-link target=_blank}:
+We can provide completion for the values creating an `autocompletion` function, similar to the `callback` functions from [CLI Option Callback and Context](./options/callback-and-context.md):
{* docs_src/options_autocompletion/tutorial002_an_py310.py hl[6:7,16] *}
@@ -155,7 +155,7 @@ Sebastian -- The type hints guy.
Instead of creating and returning a list with values (`str` or `tuple`), we can use `yield` with each value that we want in the completion.
-That way our function will be a
generator that **Typer** can iterate:
+That way our function will be a [generator](https://docs.python.org/3.8/glossary.html#index-19) that **Typer** can iterate:
{* docs_src/options_autocompletion/tutorial005_an_py310.py hl[12:15] *}
@@ -171,7 +171,7 @@ In the end, that's just to save us a couple of lines of code.
/// info
-The function can use `yield`, so it doesn't have to return strictly a `list`, it just has to be
iterable.
+The function can use `yield`, so it doesn't have to return strictly a `list`, it just has to be [iterable](https://docs.python.org/3.8/glossary.html#term-iterable).
But each of the elements for completion has to be a `str` or a `tuple` (when containing a help text).
@@ -284,7 +284,7 @@ Because completion is based on the output printed by your program (handled inter
/// tip
-If you need a refresher about what is "standard output" and "standard error" check the section in [Printing and Colors: "Standard Output" and "Standard Error"](./printing.md#standard-output-and-standard-error){.internal-link target=_blank}.
+If you need a refresher about what is "standard output" and "standard error" check the section in [Printing and Colors: "Standard Output" and "Standard Error"](./printing.md#standard-output-and-standard-error).
///
diff --git a/docs/tutorial/options/help.md b/docs/tutorial/options/help.md
index 1887b2f289..c2a115796f 100644
--- a/docs/tutorial/options/help.md
+++ b/docs/tutorial/options/help.md
@@ -93,7 +93,7 @@ Here we have a custom *CLI options* panel named "`Customization and Utils`".
## Help with style using Rich
-In a future section you will see how to use custom markup in the `help` for *CLI options* when reading about [Commands - Command Help](../commands/help.md#rich-markdown-and-markup){.internal-link target=_blank}.
+In a future section you will see how to use custom markup in the `help` for *CLI options* when reading about [Commands - Command Help](../commands/help.md#rich-markdown-and-markup).
If you are in a hurry you can jump there, but otherwise, it would be better to continue reading here and following the tutorial in order.
diff --git a/docs/tutorial/options/name.md b/docs/tutorial/options/name.md
index 82ca489f67..abe4a8b3ed 100644
--- a/docs/tutorial/options/name.md
+++ b/docs/tutorial/options/name.md
@@ -32,7 +32,7 @@ You can pass the *CLI option* name that you want to have in the following positi
/// info
-"
Positional" means that it's not a function argument with a keyword name.
+"[Positional](https://docs.python.org/3.8/glossary.html#term-argument)" means that it's not a function argument with a keyword name.
For example `show_default=True` is a keyword argument. "`show_default`" is the keyword.
diff --git a/docs/tutorial/options/required.md b/docs/tutorial/options/required.md
index d2dde83641..eb0d804c24 100644
--- a/docs/tutorial/options/required.md
+++ b/docs/tutorial/options/required.md
@@ -25,7 +25,7 @@ Or you can explicitly pass `...` to `typer.Option(default=...)`:
/// info
-If you hadn't seen that `...` before: it is a special single value, it is
part of Python and is called "Ellipsis".
+If you hadn't seen that `...` before: it is a special single value, it is [part of Python and is called "Ellipsis"](https://docs.python.org/3/library/constants.html#Ellipsis).
///
diff --git a/docs/tutorial/options/version.md b/docs/tutorial/options/version.md
index 7b584ce2aa..d03c9c3046 100644
--- a/docs/tutorial/options/version.md
+++ b/docs/tutorial/options/version.md
@@ -86,7 +86,7 @@ We don't have to check for `ctx.resilient_parsing` in the `name_callback()` for
/// info
-If you need a refresher about what is "standard output" and "standard error" check the section in [Printing and Colors: "Standard Output" and "Standard Error"](../printing.md#standard-output-and-standard-error){.internal-link target=_blank}.
+If you need a refresher about what is "standard output" and "standard error" check the section in [Printing and Colors: "Standard Output" and "Standard Error"](../printing.md#standard-output-and-standard-error).
///
diff --git a/docs/tutorial/package.md b/docs/tutorial/package.md
index f98160e50b..8a582451e8 100644
--- a/docs/tutorial/package.md
+++ b/docs/tutorial/package.md
@@ -20,7 +20,7 @@ If you already have a favorite way of creating Python packages, feel free to ski
## Prerequisites
-For this guide we'll use
uv.
+For this guide we'll use [uv](https://docs.astral.sh/uv/).
uv's docs are great, so go ahead, check them and install it.
@@ -321,7 +321,7 @@ If you installed it in the global system (e.g. with `sudo`) you could install a
/// tip
-Bonus points if you use
uvx to install it while keeping an isolated environment for your Python CLI programs π
+Bonus points if you use [uvx](https://docs.astral.sh/uv/) to install it while keeping an isolated environment for your Python CLI programs π
///
@@ -486,7 +486,7 @@ But you can still support `python -m` for the cases where it's useful.
## Publish to PyPI (optional)
-You can publish that new package to
PyPI to make it public, so others can install it easily.
+You can publish that new package to [PyPI](https://pypi.org/) to make it public, so others can install it easily.
So, go ahead and create an account there (it's free).
@@ -494,9 +494,9 @@ So, go ahead and create an account there (it's free).
To do it, you first need to configure a PyPI auth token.
-Login to
PyPI.
+Login to [PyPI](https://pypi.org/).
-And then go to
https://pypi.org/manage/account/token/ to create a new token.
+And then go to [https://pypi.org/manage/account/token/](https://pypi.org/manage/account/token/) to create a new token.
Let's say your new API token is:
@@ -531,7 +531,7 @@ Uploading rick_portal_gun-0.1.0.tar.gz (841.0B)
-Now you can go to PyPI and check your projects at
https://pypi.org/manage/projects/.
+Now you can go to PyPI and check your projects at [https://pypi.org/manage/projects/](https://pypi.org/manage/projects/).
You should now see your new "rick-portal-gun" package.
@@ -659,13 +659,13 @@ And now you can go to PyPI, to the project page, and reload it, and it will now
This is a very simple guide. You could add many more steps.
-For example, you should use
Git, the version control system, to save your code.
+For example, you should use [Git](https://git-scm.com/), the version control system, to save your code.
-You could use
uv to manage your installed CLI Python programs in isolated environments.
+You could use [uv](https://docs.astral.sh/uv/) to manage your installed CLI Python programs in isolated environments.
-Maybe use automatic formatting with
Ruff.
+Maybe use automatic formatting with [Ruff](https://docs.astral.sh/ruff/).
-You'll probably want to publish your code as open source to
GitHub.
+You'll probably want to publish your code as open source to [GitHub](https://github.com/).
And then you could integrate a
CI tool to run your tests and deploy your package automatically.
diff --git a/docs/tutorial/parameter-types/datetime.md b/docs/tutorial/parameter-types/datetime.md
index f2571126d2..4b685a3cf1 100644
--- a/docs/tutorial/parameter-types/datetime.md
+++ b/docs/tutorial/parameter-types/datetime.md
@@ -1,6 +1,6 @@
# DateTime
-You can specify a *CLI parameter* as a Python
`datetime`.
+You can specify a *CLI parameter* as a Python [`datetime`](https://docs.python.org/3/library/datetime.html).
Your function will receive a standard Python `datetime` object, and again, your editor will give you completion, etc.
@@ -47,7 +47,7 @@ Error: Invalid value for 'BIRTH:[%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]':
You can also customize the formats received for the `datetime` with the `formats` parameter.
-`formats` receives a list of strings with the date formats that would be passed to
datetime.strptime().
+`formats` receives a list of strings with the date formats that would be passed to [datetime.strptime()](https://docs.python.org/3/library/datetime.html#datetime.datetime.strptime).
For example, let's imagine that you want to accept an ISO formatted datetime, but for some strange reason, you also want to accept a format with:
diff --git a/docs/tutorial/parameter-types/enum.md b/docs/tutorial/parameter-types/enum.md
index 278908fc72..185ad420c3 100644
--- a/docs/tutorial/parameter-types/enum.md
+++ b/docs/tutorial/parameter-types/enum.md
@@ -1,6 +1,6 @@
# Enum - Choices
-To define a *CLI parameter* that can take a value from a predefined set of values you can use a standard Python
`enum.Enum`:
+To define a *CLI parameter* that can take a value from a predefined set of values you can use a standard Python [`enum.Enum`](https://docs.python.org/3/library/enum.html):
{* docs_src/parameter_types/enum/tutorial001_py310.py hl[1,6:9,16:17] *}
diff --git a/docs/tutorial/parameter-types/file.md b/docs/tutorial/parameter-types/file.md
index f551b1db22..2b50fea3dd 100644
--- a/docs/tutorial/parameter-types/file.md
+++ b/docs/tutorial/parameter-types/file.md
@@ -10,7 +10,7 @@ You can read and write data with `Path` the same way.
///
-The difference is that these types will give you a Python
file-like object instead of a Python
Path.
+The difference is that these types will give you a Python [file-like object](https://docs.python.org/3/glossary.html#term-file-object) instead of a Python [Path](https://docs.python.org/3/library/pathlib.html#basic-use).
A "file-like object" is the same type of object returned by `open()` as in:
@@ -168,7 +168,7 @@ $ ls ./binary.dat
You can use several configuration parameters for these types (classes) in `typer.Option()` and `typer.Argument()`:
-* `mode`: controls the "
mode" to open the file with.
+* `mode`: controls the "[mode](https://docs.python.org/3/library/functions.html#open)" to open the file with.
* It's automatically set for you by using the classes above.
* Read more about it below.
* `encoding`: to force a specific encoding, e.g. `"utf-8"`.
@@ -178,7 +178,7 @@ You can use several configuration parameters for these types (classes) in `typer
## Advanced `mode`
-By default, **Typer** will configure the
`mode` for you:
+By default, **Typer** will configure the [`mode`](https://docs.python.org/3/library/functions.html#open) for you:
* `typer.FileText`: `mode="r"`, to read text.
* `typer.FileTextWrite`: `mode="w"`, to write text.
diff --git a/docs/tutorial/parameter-types/path.md b/docs/tutorial/parameter-types/path.md
index 869b38db07..e2d8177210 100644
--- a/docs/tutorial/parameter-types/path.md
+++ b/docs/tutorial/parameter-types/path.md
@@ -1,6 +1,6 @@
# Path
-You can declare a *CLI parameter* to be a standard Python
`pathlib.Path`.
+You can declare a *CLI parameter* to be a standard Python [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#basic-use).
This is what you would do for directory paths, file paths, etc:
diff --git a/docs/tutorial/parameter-types/uuid.md b/docs/tutorial/parameter-types/uuid.md
index cd93b1a1a2..25cb57ab11 100644
--- a/docs/tutorial/parameter-types/uuid.md
+++ b/docs/tutorial/parameter-types/uuid.md
@@ -2,7 +2,7 @@
/// info
-A UUID is a
"Universally Unique Identifier".
+A UUID is a ["Universally Unique Identifier"](https://en.wikipedia.org/wiki/Universally_unique_identifier).
It's a standard format for identifiers, like passport numbers, but for anything, not just people in countries.
@@ -24,7 +24,7 @@ You can declare a *CLI parameter* as a UUID:
{* docs_src/parameter_types/uuid/tutorial001_py310.py hl[1,9:11] *}
-Your Python code will receive a standard Python
`UUID` object with all its attributes and methods, and as you are annotating your function parameter with that type, you will have type checks, autocompletion in your editor, etc.
+Your Python code will receive a standard Python [`UUID`](https://docs.python.org/3.8/library/uuid.html) object with all its attributes and methods, and as you are annotating your function parameter with that type, you will have type checks, autocompletion in your editor, etc.
Check it:
diff --git a/docs/tutorial/printing.md b/docs/tutorial/printing.md
index da998b04c3..7c0180b39d 100644
--- a/docs/tutorial/printing.md
+++ b/docs/tutorial/printing.md
@@ -18,7 +18,7 @@ Hello World
## Use Rich
-You can also display beautiful and more complex information using
Rich. It comes by default when you install `typer`.
+You can also display beautiful and more complex information using [Rich](https://rich.readthedocs.io/). It comes by default when you install `typer`.
### Use Rich `print`
@@ -50,7 +50,7 @@ Here's the data
### Rich Markup
-Rich also supports a
custom markup syntax to set colors and styles, for example:
+Rich also supports a [custom markup syntax](https://rich.readthedocs.io/en/stable/markup.html) to set colors and styles, for example:
{* docs_src/printing/tutorial002_py310.py hl[9] *}
@@ -66,7 +66,7 @@ $ python main.py
In this example you can see how to use font styles, colors, and even emojis.
-To learn more check out the
Rich docs.
+To learn more check out the [Rich docs](https://rich.readthedocs.io/en/stable/markup.html).
### Rich Tables
@@ -99,9 +99,9 @@ $ python main.py
Rich has many other features, as an example, you can check the docs for:
-*
Prompt
-*
Markdown
-*
Panel
+* [Prompt](https://rich.readthedocs.io/en/stable/prompt.html)
+* [Markdown](https://rich.readthedocs.io/en/stable/markdown.html)
+* [Panel](https://rich.readthedocs.io/en/stable/panel.html)
* ...and more.
### Typer and Rich
@@ -182,7 +182,7 @@ But understanding that will come handy in the future, for example for autocomple
/// warning
-In most of the cases, for displaying advanced information, it is recommended to use
Rich.
+In most of the cases, for displaying advanced information, it is recommended to use [Rich](https://rich.readthedocs.io/).
You can probably skip the rest of this section. ππ
@@ -216,7 +216,7 @@ So, a colored text is still just a `str`.
/// tip
-Again, you are much better off using
Rich for this. π
+Again, you are much better off using [Rich](https://rich.readthedocs.io/) for this. π
///
@@ -256,7 +256,7 @@ You can pass these function arguments to `typer.style()`:
/// tip
-In case you didn't see above, you are much better off using
Rich for this. π
+In case you didn't see above, you are much better off using [Rich](https://rich.readthedocs.io/) for this. π
///
diff --git a/docs/tutorial/progressbar.md b/docs/tutorial/progressbar.md
index 29c118f6bd..996b0e9873 100644
--- a/docs/tutorial/progressbar.md
+++ b/docs/tutorial/progressbar.md
@@ -4,7 +4,7 @@ If you are executing an operation that can take some time, you can inform it to
## Progress Bar
-You can use
Rich's Progress Display to show a progress bar, for example:
+You can use [Rich's Progress Display](https://rich.readthedocs.io/en/stable/progress.html) to show a progress bar, for example:
{* docs_src/progressbar/tutorial001_py310.py hl[4,12] *}
@@ -63,7 +63,7 @@ $ python main.py
-You can learn more about it in the
Rich docs for Progress Display.
+You can learn more about it in the [Rich docs for Progress Display](https://rich.readthedocs.io/en/stable/progress.html).
## Typer `progressbar`
@@ -81,7 +81,7 @@ But if you can't use Rich and have it disabled, Typer comes with a simple utilit
/// tip
-Remember, you are much better off using
Rich for this. π
+Remember, you are much better off using [Rich](https://rich.readthedocs.io/) for this. π
///
@@ -149,7 +149,7 @@ Processed 100 things.
/// tip
-Remember, you are much better off using
Rich for this. π
+Remember, you are much better off using [Rich](https://rich.readthedocs.io/) for this. π
///
@@ -175,7 +175,7 @@ Processed 100 user IDs.
#### About the function with `yield`
-If you hadn't seen something like that `yield` above, that's a "
generator".
+If you hadn't seen something like that `yield` above, that's a "[generator](https://docs.python.org/3/glossary.html#term-generator)".
You can iterate over that function with a `for` and at each iteration it will give you the value at `yield`.
@@ -199,7 +199,7 @@ would print each of the "user IDs" (here it's just the numbers from `0` to `99`)
/// tip
-Remember, you are much better off using
Rich for this. π
+Remember, you are much better off using [Rich](https://rich.readthedocs.io/) for this. π
///
diff --git a/docs/tutorial/prompt.md b/docs/tutorial/prompt.md
index 34871796d3..522f6ba693 100644
--- a/docs/tutorial/prompt.md
+++ b/docs/tutorial/prompt.md
@@ -1,6 +1,6 @@
# Ask with Prompt
-When you need to ask the user for info interactively you should normally use [*CLI Option*s with Prompt](options/prompt.md){.internal-link target=_blank}, because they allow using the CLI program in a non-interactive way (for example, a Bash script could use it).
+When you need to ask the user for info interactively you should normally use [*CLI Option*s with Prompt](options/prompt.md), because they allow using the CLI program in a non-interactive way (for example, a Bash script could use it).
But if you absolutely need to ask for interactive information without using a *CLI option*, you can use `typer.prompt()`:
@@ -22,7 +22,7 @@ Hello Camila
## Confirm
-There's also an alternative to ask for confirmation. Again, if possible, you should use a [*CLI Option* with a confirmation prompt](options/prompt.md){.internal-link target=_blank}:
+There's also an alternative to ask for confirmation. Again, if possible, you should use a [*CLI Option* with a confirmation prompt](options/prompt.md):
{* docs_src/prompt/tutorial002_py310.py hl[8] *}
diff --git a/docs/tutorial/subcommands/callback-override.md b/docs/tutorial/subcommands/callback-override.md
index 45602a2cb8..8ab05df993 100644
--- a/docs/tutorial/subcommands/callback-override.md
+++ b/docs/tutorial/subcommands/callback-override.md
@@ -49,7 +49,7 @@ Creating user: Camila
If a callback was added when creating the `typer.Typer()` app, it's possible to override it with a new one using `@app.callback()`.
-This is the same information you saw on the section about [Commands - Typer Callback](../commands/callback.md){.internal-link target=_blank}, and it applies the same for sub-Typer apps:
+This is the same information you saw on the section about [Commands - Typer Callback](../commands/callback.md), and it applies the same for sub-Typer apps:
{* docs_src/subcommands/callback_override/tutorial003_py310.py hl[6,7,10,14,15,16] *}
diff --git a/docs/tutorial/subcommands/index.md b/docs/tutorial/subcommands/index.md
index b20e21b578..5494247fc1 100644
--- a/docs/tutorial/subcommands/index.md
+++ b/docs/tutorial/subcommands/index.md
@@ -1,6 +1,6 @@
# SubCommands - Command Groups
-You read before how to create a program with [Commands](../commands/index.md){.internal-link target=_blank}.
+You read before how to create a program with [Commands](../commands/index.md).
Now we'll see how to create a *CLI program* with commands that have their own subcommands. Also known as command groups.
diff --git a/docs/tutorial/testing.md b/docs/tutorial/testing.md
index cbabfd5d04..bf4fab698e 100644
--- a/docs/tutorial/testing.md
+++ b/docs/tutorial/testing.md
@@ -1,6 +1,6 @@
# Testing
-Testing **Typer** applications is very easy with
pytest.
+Testing **Typer** applications is very easy with [pytest](https://docs.pytest.org/en/latest/).
Let's say you have an application `app/main.py` with:
@@ -77,7 +77,7 @@ You could also check the output sent to "standard error" (`stderr`) or "standard
/// info
-If you need a refresher about what is "standard output" and "standard error" check the section in [Printing and Colors: "Standard Output" and "Standard Error"](printing.md#standard-output-and-standard-error){.internal-link target=_blank}.
+If you need a refresher about what is "standard output" and "standard error" check the section in [Printing and Colors: "Standard Output" and "Standard Error"](printing.md#standard-output-and-standard-error).
///
@@ -131,7 +131,7 @@ This is because what you type in the terminal goes to "**standard input**" and i
/// info
-If you need a refresher about what is "standard output", "standard error", and "standard input" check the section in [Printing and Colors: "Standard Output" and "Standard Error"](printing.md#standard-output-and-standard-error){.internal-link target=_blank}.
+If you need a refresher about what is "standard output", "standard error", and "standard input" check the section in [Printing and Colors: "Standard Output" and "Standard Error"](printing.md#standard-output-and-standard-error).
///
diff --git a/docs/tutorial/typer-app.md b/docs/tutorial/typer-app.md
index 4d94776ff2..d2e07fb7f5 100644
--- a/docs/tutorial/typer-app.md
+++ b/docs/tutorial/typer-app.md
@@ -29,7 +29,7 @@ You put it on top of a function. Like a pretty decorative hat (I guess that's wh
A "decorator" takes the function below and does something with it.
In our case, this decorator tells **Typer** that the function below is a "`command`".
-You will learn more about commands later in the section [commands](./commands/index.md){.internal-link target=_blank}.
+You will learn more about commands later in the section [commands](./commands/index.md).
///
@@ -113,6 +113,6 @@ Having a standalone program like that allows setting up shell/tab completion.
The first step to be able to create an installable package like that is to use an explicit `typer.Typer()` app.
-Later you can learn all the process to create a standalone CLI application and [Build a Package](./package.md){.internal-link target=_blank}.
+Later you can learn all the process to create a standalone CLI application and [Build a Package](./package.md).
But for now, it's just good to know that you are on that path. π
diff --git a/docs/virtual-environments.md b/docs/virtual-environments.md
index d4db3a77c3..442d082699 100644
--- a/docs/virtual-environments.md
+++ b/docs/virtual-environments.md
@@ -22,7 +22,7 @@ A **virtual environment** is a directory with some files in it.
This page will teach you how to use **virtual environments** and how they work.
-If you are ready to adopt a **tool that manages everything** for you (including installing Python), try
uv.
+If you are ready to adopt a **tool that manages everything** for you (including installing Python), try [uv](https://github.com/astral-sh/uv).
///
@@ -86,7 +86,7 @@ $ python -m venv .venv
//// tab | `uv`
-If you have
`uv` installed, you can use it to create a virtual environment.
+If you have [`uv`](https://github.com/astral-sh/uv) installed, you can use it to create a virtual environment.
@@ -150,7 +150,7 @@ $ .venv\Scripts\Activate.ps1
//// tab | Windows Bash
-Or if you use Bash for Windows (e.g.
Git Bash):
+Or if you use Bash for Windows (e.g. [Git Bash](https://gitforwindows.org/)):
@@ -216,7 +216,7 @@ If it shows the `python` binary at `.venv\Scripts\python`, inside of your projec
/// tip
-If you use
`uv` you would use it to install things instead of `pip`, so you don't need to upgrade `pip`. π
+If you use [`uv`](https://github.com/astral-sh/uv) you would use it to install things instead of `pip`, so you don't need to upgrade `pip`. π
///
@@ -248,7 +248,7 @@ If you are using **Git** (you should), add a `.gitignore` file to exclude everyt
/// tip
-If you used
`uv` to create the virtual environment, it already did this for you, you can skip this step. π
+If you used [`uv`](https://github.com/astral-sh/uv) to create the virtual environment, it already did this for you, you can skip this step. π
///
@@ -320,7 +320,7 @@ $ pip install typer
//// tab | `uv`
-If you have
`uv`:
+If you have [`uv`](https://github.com/astral-sh/uv):
@@ -352,7 +352,7 @@ $ pip install -r requirements.txt
//// tab | `uv`
-If you have
`uv`:
+If you have [`uv`](https://github.com/astral-sh/uv):
@@ -396,8 +396,8 @@ You would probably use an editor, make sure you configure it to use the same vir
For example:
-*
VS Code
-*
PyCharm
+* [VS Code](https://code.visualstudio.com/docs/python/environments#_select-and-activate-an-environment)
+* [PyCharm](https://www.jetbrains.com/help/pycharm/creating-virtual-environment.html)
/// tip
@@ -435,7 +435,7 @@ Continue reading. ππ€
## Why Virtual Environments
-To work with Typer you need to install
Python.
+To work with Typer you need to install [Python](https://www.python.org/).
After that, you would need to **install** Typer and any other **packages** you want to use.
@@ -544,7 +544,7 @@ $ pip install typer
-That will download a compressed file with the Typer code, normally from
PyPI.
+That will download a compressed file with the Typer code, normally from [PyPI](https://pypi.org/project/typer/).
It will also **download** files for other packages that Typer depends on.
@@ -607,7 +607,7 @@ $ .venv\Scripts\Activate.ps1
//// tab | Windows Bash
-Or if you use Bash for Windows (e.g.
Git Bash):
+Or if you use Bash for Windows (e.g. [Git Bash](https://gitforwindows.org/)):
@@ -619,13 +619,13 @@ $ source .venv/Scripts/activate
////
-That command will create or modify some [environment variables](environment-variables.md){.internal-link target=_blank} that will be available for the next commands.
+That command will create or modify some [environment variables](environment-variables.md) that will be available for the next commands.
One of those variables is the `PATH` variable.
/// tip
-You can learn more about the `PATH` environment variable in the [Environment Variables](environment-variables.md#path-environment-variable){.internal-link target=_blank} section.
+You can learn more about the `PATH` environment variable in the [Environment Variables](environment-variables.md#path-environment-variable) section.
///
@@ -826,7 +826,7 @@ This is a simple guide to get you started and teach you how everything works **u
There are many **alternatives** to managing virtual environments, package dependencies (requirements), projects.
-Once you are ready and want to use a tool to **manage the entire project**, packages dependencies, virtual environments, etc. I would suggest you try
uv.
+Once you are ready and want to use a tool to **manage the entire project**, packages dependencies, virtual environments, etc. I would suggest you try [uv](https://github.com/astral-sh/uv).
`uv` can do a lot of things, it can: