meniam/typograph-bundle
Symfony bundle that adds a Twig filter for typographing text using E. Muravjev's Typograph. Install via Composer, register the bundle, then apply {{ content | typograph }} in templates. Supports multiple named configs so different content types, like articles or news, can use their own typography se...
Setting a typographic quality bar for rendered content. The package exposes one capability — automatic Russian typography correction (smart quotes «», em/en dashes, ellipses, non-breaking spaces, hanging punctuation) — behind a single filter: {{ content | typograph }}. That forces an explicit product decision: is typographic correctness a first-class quality signal for customer-facing copy, or a cosmetic nice-to-have we defer? For Russian-language editorial surfaces, the answer is usually the former.
Build vs. buy for a non-differentiating utility. This is a thin Symfony adapter around E. Muravjev's Typograph algorithm (mdash.ru), not an original implementation. The real decision is whether to depend on a third-party algorithmic text transformer or own ~a few hundred lines of regex rules in-house. Since typography is not a competitive moat, buying (or vendoring) is the defensible default.
Where the work lands on the roadmap. Best fit is editorial/CMS surfaces: article bodies, comments and reviews, product descriptions, marketing email templates, and generated PDFs/invoices. This is a "polish sprint" item, not a platform initiative — scope it accordingly.
Localization depth beyond translation strings. Typography rules are locale-specific. Adopting a rule-based typographer is a visible, low-cost lever for perceived quality in Russian-speaking markets and a concrete signal that localization investment goes past string tables.
Dependency posture for a low-stakes component. 0 stars, 0 dependents, last release December 2021, and a Symfony 4-era AppKernel.php registration model. That combination makes this a vendor-or-fork candidate, not a long-term platform dependency — which is itself a product decision about acceptable supply-chain risk for a utility we could replace in a day.
Cheap-to-reverse trialing. The feature is a pure, stateless string transformation with no schema, no migration, and no persistent state. It isolates cleanly behind an interface, so the cost of adopting and abandoning it is near zero. That is an argument for a short spike rather than a long debate.
Caching and storage architecture. Because typographing is regex-heavy, the decision to format at read time versus precomputing a body_formatted column (filled by a queued backfill) is a product-visible performance trade-off — typically the difference between a ~40 ms and a ~4 ms list-page render. Worth an explicit decision before launch, not after.
Consider it when:
it-blaster → meniam rename, pin the exact version, commit the lockfile, and plan for the upstream to vanish.Look elsewhere — or use the underlying library directly — when:
{{ content | typograph }} into Blade produces a syntax error, not a typography fix. In Laravel, take meniam/typograph (the underlying library) and bind it behind a singleton plus a helper or Blade directive — roughly 30 minutes of reading vendor/.alt text, and code blocks — and it will happily rewrite --> and straight quotes inside code samples.To executives (one paragraph): We have a small, MIT-licensed utility that automatically applies correct Russian typography — proper quotation marks, em dashes, non-breaking spaces — to rendered content. It is a quality-polish feature for editorial and marketing surfaces in our Russian-language markets, reversible in a day, and costs nothing to license. The caveat is that the open-source project is effectively unmaintained, so I recommend we vendor a copy rather than take it as a live dependency. Expected effort: small, contained to rendering.
To engineering (the ask): This is a Symfony bundle, not a Laravel package — treat it as a reference implementation, not a drop-in. Two paths: (a) vendor the bundle and adapt its Twig extension and DependencyInjection/Configuration.php into a config/typograph.php plus a TypographService singleton and a @typograph() Blade directive, or (b) skip the bundle entirely and depend on meniam/typograph directly behind that same service. Path (b) is my recommendation — fewer moving parts, one less abandoned wrapper.
Non-negotiables before we ship:
composer.lock, and assume we may need to maintain a fork._formatted column via a queued backfill — do not mutate the stored source. Typography is presentation, not storage; editors need their raw text back.'"Привет" - мир' → '«Привет» — мир') in a unit test. These libraries tend to return input unchanged on internal error rather than throwing — "no exception" does not mean "it worked."What success looks like: a visible lift in editorial polish on Russian-language surfaces, zero change to stored data, and a component we could rip out in an afternoon if it disappoints.
How can I help you explore Laravel packages today?