node_ordered_list¶
- class atlas_doc_parser.nodes.node_ordered_list.NodeOrderedListAttrs(order: int = OPT, localId: str = OPT)[source]¶
Attributes for
NodeOrderedList.- Parameters:
order – Optional. Specifies the starting number for the list. Accepts values >= 0. Defaults to 1 when not specified.
localId – Optional. A unique identifier for the node.
- class atlas_doc_parser.nodes.node_ordered_list.NodeOrderedList(type: str = 'orderedList', attrs: NodeOrderedListAttrs = OPT, content: list[NodeListItem] = REQ)[source]¶
A container for an ordered (numbered) list.
The orderedList node is a top-level block node that groups multiple listItem nodes together for rendering as a numbered list. The
orderattribute can be used to specify the starting number.- to_markdown(level: int = 0, ignore_error: bool = False) str[source]¶
Convert the ordered list to Markdown format.
ADF Structure (nested list is a child of listItem):
orderedList ├── listItem (item 1) │ ├── paragraph → text nodes ← text wrapped in paragraph │ └── orderedList (nested) ← nested list is CHILD of listItem │ └── listItem (item 1.1) │ ├── paragraph │ └── orderedList (nested) ├── listItem (item 2) │ ├── paragraph │ └── orderedList (nested) ...
Implementation: Uses two nested loops because:
Outer loop: iterates over
listItemnodes inorderedList.contentInner loop: iterates over
listItem.contentwhich contains bothparagraph(text) and nestedorderedListnodes
Note
This structure differs from
to_markdown()where nestedtaskListnodes are siblings oftaskItemnodes, not children. SeeNodeTaskListfor comparison.See also
to_markdown()- same structure, uses bulletsto_markdown()- different structure, single loop