Library

Three ways to put Pilcrow into a build pipeline. Pick the one that matches the tools you already use.

Astro starter via create-pilcrow

If you have no blog yet and Astro is acceptable as the host framework, start here. npx create-pilcrow my-blog scaffolds a complete Astro project with the typesetting layer, image pipeline, OG cards, RSS, and sitemap pre-wired. The shape of the repository assumes you want what pilcrow.page itself ships, so the cost of getting started is roughly zero and the cost of disagreeing later is rewriting some Astro plumbing. Choose this when you are starting fresh and the editorial defaults are close enough to what you want that arguing with them is not worth your evening.

Eleventy plugin (pilcrow-eleventy)

If you already run an Eleventy site, or you prefer the 11ty model of small composable transforms over a framework that owns your routing, install pilcrow-eleventy. It registers as an ordinary plugin, opens one headless Chromium for the build, and replaces the inner paragraphs of any page that wraps its content in <div class="post-body">. Pages without that wrapper pass through untouched, so you can opt content in one layout at a time. Choose this when your site already exists and you want typesetting added to it rather than around it.

Next.js plugin (pilcrow-nextjs)

If your blog lives inside a Next.js application alongside product surfaces, install pilcrow-nextjs as a rehype plugin in the @next/mdx pipeline. The work happens at next build time only; serverless and edge runtimes are not viable hosts for Playwright. The output is static HTML baked into the compiled MDX, which means nothing ships to the reader at runtime on the typesetter's account. Choose this when Next.js is already paying its way for the rest of the site and you would rather add a build step than maintain a separate publishing tool.

The engine

All three options compose the same core: pilcrow-typeset, a small library that takes HTML and returns HTML with each paragraph broken into per-line spans. The adapters above are thin shims that pick up the conventions of their host framework and hand the body off to the same engine. If you are integrating into a build pipeline that is none of the above, the API reference is the place to start.

Credit

The line-breaking primitive is pretext by Cheng Lou. Pretext is a multilingual text-measurement library that decouples layout from the DOM; it is the load-bearing wall under everything Pilcrow ships. The editorial layer above it (drop caps, sidenote-aware spans, en-gb hyphenation, the orphan guard) is Pilcrow's contribution. Most of the credit for what you see on the page belongs upstream.