paragraphs
Run 요소를 포함한 문단 컬렉션.
노트
API 시그니처와 docstring 은 Python 소스에서 자동 생성되어 영문으로 표시됩니다.
paragraphs.ParagraphCollection
collections.paragraphs.ParagraphCollection(app)doc.paragraphs — ordinal-access paragraph collection.
Iteration uses Section(0).Paragraph(i) on the active HWP document. When the underlying handle can’t enumerate (e.g. no document open), the collection behaves as empty.
Methods
| Name | Description |
|---|---|
| names | Ordinal strings — paragraphs have no intrinsic names. |
names
collections.paragraphs.ParagraphCollection.names()Ordinal strings — paragraphs have no intrinsic names.
paragraphs.Paragraph
collections.paragraphs.Paragraph(app, index, raw=None)Value object for a single paragraph (ordinal only).
Attributes
| Name | Description |
|---|---|
| charshape | :class:~hwpapi.low.parametersets.CharShape snapshot for this |
| parashape | :class:~hwpapi.low.parametersets.ParaShape snapshot for this |
| runs | Runs covering this paragraph. Phase 4 returns a single-element |
| style | Paragraph style name (e.g. “바탕글”). Empty string on failure. |
| text | Paragraph text. Returns "" when the backend cannot resolve it. |
paragraphs.Run
collections.paragraphs.Run(paragraph, start=0, end=-1)A run — contiguous slice of a :class:Paragraph sharing a :class:~hwpapi.low.parametersets.CharShape.
Phase 4 ships a single-run stub covering the whole paragraph; a future phase can split on CharShape boundaries by walking the characters.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| paragraph | Paragraph | Owning paragraph value object. | required |
| start | int | Character offsets into :attr:Paragraph.text (Python slice semantics). end == -1 means “to end of paragraph”. |
0 |
| end | int | Character offsets into :attr:Paragraph.text (Python slice semantics). end == -1 means “to end of paragraph”. |
0 |
| Attributes | required | ||
| not | required |
Attributes
| Name | Description |
|---|---|
| charshape | Best-effort :class:CharShape — currently the paragraph’s. |
| paragraph | The :class:Paragraph this run belongs to. |
| text | Substring of the paragraph text covered by this run. |