larzmark
Markdown → HTML, and an SEO-first static site generator. Zero dependencies.
Turn a Markdown string into clean HTML, or turn a folder of Markdown files into a
complete static website — every page wrapped with a full set of SEO tags (title,
description, canonical, Open Graph, Twitter, JSON-LD) and a sitemap.xml, out of
the box.
import larzmark
# one string
larzmark.render("# Hello\n\nSome **bold** text.") # -> "<h1 id=...>Hello</h1>..."
# a whole site
larzmark.build_site("content/", "public/",
base_url="https://example.com",
site_name="My Site")
Why
- Zero dependencies. Pure standard library — no
markdown, nojinja2, no build toolchain. One import, and it runs anywhere Python does. - SEO is the default, not an add-on. Every generated page ships with the meta tags search engines and social cards actually read, plus JSON-LD structured data and a sitemap — driven straight from front matter.
- Real Markdown. Headings (with anchor ids), emphasis, code spans and fenced blocks, links, images, blockquotes, nested ordered/unordered lists, horizontal rules, and GFM pipe tables.
- Safe output. Text is HTML-escaped and URLs are sanitised, so untrusted
Markdown can't inject tags or break out of an
href. - Composable. Pair it with larzchart to embed inline SVG charts, or generate pages from data in larzdb.
Install
pip install larzmark
Front matter drives the SEO
---
title: My Post
description: A short, search-friendly summary.
type: article
date: 2026-07-26
author: Ada Lovelace
image: https://example.com/cover.png
---
# My Post
The first paragraph becomes the meta description if you don't set one.
build_site reads that and emits:
<title>My Post</title>
<meta name="description" content="A short, search-friendly summary.">
<link rel="canonical" href="https://example.com/blog/my-post.html">
<meta property="og:title" content="My Post">
<meta property="og:type" content="article">
<meta name="twitter:card" content="summary_large_image">
<script type="application/ld+json">{"@context":"https://schema.org","@type":"Article",...}</script>
API
render(md) |
Markdown string → HTML fragment |
parse_front_matter(text) |
(meta_dict, body) |
Document.parse(text) |
parsed doc with .title, .description, .html, .meta |
seo_head(title, description, canonical=, image=, ...) |
just the <head> SEO tags |
render_page(doc, canonical=, template=) |
one full HTML page |
build_site(src, out, base_url=, site_name=, template=) |
build a whole site + sitemap |
Bring your own template (a str.format string with {head}, {content},
{lang}) or use the built-in responsive, dark-mode-aware default.
Supported Markdown
Headings #–###### · bold · italic · code · fenced code blocks with
language classes · links · · > blockquotes · nested
-/1.
lists · --- rules · GFM pipe tables (with :--: alignment) ·
strikethrough · <https://autolinks>.
It's a practical, readable subset — the Markdown people actually write for docs, blogs, and READMEs — not a spec-exhaustive parser.
Tests
python -m unittest discover -s tests -v # 31 tests, zero deps
The Larz stack
Pure-Python, zero-dependency building blocks:
- larz — money-native web framework
- larzchain — from-scratch PoW blockchain
- larzmoney — exact, penny-perfect money
- larzcrypt — pure-Python cryptography toolkit
- larzdb — crash-safe embedded database
- larzagent — zero-dep AI agent framework
- larzchart — data to inline SVG charts
- larzmark — this library
License
MIT © larz-scripter
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file larzmark-0.1.0.tar.gz.
File metadata
- Download URL: larzmark-0.1.0.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4941acb6f4e3868a99a4cd961948fd68e20a87e1da46f857a4da9bd500b0ef25
|
|
| MD5 |
acb3da678271eddc3dabe2e4f2e640c8
|
|
| BLAKE2b-256 |
f39a8be172eb1fd583efcaa9487f323e9dc2f3c9b0a8254d87be4d78f2a5e3d2
|
File details
Details for the file larzmark-0.1.0-py3-none-any.whl.
File metadata
- Download URL: larzmark-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b54b2be6bc77a992bffddc757f22767e3cc9e3e416424163534cdbf82a9b3f6a
|
|
| MD5 |
1582788941a8c226d04c7448bf75ad4c
|
|
| BLAKE2b-256 |
5ae2edc661f7572ca2c93e28e79e19caa9d3befed08ff9102d04a1aa6cca0108
|