From 60600a9a213ed1ecbd05feaff95ec4f56390fe7c Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Wed, 25 Jun 2025 02:33:49 -0400 Subject: [PATCH] updated codeblock in index --- content/index.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/content/index.md b/content/index.md index 9b1426e..79b7695 100644 --- a/content/index.md +++ b/content/index.md @@ -7,6 +7,21 @@ title: My First Post - This post has some content. ```python -def foo(): - return "bar" +def md_to_html( + content: str, + resolve_links: bool = False, + source: Path | None = None, + layout: Layout | None = None, + item_map: dict[Path, Item] | None = None, +) -> str: + if resolve_links and (source is None or layout is None or item_map is None): + raise TypeError( + "md_to_html() missing source and ctx when resolve_links is true" + ) + parser = Parser() + ast = parser.parse(content) + renderer = ZonaRenderer( + resolve_links, source, layout=layout, item_map=item_map + ) + return renderer.render(ast) ```