Skip to content

Spec/Tables: Implement Automatic Header Promotion, Shorthand Options & Cell Styles #110

Description

@webmaven

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestspecRequired by the AsciiDoc specification

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions