Documentation

Installation

Install polytypo for JavaScript, Python, Go, Ruby or PHP and make a first call.

Updated · spec 1.12.0

polytypo has one specification and five implementations. They are separate packages with the same behaviour for the same spec version: the same input, locale and options produce the same output in all of them.

Install commands and the exact call shape for each language are on its runtime page: JavaScript, Python, Go, Ruby, PHP.

First call #

import { transform } from "polytypo";

transform('He said "wait..." -- twice.', { locale: "en-US" });
transform(input, { locale: "en-US" })

Input

He said "wait..." -- twice.

Output

He said “wait…”—twice.

That is the whole shape: a string and a locale in, a string out. Anything else is an option on that call. Next:

  1. Pick the mode that matches what your string is.
  2. Pick the locale your text is written in.
  3. Read Options for what else a call can say.

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.