node_task_list¶
- class atlas_doc_parser.nodes.node_task_list.NodeTaskListAttrs(localId: str = REQ)[source]¶
Attributes for
NodeTaskList.- Parameters:
localId – A unique identifier for the task list.
- class atlas_doc_parser.nodes.node_task_list.NodeTaskList(type: str = 'taskList', attrs: NodeTaskListAttrs = REQ, content: list[NodeTaskItem | NodeTaskList | NodeBlockTaskItem] = REQ)[source]¶
A container for task/checkbox items.
The taskList node is a block node that groups multiple taskItem nodes together for rendering as a checklist. It can also contain nested taskList nodes for hierarchical task structures.
- to_markdown(level: int = 0, ignore_error: bool = False) str[source]¶
Convert the task list to Markdown format.
ADF Structure (nested list is a sibling of taskItem):
taskList ├── taskItem (item 1) → [text nodes] ← text directly in content ├── taskList (nested) ← nested list is SIBLING of taskItem │ ├── taskItem (item 1.1) │ └── taskList (nested) │ └── taskItem (item 1.1.1) ├── taskItem (item 2) ├── taskList (nested) ...
Implementation: Uses a single loop because:
taskItemand nestedtaskListare siblings intaskList.contentText nodes are directly inside
taskItem.content(no wrapper like paragraph)The loop handles both
taskItem(render with checkbox) andtaskList(recursive call with increased level) in the same iteration
Note
This structure differs from
to_markdown()andto_markdown()where nested lists are children oflistItemnodes, requiring two nested loops.See also
to_markdown()- different structure, two loopsto_markdown()- different structure, two loops