topmark.presentation.shared.paths¶
topmark / presentation / shared / paths
Shared human-facing path presentation helpers.
This module contains frontend-neutral display helpers for path labels used by human-facing renderers. These helpers intentionally model presentation policy, not machine-readable path serialization.
get_display_path ¶
Return the user-facing path to display for a processing result.
TopMark may process content-on-STDIN by writing it to a temporary file.
In that mode, ProcessingContext.path points at the temporary file on disk,
but users expect messages to refer to the logical filename supplied via
--stdin-filename.
This helper centralizes that policy so all human-facing renderers display the same path labels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
ProcessingContext
|
Processing context to render. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The logical filename in STDIN content mode, otherwise the actual file path. |
Source code in src/topmark/presentation/shared/paths.py
render_path_display_text ¶
Render a short TEXT path label for headings and guidance messages.
This helper formats
get_display_path()
for human-facing TEXT output and annotates STDIN-backed content with (via STDIN)
when a synthetic filename is available.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
ProcessingContext
|
Processing context containing the path to display. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Short TEXT label for per-file headings and guidance messages. |