Description
Enhance table parsing and ASG generation to support automatic header row promotion (when a blank line follows the first row), table options shorthand (%header, %footer, %autowidth), and inline cell style specifiers.
Specification & ASG Requirements
- Header Promotion:
- In AsciiDoc, if an empty line immediately follows the first row of a table (and
cols does not override), the first row is promoted to a header row.
- Table Options:
- Support shorthand
[%header%footer%autowidth] and formal [options="header,footer"].
- Cell Formatting & Alignment:
- Ensure cell style specifiers (
a AsciiDoc, e emphasis, s strong, l literal, m monospace, h header, d default) cleanly nest within TableCell ASG nodes.
Proposed Changes
- Tests (TDD):
- Add local TCK fixtures under
tests/tck_harness/tests/block/table/.
- Add unit tests in
tests/test_blocks_parsing.py.
- Grammar & Transformer:
- Update table parsing in
src/asciidoctrine/transformers/block_transformer.py to handle header row detection and cell format propagation.
- Nodes & Backend:
- Update
Table, TableRow, and TableCell in nodes.py and DocutilsRenderer.visit_table in docutils_backend.py.
Description
Enhance table parsing and ASG generation to support automatic header row promotion (when a blank line follows the first row), table options shorthand (
%header,%footer,%autowidth), and inline cell style specifiers.Specification & ASG Requirements
colsdoes not override), the first row is promoted to a header row.[%header%footer%autowidth]and formal[options="header,footer"].aAsciiDoc,eemphasis,sstrong,lliteral,mmonospace,hheader,ddefault) cleanly nest withinTableCellASG nodes.Proposed Changes
tests/tck_harness/tests/block/table/.tests/test_blocks_parsing.py.src/asciidoctrine/transformers/block_transformer.pyto handle header row detection and cell format propagation.Table,TableRow, andTableCellinnodes.pyandDocutilsRenderer.visit_tableindocutils_backend.py.