Skip to main content

Module text

Module text 

Source
Expand description

Markdown normalization and line classification. Port of the standalone text helpers in XILP001_script_parser.py.

Constantsยง

DIRECTION_TYPES
Direction subtypes, in the order classify_direction tests them.

Staticsยง

BRACKETS ๐Ÿ”’
BRACKET_STRIP ๐Ÿ”’
DIVIDER ๐Ÿ”’
ESCAPE_ANY ๐Ÿ”’
HEADING ๐Ÿ”’
SCENE_HEAD ๐Ÿ”’
SCENE_START ๐Ÿ”’

Functionsยง

classify_direction
Classify bracket-interior text into a sound category.
find_brackets
Every bracketed segment on a line, in order.
is_divider
is_metadata_section
Headers that begin the post-script metadata block.
is_scene_header
is_stage_direction
[SFX: ...]-style line: starts with [ and contains ].
parse_scene_header
(scene_number, scene_name) from a SCENE N: Name line.
strip_brackets
Drop bracketed directions from a scene-header line.
strip_markdown_escapes
Remove markdown backslash escapes.
strip_markdown_formatting
Remove heading prefixes, bold markers and trailing whitespace, per line.