topmark.core.formats¶
Shared output format definitions used across TopMark frontends.
This module centralizes the OutputFormat enum so CLI commands, machine emitters,
and other frontends can agree on the same format vocabulary without introducing Click
or console dependencies.
Machine-readable formats (JSON, NDJSON) are intended to be stable and colorless
OutputFormat ¶
Bases: str, Enum
Output format for CLI rendering.
Attributes:
| Name | Type | Description |
|---|---|---|
TEXT |
Human-friendly text output; may include ANSI color if enabled. |
|
MARKDOWN |
A Markdown document. |
|
JSON |
A single JSON document (machine-readable). See the
|
|
NDJSON |
One JSON object per line (newline-delimited JSON; machine-readable). |
Notes
- Machine-readable formats (
JSONandNDJSON) must not include ANSI color or diffs. - Use with
topmark.cli.cli_types.EnumChoiceParamto parse--output-formatfrom Click.
is_machine_format ¶
Return True for formats intended for machine consumption.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fmt
|
OutputFormat | None
|
the output format to be checked. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
|