docx_plus.bookmarks.read¶
Read every bookmark in a document. Each BookmarkInfo carries the
bookmark's id, name, the anchored text (what a REF bookmark_name
field would resolve to), and the paragraph index where the
bookmarkStart marker sits.
docx_plus.bookmarks.read ¶
Read every bookmark from a document.
Returns one :class:BookmarkInfo per <w:bookmarkStart> paired with
its matching <w:bookmarkEnd>. The anchored text is what a REF
bookmark_name field would resolve to.
This module imports only from docx_plus.core (SPEC §9.1).
BookmarkInfo
dataclass
¶
A bookmark with the text it anchors to.
Attributes:
| Name | Type | Description |
|---|---|---|
bookmark_id |
int
|
The |
name |
str
|
The |
anchored_text |
str
|
The text between |
paragraph_index |
int
|
Zero-based index (within
|
read_bookmarks ¶
Return every bookmark in doc paired with the text it anchors to.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc
|
Document
|
The python-docx :class: |
required |
Returns:
| Name | Type | Description |
|---|---|---|
One |
list[BookmarkInfo]
|
class: |