node_mention¶
- class atlas_doc_parser.nodes.node_mention.NodeMentionAttrs(id: str = REQ, localId: str = OPT, text: str = OPT, accessLevel: str = OPT, userType: Literal['DEFAULT', 'SPECIAL', 'APP'] = OPT)[source]¶
Attributes for
NodeMention.- Parameters:
id – Required. The Atlassian Account ID or collection name of the mentioned user.
localId – Optional. A unique identifier for the node.
text – Optional. The textual representation of the mention, including the leading @ symbol (e.g., “@Bradley Ayers”).
accessLevel – Optional. The access level of the mentioned user. Values: “NONE”, “SITE”, “APPLICATION”, or “CONTAINER”.
userType – Optional. The type of user being mentioned. Values: “DEFAULT” (regular user), “SPECIAL” (special collection like “all”), or “APP” (application).
- class atlas_doc_parser.nodes.node_mention.NodeMention(type: str = 'mention', attrs: NodeMentionAttrs = REQ)[source]¶
An inline mention node in ADF.
The mention node represents a user mention (@mention) in the document. It can reference individual users by their Atlassian Account ID, or special collections like “all” for mentioning everyone.
- 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.