node_emoji

class atlas_doc_parser.nodes.node_emoji.NodeEmojiAttrs(shortName: str = REQ, id: str = OPT, text: str = OPT, localId: str = OPT)[source]

Attributes for NodeEmoji.

Parameters:
  • shortName – Required. The emoji short name identifier (e.g., “:grinning:”, “:thumbsup:”).

  • id – Optional. The emoji service ID. The format varies by emoji type: - Standard Unicode emoji: Unicode codepoints (e.g., “1f3f3-1f308”) - Atlassian emoji: Prefixed with “atlassian-” (e.g., “atlassian-blue_star”) - Site/custom emoji: UUID format

  • text – Optional. The text representation of the emoji. If omitted, the shortName is displayed.

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

class atlas_doc_parser.nodes.node_emoji.NodeEmoji(type: str = 'emoji', attrs: NodeEmojiAttrs = REQ)[source]

An inline emoji node in ADF.

The emoji node represents emojis in three categories:

  • Standard — Unicode emoji (e.g., 😀, 🎉)

  • Atlassian — Non-standard emoji introduced by Atlassian (e.g., :atlassian:)

  • Site — Non-standard customer-defined emoji

Reference:

https://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/emoji/

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.