Skip to main content

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, no jinja2, 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 · images · > 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

larzmark-0.1.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

larzmark-0.1.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

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

Hashes for larzmark-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4941acb6f4e3868a99a4cd961948fd68e20a87e1da46f857a4da9bd500b0ef25
MD5 acb3da678271eddc3dabe2e4f2e640c8
BLAKE2b-256 f39a8be172eb1fd583efcaa9487f323e9dc2f3c9b0a8254d87be4d78f2a5e3d2

See more details on using hashes here.

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

Hashes for larzmark-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b54b2be6bc77a992bffddc757f22767e3cc9e3e416424163534cdbf82a9b3f6a
MD5 1582788941a8c226d04c7448bf75ad4c
BLAKE2b-256 5ae2edc661f7572ca2c93e28e79e19caa9d3befed08ff9102d04a1aa6cca0108

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page