Skip to main content

Module content_style

Module content_style 

Source
Expand description

Content styling spec types — shared module per supervisor 2026-05-24 disposition (a-modified) REVIVE-WITH-SHARED-MODULE.

This module hosts the f-string / builder-API content styling spec types revived from pre-W18.3 (git show 19de5ef2^:crates/shape-ast/src/ interpolation.rs). Both W18.4 (f-string styling parser/lowering) and W18.5 (Content.table / Content.code / Content.kv builder API) consume these types from this single shared module — no parallel implementations per CLAUDE.md §Parallel-implementation.

Module placement rationale: the supervisor’s preferred location was crates/shape-value/src/content_style.rs (next to ContentNode). The dependency graph forbids that placement: shape-ast cannot import from shape-value (shape-value depends on shape-ast, not the reverse), and the parsers MUST live in shape-ast because the f-string interpolation parser produces typed InterpolationFormatSpec::ContentStyle(spec) parts during AST parsing. Placing the types in shape-ast satisfies the “one source of truth” constraint while preserving the workspace dependency invariant. shape-vm’s compiler lowering and shape-runtime’s W18.5 builders both import from shape_ast:: content_style::*.

The spec types here are SYNTACTIC descriptors — they describe what the user wrote in f"{x:bold,red}" or Content.table(...).border(rounded). They are NOT runtime ContentNode/Style/Color types from shape_value::content. Conversion happens at the lowering boundary.

Structs§

ContentFormatSpec
Content-string format specification for rich terminal/HTML output.

Enums§

AlignSpec
Alignment for content-string rendering.
BorderStyleSpec
Border style for content-string table rendering.
ChartTypeSpec
Chart type hint for content format spec.
ColorSpec
Color specification for content strings.
NamedContentColor
Named colors for content strings.

Functions§

parse_align_spec
parse_border_style_spec
parse_chart_type_spec
parse_color_spec
parse_content_format_spec
Parse a content-string format spec like "fg(red), bold, fixed(2)".