2022-04-26 13:49:45 -04:00
|
|
|
# rich
|
|
|
|
|
2023-07-16 19:23:40 +02:00
|
|
|
> A toolbox for fancy output in the terminal.
|
2022-04-26 13:49:45 -04:00
|
|
|
> More information: <https://github.com/Textualize/rich-cli>.
|
|
|
|
|
|
|
|
- Display a file with syntax highlighting:
|
|
|
|
|
|
|
|
`rich {{path/to/file.py}}`
|
|
|
|
|
|
|
|
- Add line numbers, and indentation guides:
|
|
|
|
|
2024-11-15 23:24:49 +11:00
|
|
|
`rich {{path/to/file.py}} --line-numbers --guides`
|
2022-04-26 13:49:45 -04:00
|
|
|
|
|
|
|
- Apply a theme:
|
|
|
|
|
|
|
|
`rich {{path/to/file.py}} --theme {{monokai}}`
|
|
|
|
|
|
|
|
- Display a file in an interactive pager:
|
|
|
|
|
|
|
|
`rich {{path/to/file.py}} --pager`
|
|
|
|
|
|
|
|
- Display contents from a URL:
|
|
|
|
|
|
|
|
`rich {{https://raw.githubusercontent.com/Textualize/rich-cli/main/README.md}} --markdown --pager`
|
|
|
|
|
|
|
|
- Export a file as HTML:
|
|
|
|
|
|
|
|
`rich {{path/to/file.md}} --export-html {{path/to/file.html}}`
|
|
|
|
|
|
|
|
- Display text with formatting tags, custom alignment, and line width:
|
|
|
|
|
2024-12-05 18:27:27 +01:00
|
|
|
`rich --print "{{Hello [green on black]Stylized[/green on black] [bold]World[/bold]}}" --{{left|center|right}} --width {{10}}`
|