type_enum¶
Atlassian Document Format (ADF) type enumeration.
This module defines the TypeEnum enum containing all valid type field values
for ADF nodes and marks.
Reference:
ADF Structure: https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/
Full JSON Schema: https://unpkg.com/@atlaskit/adf-schema@51.5.4/dist/json-schema/v1/full.json
- class atlas_doc_parser.type_enum.TypeEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Enumeration of all valid
typefield values in Atlassian Document Format (ADF).ADF is a rich text format used in Confluence pages and Jira issue fields. Each ADF element (node or mark) has a
typefield that identifies its kind.Marks (inline formatting applied to text nodes):
alignment- Text alignment (left, center, right)annotation- Inline comments/annotationsbackgroundColor- Background color highlightingborder- Border stylingbreakout- Layout breakout modecode- Inline code formatting (monospace)em- Emphasis (italic text)indentation- Text indentation levellink- Hyperlinkstrike- Strikethrough textstrong- Strong emphasis (bold text)subsup- Subscript or superscript texttextColor- Text colorunderline- Underlined text
Nodes (structural elements that form the document tree):
doc- Root document nodetext- Plain text content (leaf node)paragraph- Paragraph blockheading- Heading (h1-h6)bulletList- Unordered listorderedList- Ordered (numbered) listlistItem- List item within bullet/ordered listblockquote- Block quotationcodeBlock- Code block with syntax highlightingtable- Table containertableRow- Table rowtableCell- Table data celltableHeader- Table header cellpanel- Info/warning/error/note panelrule- Horizontal rule (divider)hardBreak- Hard line breakmention- User/team mentionemoji- Emoji characterdate- Date picker valuestatus- Status lozengemedia- Media file (image/video/file)mediaGroup- Group of media itemsmediaSingle- Single media item with layoutmediaInline- Inline mediainlineCard- Inline smart link cardblockCard- Block smart link cardembedCard- Embedded content cardexpand- Expandable/collapsible sectionnestedExpand- Nested expandable sectionlayoutSection- Multi-column layout containerlayoutColumn- Column within layout sectiontaskList- Task/checkbox listtaskItem- Task/checkbox itemdecisionList- Decision listdecisionItem- Decision itemextension- App extension (block-level)inlineExtension- App extension (inline)bodiedExtension- App extension with body contentplaceholder- Placeholder textcaption- Media caption
- Reference:
- atlas_doc_parser.type_enum.check_type_match(type_value: str, expected_types: TypeEnum | list[TypeEnum]) bool[source]¶
Check if a type string matches one or more expected TypeEnum values.
This helper function is used to validate ADF element types during parsing. It compares a raw type string from JSON against expected TypeEnum member(s).
- Parameters:
type_value – The raw
typefield value from ADF JSON (e.g., “paragraph”, “text”).expected_types – A single TypeEnum member or list of TypeEnum members to match against. If a list is provided, returns True if type_value matches ANY of the expected types.
- Returns:
True if type_value matches (any of) the expected type(s), False otherwise.
Example:
>>> check_type_match("paragraph", TypeEnum.paragraph) True >>> check_type_match("text", [TypeEnum.paragraph, TypeEnum.text]) True >>> check_type_match("heading", TypeEnum.paragraph) False