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...
The typograph bundle for Symfony based on E. Muravjev's Typograph
Add meniam/typograph-bundle to your composer.json file and run composer
...
"require": {
"meniam/typograph-bundle": "1.0.*"
}
...
And register the bundle in your AppKernel.php
...
new TypographBundle\FenrizbesTypographBundle(),
...
The bundle contains a TwigExtension which can be used in your templates:
{{ content | typograph }}
The bundle allows you to pass options that E. Muravjev's Typograph supports. You can use a default config, redefine it:
typograph:
configs:
default:
Text.paragraphs: on
OptAlign.oa_oquote: off
OptAlign.oa_obracket_coma: off
or define your configs:
typograph:
configs:
default:
Text.paragraphs: off
OptAlign.oa_oquote: off
OptAlign.oa_obracket_coma: off
articles:
Text.paragraphs: on
news:
Text.paragraphs: off
and use them where you need:
{{ article.content | typograph('articles') }}
How can I help you explore Laravel packages today?