spipremix/typographer

Typography correction tool for usage in SPIP CMS.

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

pkg:composer/spipremix/typographer

dev-master 2021-11-22 10:40 UTC

This package is auto-updated.

Last update: 2025-09-22 17:51:00 UTC


README

SpipRemix Typographer is a tool that provide microtypography corrections for SPIP contents.

It relies on SpipRemix/Typography, which itself relies on JoliCode/JoliTypo library.

Installation

composer require spipremix/typographer

Notes

This Typographer determines the default locale to use from SPIP environment. Il also calls a SPIP pipeline (typography_rules) to modify or complete the default used rules.

Usage

use SpipRemix/Typographer/Typographer;

// This will choose locale from globals or constant in usage in SPIP CMS,
// and rules to apply for that locale by calling `typography_rules` pipeline.
$typographer = new Typographer();

$htmlContent = $typographer->fix($htmlContent);
$stringContent = $typographer->fixString($stringContent);

You can specify the locale and rules to use :

// Specify locale
$typographer = new Typographer('fr_FR');
// Or just a lang (a common mapping is done, see Typographer::MAP_LANG_TO_LOCALE)
$typographer = new Typographer('fr');
// Second parameter is for a specific rules list to use
$typographer = new Typographer('fr_FR', ['SmartQuotes', 'CurlyQuotes']);