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 order attribute 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 listItem nodes in orderedList.content

  • Inner loop: iterates over listItem.content which contains both paragraph (text) and nested orderedList nodes

Note

This structure differs from to_markdown() where nested taskList nodes are siblings of taskItem nodes, not children. See NodeTaskList for comparison.

See also