docx.notes
paper-docx 0.2.0 API reference
Create footnotes and endnotes, including the note body and the mark.
add_endnote
funcadd_endnote(document: 'Document', span: 'Span', text: str) -> intAttach an endnote to span and return its note id.
Creates the endnotes part on first use. Same refusals as add_footnote: protection, a
stale or foreign span, a span outside the main body, and one inside a text box, a field
result, or a data-bound, locked or plain-text control.
paramdocument'Document'paramspan'Span'paramtextstrReturns
intadd_footnote
funcadd_footnote(document: 'Document', span: 'Span', text: str) -> intAttach a footnote to span and return its note id.
Creates the footnotes part on first use. Refuses a protected document, a stale or foreign span, a span outside the main body, and one inside a text box, a field result, or a data-bound, locked or plain-text control.
paramdocument'Document'paramspan'Span'paramtextstrReturns
intcheck_install
funccheck_install() -> NoneRefuse when paper-docx and python-docx are both installed.
Returns
Nonerequire_span_owner
funcrequire_span_owner(document: 'Document', span: 'Span', *, argument: str = 'span') -> NoneRefuse a live span captured from a different document package.
paramdocument'Document'paramspan'Span'paramargumentstr= 'span'Returns
Nonerollback_on_error
funcrollback_on_error(document: 'Document', *participants: Any) -> Generator[None, None, None]Restore the live package and named mutable proxies after an error.
paramdocument'Document'paramparticipantsAny= ()Returns
typing.Generator[None, None, None]