Page API Reference

Reference documentation for methods and properties of the Page class.

MemberKindSignatureDescription
title()Methodtitle(text: str)Appends a primary H1 heading to the page
subtitle()Methodsubtitle(text: str)Appends an H2 section heading
text()Methodtext(content: str)Appends a standard paragraph text element
code()Methodcode(code: str, lang: str, filename: str)Renders syntax-highlighted code block
raw()Methodraw(html_str: str)Injects unescaped HTML directly into document stream
__iadd__()Methodpage += componentAppends component blueprint instance to page content

Method Example

demo_page.py
from metupy.page import Page
from metupy.components_blueprint import Alert

page = Page(title="API Showcase")

page.title("Main Heading")
page.subtitle("Sub Heading")
page.text("Standard text paragraph containing <code>inline code</code>.")
page.code("print('Hello World')", lang="python", filename="main.py")
page.raw("<div class='custom-box'>Raw HTML Content</div>")
page += Alert(title="Alert Box", message="Component added via += operator")