MarkdownDocumentBuilder
Overview
MarkdownDocumentBuilder is a class in Aspose.Words FOSS for Python.
LDM cursor/writer used by :class:MarkdownReaderContext.
This class provides 24 methods for working with MarkdownDocumentBuilder objects in Python programs.
Available methods include: __init__, clear_font, current_footnote_body, end_hyperlink, end_row, end_table, flush_footnotes, insert_cell, insert_footnote, insert_horizontal_rule, insert_html, insert_image, and 12 additional methods.
All public members are accessible to any Python application after installing the Aspose.Words FOSS for Python package.
Properties: bold, current_paragraph, document, font, is_capturing_hyperlink, italic, and 1 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
last_section_last_child | `` | Read | Document.LastSection.Body.LastChild — the last top-level body node. |
is_capturing_hyperlink | bool | Read | Whether text written now lands in a hyperlink label, not in a run. |
document | `` | Read | Gets the document. |
bold | `` | Read | Gets the bold. |
italic | `` | Read | Gets the italic. |
font | `` | Read | Gets the font. |
current_paragraph | ldm.Paragraph | Read | Gets the current paragraph. |
Methods
| Signature | Description |
|---|---|
__init__() | Calls init on this MarkdownDocumentBuilder instance. |
push_container(container: list) | Calls push_container(container) on this MarkdownDocumentBuilder instance. |
pop_container() | Calls pop_container on this MarkdownDocumentBuilder instance. |
new_paragraph() → ldm.Paragraph | Append a fresh paragraph to the current container without |
moving the cursor there (used by footnote-body management). |
| remove_body_child(node) | Calls remove_body_child(node) on this MarkdownDocumentBuilder instance. |
| write(text: str) | Calls write(text) on this MarkdownDocumentBuilder instance. |
| writeln() | Insert a paragraph break: finish the current paragraph and move
the cursor to a fresh one in the same container. |
| insert_image(image_data: ldm.ImageData, width: Optional[float], height: Optional[float], name: str) → Optional[ldm.Shape] | Insert an inline image Shape (Aspose.Words’ DocumentBuilder.InsertImage). |
| push_font() | Calls push_font on this MarkdownDocumentBuilder instance. |
| pop_font() | Calls pop_font on this MarkdownDocumentBuilder instance. |
| clear_font() | Calls clear_font on this MarkdownDocumentBuilder instance. |
| push_para_pr() | Calls push_para_pr on this MarkdownDocumentBuilder instance. |
| pop_para_pr() | Calls pop_para_pr on this MarkdownDocumentBuilder instance. |
| insert_cell() → ldm.Cell | Calls insert_cell on this MarkdownDocumentBuilder instance. |
| end_row() | Calls end_row on this MarkdownDocumentBuilder instance. |
| end_table() | Calls end_table on this MarkdownDocumentBuilder instance. |
| start_hyperlink(uri: str, title: str) | Calls start_hyperlink(uri, title) on this MarkdownDocumentBuilder instance. |
| insert_horizontal_rule() | DocumentBuilder.InsertHorizontalRule. |
| end_hyperlink() | Calls end_hyperlink on this MarkdownDocumentBuilder instance. |
| insert_footnote() → ldm.Paragraph | Start a footnote body; returns the paragraph the reference to
it should resume at once the footnote is closed. |
| current_footnote_body() → list[ldm.Paragraph] | Calls current_footnote_body on this MarkdownDocumentBuilder instance. |
| move_to(paragraph: ldm.Paragraph) | Return the cursor to paragraph after finishing a footnote body. |
| flush_footnotes(style_name: str) | Append every footnote body collected so far to the end of the
document body, tagging each paragraph with *style_name*. |
| insert_html(html: str, options: int) | Calls insert_html(html, options) on this MarkdownDocumentBuilder instance. |