# 0.3.1 URL: /releases/0.3.1/ Section: releases Tags: release, 0.3.1 Date: 2026-02-15 -------------------------------------------------------------------------------- 0.3.1 Released: 2026-02-15 Parse cache for incremental builds, excerpt support, runnable examples, and a fix for custom directive registration. Highlights Parse cache — Content-addressed (content_hash, config_hash) -> Document cache. Pass cache: ParseCache | None to parse(), Markdown.parse(), and Markdown.parse_many() for faster incremental builds (undo/revert, duplicate content). Excerpt support — extract_excerpt() and extract_meta_description() for structurally correct excerpt extraction from AST. Stops at block boundaries; optional plain text or HTML output. Useful for list previews, meta descriptions, search snippets. Examples — Runnable examples in examples/: basic, notebooks, AST (visitor, transform), directives, incremental, differ, plugins, advanced. Directive fix — parse() now accepts options kwarg (was opts), matching parser invocation and fixing custom directive registration. Features Parse Cache DictParseCache for in-memory use; hash_content() and hash_config() for key computation. Exported from patitas.cache and patitas top-level. from patitas import parse, DictParseCache cache = DictParseCache() doc = parse("# Hello", cache=cache) # Subsequent identical content hits cache Excerpt Support from patitas import parse, extract_excerpt, extract_meta_description source = "# Title\n\nFirst paragraph. Second sentence." doc = parse(source) extract_excerpt(doc, source) # Plain text extract_excerpt(doc, source, excerpt_as_html=True) # <p>, <div class="excerpt-heading"> extract_meta_description(doc, source) # ~160 chars at sentence boundary Examples Run with python examples/basic/hello_markdown.py etc. Covers: Basic (hello, Markdown class) Notebooks (parse_notebook) AST (visitor, transform) Directives (builtin, custom) Incremental, differ Plugins (math, tables, footnotes) Advanced (parallel parse, serialize) Installation pip install patitas>=0.3.1 pip install patitas[syntax] # Optional: syntax highlighting via Rosettes Breaking Changes None — all changes are backwards compatible. Documentation API Reference — parse(), render(), extract_excerpt(), ParseCache Bengal — Static site generator with native notebook support -------------------------------------------------------------------------------- Metadata: - Word Count: 255 - Reading Time: 1 minutes