We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0cf6d71 commit 2793f96Copy full SHA for 2793f96
src/docx/parts/numbering.py
@@ -2,6 +2,8 @@
2
3
from ..opc.part import XmlPart
4
from ..shared import lazyproperty
5
+from docx.oxml import parse_xml
6
+from docx.oxml.ns import nsdecls
7
8
9
class NumberingPart(XmlPart):
@@ -12,7 +14,12 @@ class NumberingPart(XmlPart):
12
14
def new(cls):
13
15
"""Return newly created empty numbering part, containing only the root
16
``<w:numbering>`` element."""
- raise NotImplementedError
17
+ xml_str = '<w:numbering {}></w:numbering>'.format(nsdecls('w'))
18
+ numbering_xml = parse_xml(xml_str)
19
+ content_type = 'application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml'
20
+ partname = '/word/numbering.xml'
21
+
22
+ return cls(partname, content_type, numbering_xml, None)
23
24
@lazyproperty
25
def numbering_definitions(self):
0 commit comments