node_panel¶
- class atlas_doc_parser.nodes.node_panel.NodePanelAttrs(panelType: Literal['info', 'note', 'tip', 'warning', 'error', 'success', 'custom'] = REQ, panelIcon: str = OPT, panelIconId: str = OPT, panelIconText: str = OPT, panelColor: str = OPT, localId: str = OPT)[source]¶
Attributes for
NodePanel.- Parameters:
panelType – Required. The visual style of the panel. One of: “info”, “note”, “tip”, “warning”, “error”, “success”, “custom”.
panelIcon – Optional. Custom icon for the panel (used with “custom” type).
panelIconId – Optional. ID of the custom icon.
panelIconText – Optional. Alt text for the panel icon.
panelColor – Optional. Custom background color for the panel (used with “custom” type).
localId – Optional. A unique identifier for the node.
- class atlas_doc_parser.nodes.node_panel.NodePanel(type: str = 'panel', attrs: NodePanelAttrs = REQ, content: list[NodeParagraph | NodeHeading | NodeBulletList | NodeOrderedList | NodeBlockCard | NodeMediaGroup | NodeMediaSingle | NodeCodeBlock | NodeTaskList | NodeRule | NodeDecisionList | NodeExtension] = REQ)[source]¶
A container element for highlighting and visually distinguishing content.
The panel node is a top-level block node that wraps content in a styled box to draw attention. Different panel types provide visual cues for different purposes:
info: General information (blue)
note: Additional notes (purple)
tip: Helpful tips (green)
warning: Caution notices (yellow)
error: Error messages (red)
success: Success messages (green)
custom: User-defined styling with custom icon and color
- 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.