node_table_header¶
- class atlas_doc_parser.nodes.node_table_header.NodeTableHeaderAttrs(colspan: int = OPT, rowspan: int = OPT, colwidth: list[int] = OPT, background: str = OPT, localId: str = OPT)[source]¶
Attributes for
NodeTableHeader.- Parameters:
colspan – Optional. Number of columns spanned (positive integer, defaults to 1).
rowspan – Optional. Number of rows spanned (positive integer, defaults to 1).
colwidth – Optional. Array of column widths in pixels; use 0 for flexible-width columns.
background – Optional. Cell background color using hex codes or HTML color names.
localId – Optional. A unique identifier for the node.
- class atlas_doc_parser.nodes.node_table_header.NodeTableHeader(type: str = 'tableHeader', attrs: NodeTableHeaderAttrs = OPT, content: list[NodeParagraph | NodePanel | NodeBlockquote | NodeOrderedList | NodeBulletList | NodeRule | NodeHeading | NodeCodeBlock | NodeMediaSingle | NodeMediaGroup | NodeDecisionList | NodeTaskList | NodeBlockCard | NodeEmbedCard | NodeExtension | NodeNestedExpand] = REQ)[source]¶
A cell within a table heading row.
The tableHeader node defines a cell in a table’s header row. It is a child block node of the tableRow node.
- to_markdown(ignore_error: bool = False) str[source]¶
Convert this node to Markdown format.
The default implementation raises
NotImplementedError. This is intentional for several reasons:Fail fast during development. When implementing new node types, we want to immediately discover which nodes haven’t implemented
to_markdown()rather than silently producing empty output or skipping content. This helps catch missing implementations early.The ignore_error parameter provides an escape hatch. In production, if our code has bugs or a node type is partially implemented, users can pass
ignore_error=Trueto gracefully skip nodes that fail to convert. This flag should be propagated recursively to all nestedto_markdown()calls via helper functions likecontent_to_markdown().Error handling is explicit. The library user decides whether to fail fast (for debugging and development) or degrade gracefully (for production use cases where partial output is acceptable).
Subclasses must override this method to provide actual conversion logic.
- Parameters:
ignore_error – If True, errors in nested conversions are silently skipped. If False (default), errors propagate immediately. This flag should be passed down to any nested
to_markdown()calls.- Returns:
The Markdown representation of this node.
- Raises:
NotImplementedError – Always raised by the base class to ensure subclasses implement this method.