Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add typer.set_rich_*() to allow Rich formatting to be disabled #647

Closed
wants to merge 25 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c39d2ef
Add named parameter 'rich_enable' to class Typer
JacobKochems Aug 2, 2023
6a4ba06
Refactor Typer parameter to a global one
JacobKochems Aug 2, 2023
67fad4b
Add a test case for `typer.enable_rich(<bool>)`
JacobKochems Aug 2, 2023
69a86d4
Fix wrong test name
JacobKochems Aug 3, 2023
98ea1c3
Make assertion more robust
JacobKochems Aug 3, 2023
b0abe95
Add a separate switch for Rich traceback
JacobKochems Aug 3, 2023
6f28107
Merge pull request #1 from JacobKochems/feature/enable-rich
JacobKochems Aug 3, 2023
f265dc2
Remove obsolete function
JacobKochems Aug 3, 2023
e29d295
Merge pull request #2 from JacobKochems/feature/enable-rich
JacobKochems Aug 3, 2023
87a9ce7
Update docs to reflect latest Rich output changes
JacobKochems Aug 3, 2023
08bc2f1
Merge pull request #3 from JacobKochems/feature/enable-rich
JacobKochems Aug 3, 2023
f42778f
Rename symbols to be more specific
Sep 19, 2023
6656674
Alias function with its namespace of origin
Sep 19, 2023
6093088
Auto format after rename/refactor
Sep 19, 2023
596c5f0
Rename symbols for better semantic precision
Sep 19, 2023
42cf404
Update docs to new nomenclature used in PR #647
Sep 19, 2023
7b19357
Feature/enable rich (#4)
JacobKochems Sep 19, 2023
6ff12c8
Rename tests to new nomenclature of PR #647
Sep 19, 2023
2ade3dc
Rename tests to new nomenclature of PR #647
Sep 19, 2023
76b0742
Update docs to reflect that functions are setters
JacobKochems Sep 20, 2023
6a7735e
Merge branch 'tiangolo:master' into feature/enable-rich
JacobKochems Nov 16, 2023
c408a39
Merge branch 'tiangolo:master' into feature/enable-rich
JacobKochems Dec 13, 2023
fc18ef2
Merge branch 'tiangolo:master' into feature/enable-rich
JacobKochems Feb 29, 2024
65ddbf0
Merge branch 'tiangolo:master' into feature/enable-rich
JacobKochems Mar 25, 2024
3f9bc07
Merge branch 'master' into feature/enable-rich
May 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update docs to reflect latest Rich output changes
  • Loading branch information
JacobKochems committed Aug 3, 2023
commit 87a9ce77346512c2d9efa0ff2eb85d279e5c01c5
7 changes: 6 additions & 1 deletion docs/tutorial/printing.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,13 @@ The best results for your command line application would be achieved combining b

### If you don't want to use Rich formated output

In case you'd rather like to use the simple text ouput, but need **Rich** to be installed in your environment for any other reason, you can disable the use of **Rich** by **Typer** with the following call:`typer.enable_rich(False)`. This is a global switch affecting all instances of `typer.Typer()`.
In case you'd rather like to use the simple text ouput, but need **Rich** to be installed in your environment for any other reason, you can disable the use of **Rich** by **Typer**.
There are two functions in the **Typer** module to control the output format globally, affecting all `typer.Typer()` instances:

1. `typer.enable_rich_help`
2. `typer.enable_rich_traceback`

The first one controls all help and **Click's** exception messages. The second one controls the format of the stack trace.

## "Standard Output" and "Standard Error"

Expand Down