Skip to content

textfile

TextFile

Display the content of a text file.

PARAMETER DESCRIPTION
title

if not set or null defaults to file path

TYPE: str DEFAULT: None

path

Full path to file to be printed

TYPE: str

mode

One of "plain", "rich" or "ansi"

TYPE: Literal['plain', 'rich', 'ansi'] DEFAULT: 'plain'

style

Base style for text

TYPE: str DEFAULT: ''

emoji

Allow rendering emoji codes

TYPE: bool DEFAULT: True

emoji_variant

Emoji variant, either "text" or "emoji"

TYPE: Literal['emoji', 'text'] DEFAULT: None

justify

Justify method: "left", "center", "full", "right"

TYPE: Literal['default', 'left', 'center', 'right', 'full'] DEFAULT: None

overflow

Overflow method: "crop", "fold", "ellipsis"

TYPE: Literal['fold', 'crop', 'ellipsis', 'ignore'] DEFAULT: None

no_wrap

Disable text wrapping

TYPE: bool DEFAULT: None

end

Character to end text with

TYPE: str DEFAULT: '\n'

tab_size

Number of spaces per tab, or None to use console.tab_size

TYPE: int DEFAULT: None

**kwargs

TYPE: Any DEFAULT: {}

Available parameters for each mode:

Name "plain" "rich" "ansi"
style
emoji
emoji_variant
justify
overflow
no_wrap
end
tab_size

Info

Parameters marked with ❌ will be ignored.