paper-docxAPI referencelinks
docx.links
paper-docx 0.2.0 API reference
Create and retarget hyperlinks on existing text.
add_hyperlink
funcadd_hyperlink(document: 'Document', span: 'Span', address: str) -> HyperlinkWrap span's runs in a hyperlink pointing at address.
Visible text stays; Word shows it in the Hyperlink character style, which this defines when the document lacks it. Refuses a protected document, a stale or foreign span, a span crossing paragraphs, a field result, an existing hyperlink, and a data-bound, locked or plain-text control surface.
paramdocument'Document'paramspan'Span'paramaddressstrReturns
docx.text.hyperlink.Hyperlinkcheck_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]