Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

French typography

Started by Brice Boucard 4 years ago · 28 replies · 1074 views
4 years ago

@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 🙂

@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...

4 years ago

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

4 years ago

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

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

4 years ago

@pamtbaau ah ! I was testing my PHP settings, with various versions... Thanks 🙂

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

4 years ago

@bricebou:
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…

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. :-)

4 years ago

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

4 years ago

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:

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

My user/config/site.yaml is:

TXT
default_lang: fr

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

YAML
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:

YAML
---
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

TWIG
{% 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:

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

the result is

HTML
<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!

4 years ago

@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?

4 years ago

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!

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 80 9 hours ago
General · by pamtbaau, 14 hours ago
1 51 14 hours ago
General · by Andy Miller, 1 day ago
0 44 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago