French typography

@pamtbaau : hum, this warning doesn’t show up on my local installation… I thought I had set up my environment to display all notices… And even with the php.ini-development file in place… How did you notice this ?

Reading the PHP-Typography library code, I see it…
I will modify the code accordingly :slight_smile:

@Karmalakas will do ! I’ve started to update the README.md but didn’t pushed the changes.

@Netzhexe I didn’t found the latter but I think both of these plugins don’t perform what Better Typography does. More specifically, Better Typography can deal with multilingual content. But I may be wrong…

@bricebou, It is not PHP that is complaining, but Intelephense plugin of vscode.

Do not modify library code. It should stay in vendors exactly the same as installed.

@pamtbaau ah ! I was testing my PHP settings, with various versions… Thanks :slight_smile:

@Karmalakas yeah, of course ! I meant modify my code :slight_smile:

Yeah like I said, Typography Helper is not in GPM yet, but my link leads to its repository. And no, neither do what you are aiming for, but still you might want to take a look at the code – I personally learn a lot from looking at other people’s plugins. :slight_smile:

I meant before I start to work on this Better Typography plugin :slight_smile: Thanks for the links and for sure I’ll learn something reading other people’s plugin :wink:

Bonjour Brice,
Thank you for your patches on Github. Version 0.1.2 was installed successfully. Just remember to change the version n° in blueprints.yaml file.

Still, I failed to have the plugin have good result on pages output.

Here is my system:

My local website is in French (based on recent and updated default grav-admin-v1.7.34 not much modified).

My user/config/system.yaml contain:

pages:
  theme: quark
  markdown:
    extra: false
  process:
    markdown: true
    twig: false
languages:
  supported:
    - fr

My user/config/site.yaml is:

default_lang: fr

My user/config/plugins/better-typography.yaml is:

enabled: true
perLanguageSettings:
  -
    language: fr
    useSmartQuotes: true
    smartQuotesStyle: doubleGuillemetsFrench
    smartQuotesStyleSecondary: doubleCurled
    useSmartDashes: true
    smartDashesStyle: international
    applyHyphenations: true
    applyFrenchSpecific: true
    useSmartDiacritics: false
    smartDiacriticsLanguage:

My modular modular_test.md is:

---
menu: 'Test'
h2: 'Une "démonstration. . . --- rapide --- du plugin Better Typography"... Bien sûr, nous ne sommes plus au XVIe siècle! On teste les (c) ou (r) etc. mais aussi les 1/2 fractions, et les surfaces de 12m2. '
---
Une "démonstration. . . --- rapide --- du plugin Better Typography"... Bien sûr, nous ne sommes plus au XVIe siècle! On teste les (c) ou (r) etc. mais aussi les 1/2 fractions, et les surfaces de 12m2. 

My modular_test.html.twig is

{% set test_h2 = page.header.h2 %}
<h2>{{ test_h2 }}</h2>
{{ content|raw }}

and the output is unchanged.
Does this mean that your twig filter is required everywhere?

When adding your twig filter:

<h2>{{ test_h2|bettertypo('fr') }}</h2>
{{ content|raw|bettertypo('fr') }}

the result is

<p>Une «&nbsp;démonstration… — rapide — du plugin Better Typography&nbsp;»… Bien sûr, nous ne sommes plus au XVI<sup class="ordinal">e</sup> siècle&nbsp;! On teste les © ou ® etc. mais aussi les <sup class="numerator">1</sup>⁄<sub class="denominator">2</sub> fractions, et les surfaces de 12&nbsp;m². </p>

and when removing |raw, result is same.

What did I miss?

Otherwise, seems to be a great plugin for French users. Thank you for the effort!

@red, @bricebou, Excusez-moi, would you agree the repo of the Better Typography plugin might be a better place to continue this discussion on the specifics of the Better Typography plugin?

Well, I was not sure where to place it. I thought I should not open a new issue on the Github repository as it might not be a problem with the plugin anymore, may be just related to my Grav installation/settings.
Anyway, I copied my above post in a new issue in the better-typography’s github page and will continue there. Merci @pamtbaau for alerting!