Documentation

Concepts

The guarantees behind polytypo: idempotency, rule order, locale resolution, the span model and round trip.

Updated · spec 1.12.0

  • The span model How html, markdown and yaml modes show the rules only the prose of a document, and why spans are joined with boundary markers instead of processed alone.
  • Round trip In html, markdown and yaml modes the output is your input with a few substring replacements applied, and nothing is re-serialised.
  • Idempotency Why transform(transform(x)) equals transform(x) is a contract in every runtime, and what it means for text that is already typeset.
  • Rule order The fixed order in which the nine polytypo rules run, why each sits where it does, why ranges is off by default, and how options never reorder them.
  • Locale resolution How the locale option becomes exactly one locale: exact match, alias, one region strip, and an error otherwise, never a fallback to English.
  • Invisible characters The four characters polytypo inserts that you cannot see, U+00A0, U+202F, U+2011 and U+2060, what inserts each, how to spot them, and the narrowNbsp option.

Already using polytypo? Add our badge

Two lines: a script tag and a span. No per-embed network call. Pick a language and a theme, then copy the code into your footer or credits. Embedding notes cover Content Security Policy. Sites with the badge are listed on Sites using polytypo.

<script async src="https://polytypo.dev/badge.js"></script>
<span data-polytypo-lang="en" data-polytypo-theme="light"></span>

Search runs in your browser. Nothing is sent anywhere.