Add comprehensive numbering/list control. Most requested upstream feature (python-openxml#582: 83 comments, #25: 37 comments, python-openxml#122: 27 comments).
API Design
Restart numbering:
- paragraph.restart_numbering() — restarts the numbered list counter at 1
- Sets w:numPr > w:numId to a new abstract num with restart override
Custom list styles:
- document.numbering.add_numbering_definition(levels) — create a custom multi-level list
- Each level: number format (decimal, lowerAlpha, upperRoman, bullet), text pattern ("%1.", "%1.%2"), indent, font
- Returns a NumberingDefinition that can be applied to paragraphs
Nested lists:
- paragraph.list_level — get/set the indent level (0-8)
- paragraph.list_format — get/set the numbering definition and level
- Support multi-level lists: applying level 1 under a level 0 creates nesting
Access existing numbering:
- document.numbering.definitions — iterate all numbering definitions
- paragraph.numbering_format — read the current list style
XML
- w:numPr > w:numId (which numbering definition), w:ilvl (indent level)
- w:numbering > w:abstractNum (definition), w:num (instance with overrides)
- w:lvlOverride > w:startOverride for restart
Add comprehensive numbering/list control. Most requested upstream feature (python-openxml#582: 83 comments, #25: 37 comments, python-openxml#122: 27 comments).
API Design
Restart numbering:
Custom list styles:
Nested lists:
Access existing numbering:
XML
Upstream issues: python-openxml#582, #25, python-openxml#122