-
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Problem
The full AsciiDoc cell specifier syntax supports per-cell alignment and style overrides, not just spans.
AsciiDoc syntax
|===
| Normal | ^| Centered | >| Right-aligned
| Default | .^| Vertically centered | e| Emphasis style
| 2+^.>m| Colspan 2, center, bottom, monospace
|===Cell specifier format: [colspan][.rowspan]+[halign][.valign][style]|
Where:
halign:<(left),^(center),>(right)valign:.<(top),.^(middle),.>(bottom)style:a(asciidoc),d(default),e(emphasis),h(header),l(literal),m(monospace),s(strong)
Current behavior
Only span specifiers (2+, .3+, 2.3+) are parsed. Alignment and style modifiers are treated as cell content.
Implementation requirements
1. Parser changes (acdc-parser/src/blocks/table.rs)
Extend CellSpecifier to include:
pub struct CellSpecifier {
pub colspan: usize,
pub rowspan: usize,
pub halign: Option<HorizontalAlignment>, // NEW
pub valign: Option<VerticalAlignment>, // NEW
pub style: Option<ColumnStyle>, // NEW
}2. AST changes (acdc-parser/src/model/tables.rs)
Add optional per-cell formatting to TableColumn:
pub struct TableColumn {
pub content: Vec<Block>,
pub colspan: usize,
pub rowspan: usize,
pub halign: Option<HorizontalAlignment>, // NEW: overrides column default
pub valign: Option<VerticalAlignment>, // NEW: overrides column default
pub style: Option<ColumnStyle>, // NEW: overrides column default
}3. HTML renderer (converters/html/src/table.rs)
Use per-cell alignment/style if specified, otherwise fall back to column defaults.
Priority
Low - column-level alignment works for most use cases. Per-cell overrides are less common.
References
- https://docs.asciidoctor.org/asciidoc/latest/tables/format-cell-content/
- https://docs.asciidoctor.org/asciidoc/latest/tables/align-by-cell/
Related
- Follow-up from Tables: Implement cell spanning (colspan/rowspan) #276
Metadata
Metadata
Assignees
Labels
No labels