node_block_card

class atlas_doc_parser.nodes.node_block_card.NodeBlockCardAttrsDatasourceView(type: str = OPT, properties: Dict[str, Any] = OPT)[source]

A view configuration for a datasource.

Parameters:
  • type – Required. The view type identifier.

  • properties – Optional. Additional view properties.

class atlas_doc_parser.nodes.node_block_card.NodeBlockCardAttrsDatasource(id: str = OPT, parameters: Dict[str, Any] = OPT, views: list[NodeBlockCardAttrsDatasourceView] = OPT)[source]

Datasource configuration for NodeBlockCardAttrs.

Parameters:
  • id – Required. The datasource identifier.

  • parameters – Required. Datasource parameters (structure varies).

  • views – Required. Array of view configurations (minimum 1 item).

class atlas_doc_parser.nodes.node_block_card.NodeBlockCardAttrs(url: str = OPT, localId: str = OPT, datasource: NodeBlockCardAttrsDatasource = OPT, width: float = OPT, layout: str = OPT, data: Dict[str, Any] = OPT)[source]

Attributes for NodeBlockCard.

The blockCard attrs supports three variants (anyOf):

  1. Datasource variant (requires datasource): - datasource: Datasource configuration - url: Optional URL - width: Optional width - layout: Optional layout mode

  2. URL variant (requires url): - url: The URL for the smart link

  3. Data variant (requires data): - data: Inline data object

All variants may include localId.

Parameters:
  • url – Optional. The URL for the smart link.

  • localId – Optional. A local unique identifier for the node.

  • datasource – Optional. Datasource configuration for data-driven cards.

  • width – Optional. Width of the card (datasource variant only).

  • layout – Optional. Layout mode: wide, full-width, center, wrap-right, wrap-left, align-end, align-start.

  • data – Optional. Inline data object (data variant only).

class atlas_doc_parser.nodes.node_block_card.NodeBlockCard(type: str = 'blockCard', attrs: NodeBlockCardAttrs = REQ)[source]

A block-level smart link card.

The blockCard node displays a rich preview of linked content as a standalone block element. It can be configured with a URL, datasource, or inline data.

This is a top-level block node that renders as a card with metadata from the linked resource (title, description, icon, etc.).

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:

  1. 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.

  2. 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=True to gracefully skip nodes that fail to convert. This flag should be propagated recursively to all nested to_markdown() calls via helper functions like content_to_markdown().

  3. 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.