MarkdownDocumentBuilder

MarkdownDocumentBuilder

Overview

MarkdownDocumentBuilder is a class in Aspose.Words FOSS for Python.

LDM cursor/writer used by :class:MarkdownReaderContext.

This class declares 24 methods for 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. 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

NameTypeAccessDescription
last_section_last_child-ReadDocument.LastSection.Body.LastChild — the last top-level body node.
is_capturing_hyperlinkboolReadWhether text written now lands in a hyperlink label, not in a run.
document-ReadGets the document.
bold-ReadGets the bold.
italic-ReadGets the italic.
font-ReadGets the font.
current_paragraphldm.ParagraphReadGets the current paragraph.

Methods

SignatureDescription
__init__()Calls init on this MarkdownDocumentBuilder instance.
push_container(container: list)Method starts a new Markdown container (e.g., a list or blockquote) before writing its child elements
pop_container()Calls pop_container on this MarkdownDocumentBuilder instance.
new_paragraph() → ldm.ParagraphAppend 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)Followed by writeln() emits a line of Markdown text and terminates the line
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.CellCalls 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.ParagraphStart 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.

See Also