Skip to content

endnotes

endnotes

Contains the endnotes of the document.

EndnotesPart

EndnotesPart(
    partname: PackURI,
    content_type: str,
    element: CT_Endnotes,
    package: Package,
)

Bases: StoryPart

Container part for the endnotes of the document.

The endnote half of FootnotesPart; word/endnotes.xml holds the same shape of content as word/footnotes.xml.

Source code in src/docx/parts/endnotes.py
def __init__(
    self, partname: PackURI, content_type: str, element: CT_Endnotes, package: Package
):
    super().__init__(partname, content_type, element, package)
    self._endnotes = element

endnotes property

endnotes: Endnotes

An Endnotes proxy for the w:endnotes root element of this part.

default classmethod

default(package: Package) -> Self

A newly created endnotes part.

It holds the two structural endnotes Word requires — the separator and the continuation separator, at ids -1 and 0 — and no author endnotes.

Source code in src/docx/parts/endnotes.py
@classmethod
def default(cls, package: Package) -> Self:
    """A newly created endnotes part.

    It holds the two structural endnotes Word requires — the separator and the
    continuation separator, at ids -1 and 0 — and no author endnotes.
    """
    partname = PackURI("/word/endnotes.xml")
    content_type = CT.WML_ENDNOTES
    element = cast("CT_Endnotes", parse_xml(cls._default_endnotes_xml()))
    return cls(partname, content_type, element, package)