Skip to content

Commit 2793f96

Browse files
committed
1 parent 0cf6d71 commit 2793f96

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/docx/parts/numbering.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from ..opc.part import XmlPart
44
from ..shared import lazyproperty
5+
from docx.oxml import parse_xml
6+
from docx.oxml.ns import nsdecls
57

68

79
class NumberingPart(XmlPart):
@@ -12,7 +14,12 @@ class NumberingPart(XmlPart):
1214
def new(cls):
1315
"""Return newly created empty numbering part, containing only the root
1416
``<w:numbering>`` element."""
15-
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)
1623

1724
@lazyproperty
1825
def numbering_definitions(self):

0 commit comments

Comments
 (0)