Skip to main content

Module style

Module style 

Source
Expand description

Named styles: the palette of the Python UI plus the markdown element styles.

Everything here is a plain anstyle::Style constant, so the values are Copy, can be used in const contexts and are only turned into escape sequences when a renderer decides that colour is wanted (see crate::ui::Term::color).

The palette follows display.py: cyan for instructions, yellow for hints, green for success, red for failures and blocked commands, dim for secondary notes and violet for commands that are mentioned inside such notes.

Constants§

BLOCKQUOTE
Block quotes (the ▌ bar and the quoted text).
BOLD
Bold text.
BOLD_CYAN
Bold cyan: panel titles of instruction panels.
BOLD_GREEN
Bold green: success messages.
BOLD_RED
Bold red: failure messages.
BOLD_YELLOW
Bold yellow.
CODE_BLOCK
Fenced and indented code blocks: plain cyan, calmer than the bold cyan of inline code and readable on dark and light terminals alike.
CYAN
Cyan: instruction panels.
DIM
Dimmed (faint) text, used for secondary notes.
DIM_BOLD
Dim and bold, for emphasis inside a dim note.
DIM_VIOLET
Dim and violet, for a command inside a dim note ([dim]… [violet]cmd[/violet][/dim]).
EMPHASIS
*emphasis*.
GREEN
Green: success.
H1
Level 1 heading text.
H2
Level 2 heading text.
H3
Level 3 heading text.
H4
Level 4 heading text.
H5
Level 5 heading text.
H6
Level 6 heading text.
HEADING_RULE
The ──── line that follows a level 1 or 2 heading (the text itself is underlined already).
INLINE_CODE
`inline code`.
LINK
Link text.
LIST_MARKER
Bullets and list numbers.
MAGENTA
Magenta.
MUTED
Thematic breaks (***) and link targets.
PLAIN
No styling at all.
RED
Red: failures and blocked commands.
STRIKETHROUGH
~~strikethrough~~ (only produced when the extension is enabled).
STRONG
**strong**.
VIOLET
Violet (256-colour index 177, the colour Rich calls violet): commands inside notes.
YELLOW
Yellow: hints and warnings.

Functions§

combine
Lays top over base, like Rich’s Style.__add__: colours of top win where it sets one, text effects are the union of both.