Documentation

Runtimes

polytypo is a typography library with five runtimes. Install and call it from JavaScript and TypeScript, Python, Go, Ruby and PHP.

Updated · spec 1.33.0

  • JavaScript and TypeScript polytypo is a typography library for JavaScript and TypeScript: it fixes quotes, dashes, ellipses and no-break spaces for each locale. Install it from npm, call transform and analyze, read error codes, and see which modes and dialects the package covers.
  • Python polytypo is a typography library for Python: it fixes quotes, dashes, ellipses and no-break spaces for each locale. Install it from PyPI, call transform and analyze with keyword arguments, handle PolytypoError codes, and see which modes and dialects the package covers.
  • Go polytypo is a typography library for Go: it fixes quotes, dashes, ellipses and no-break spaces for each locale. Install the module, call Transform and Analyze with an Options struct, check *polytypo.Error codes, and see which modes and dialects it covers.
  • Ruby polytypo is a typography library for Ruby: it fixes quotes, dashes, ellipses and no-break spaces for each locale. Install the gem, call Polytypo.transform and Polytypo.analyze with keyword arguments, rescue Polytypo::Error codes, and see which modes the gem covers.
  • PHP polytypo is a typography library for PHP: it fixes quotes, dashes, ellipses and no-break spaces for each locale. Install it with Composer, call Polytypo::transform and Polytypo::analyze with named arguments, catch PolytypoException codes, and see which modes PHP covers.

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.