Skip to content

MkBuilder

Overview

The MkBuilder is used to created the Container/Block tree structure that represents a document.

Methods

@classmethod
def from_markdown(
    cls, 
    markdown_content : str, 
    document_title : str) -> Container:
Build the Container/Block tree structure that represents a document.

Usage Example

markdown_content = """
# Title

This is a paragraph."""

document_title = "Title"

container = MkBuilder.from_markdown(markdown_content, document_title)

print(container)

Output

Root container, Level: 0
└── Container, Level: 1, Section number: 1
    └── Container, Level: 1, Section number: 1
        └── Block, Level: 1, Section number: 1