Skip to content

📝 Update docs to use Typer() more prominently - #1418

Merged
tiangolo merged 35 commits into
fastapi:masterfrom
svlandeg:fix/tutorial
Nov 25, 2025
Merged

📝 Update docs to use Typer() more prominently#1418
tiangolo merged 35 commits into
fastapi:masterfrom
svlandeg:fix/tutorial

Conversation

@svlandeg

@svlandeg svlandeg commented Nov 21, 2025

Copy link
Copy Markdown
Member

In an attempt to be minimal/clear, the docs have mostly been using typer.run. However for proper applications, we recommend to use Typer() directly, which unlocks much more options. As such, we're updating the docs here. This has the added advantage that it's easier to experiment with given tutorial examples without first having to adjust them to use Typer().

I know reviewing this is horrible. I've taken the time to go through every edit carefully (0% vibe coding ;-)). Mostly, this meant updating the tutorial examples and then updating the highlighted lines in the documentation markdown files. There were some special cases, that I'll highlight as review comments.

@svlandeg svlandeg self-assigned this Nov 21, 2025
@github-actions github-actions Bot added the docs Improvements or additions to documentation label Nov 21, 2025
Comment thread docs/tutorial/arguments/optional.md
Comment thread docs/tutorial/arguments/optional.md
Comment thread docs/tutorial/commands/index.md
@github-actions

github-actions Bot commented Nov 21, 2025

Copy link
Copy Markdown
Contributor

📝 Docs preview

Last commit d71c498 at: https://3a1a855a.typertiangolo.pages.dev

Modified Pages

Comment thread docs/tutorial/typer-app.md
Comment thread docs/tutorial/exceptions.md Outdated
Comment thread docs/tutorial/progressbar.md

@svlandeg svlandeg left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this should be now in a good state.

Searching through the code base, the only places that still refer to typer.run() are

  • the "first steps" part of the tutorial
  • docs_src/arguments/optional/tutorial000.py which was created in this PR specifically to gradually build up the complexity in the "Arguments" docs section
  • docs_src/testing/app03 which specifically talks about testing code that don't use Typer()

Everything else is now converted to Typer() and all highlighting in the documentation has been updated, including a few fixes of things that weren't exactly right on master (made separate comments about these).

@svlandeg
svlandeg marked this pull request as ready for review November 24, 2025 10:35
@svlandeg svlandeg removed their assignment Nov 24, 2025

@tiangolo tiangolo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! 🚀 🎉

Thanks a lot for going through it all! 🙌

I just reviewed everything, it all looks good. I didn't review the highlighted lines, but I know you did.


I was thinking about the new page name, what do you think?

Comment thread docs/tutorial/progressbar.md
Comment thread docs/tutorial/typer-app.md
@svlandeg svlandeg self-assigned this Nov 24, 2025
@svlandeg svlandeg removed their assignment Nov 25, 2025

@tiangolo tiangolo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thank you! 🙌

@tiangolo
tiangolo merged commit df2cb14 into fastapi:master Nov 25, 2025
25 checks passed
@svlandeg
svlandeg deleted the fix/tutorial branch November 25, 2025 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants