Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links with accentuated character #10

Closed
gilleschapron opened this issue Dec 4, 2023 · 3 comments
Closed

Links with accentuated character #10

gilleschapron opened this issue Dec 4, 2023 · 3 comments
Assignees

Comments

@gilleschapron
Copy link

Thanks you for your fantastic work on this mkdocs plugin.

I'm using it to make my doc which is bilingual, english and french.

When I make a wikilink to a title in french that have some accentuated characters (é, à, apostrophe ' etc.), these characters are kept in the generated link, and then the link does not work.

I have also multiple warning because I'm using
https://ultrabug.github.io/mkdocs-static-i18n/fr/getting-started/quick-start/
to simplify multiple language doc generation, and my files are stored in some subfolder "en" and "fr".

If you could add accentuated character conversion, it will be great (I'll will make a try myself).

Gilles

@GooRoo GooRoo self-assigned this Dec 4, 2023
@GooRoo
Copy link
Owner

GooRoo commented Dec 4, 2023

Hi @gilleschapron,
Thanks for the feedback.

This was done intentionally. I'm actually also using my plugin for bilingual docs (Ukrainian + English) and it somehow didn't work for me otherwise.

Good news is that AFAIR it's possible to override this behavior in the config. Bad news is that I don't remember how exactly. Let me check, pls.

@GooRoo
Copy link
Owner

GooRoo commented Dec 4, 2023

So, as I see in the code, I depend on the markdown_extensions.toc.slugify function. By default, it's the !!python/object/apply:markdown.extensions.toc.slugify_unicode and it should work fine.

However, if you redefine it to !!python/object/apply:pymdownx.slugs.slugify like it's recommended in Material for MkDocs examples, it probably would fail because of #3.

Maybe, you can try something like this in your mkdocs.yaml:

markdown_extensions:
  - toc:
      permalink: true
      slugify: !!python/object/apply:markdown.extensions.toc.slugify

@gilleschapron
Copy link
Author

As it with your trick it does not work.

But following your link I found this:
https://facelessuser.github.io/pymdown-extensions/faq/#function-references-in-yaml

And with:

markdown_extensions:
  - markdown.extensions.toc:
      slugify: !!python/object/apply:pymdownx.slugs.slugify {kwds: {case: lower}}

it seems it works for me!

Thanks !

Repository owner locked and limited conversation to collaborators Dec 4, 2023
@GooRoo GooRoo converted this issue into discussion #11 Dec 4, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants