Skip to content
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

Custom emoji generator causes unnecessary deprecation warning #7276

Closed
4 tasks done
evan-flynn-apexai opened this issue Jun 19, 2024 · 3 comments
Closed
4 tasks done
Labels
change request Issue requests a new feature or improvement resolved by customization Issue can be solved through customization

Comments

@evan-flynn-apexai
Copy link

Context

No response

Description

  1. We had a custom emoji generator py file in use while using mkdocs-material < 9.4
  2. After bumping to >9.4, we get a deprecation warning saying we need to use `material.

Material emoji logic has been officially moved into mkdocs-material
version 9.4. Please use Material's 'material.extensions.emoji.to_svg'
instead of 'materialx.emoji.to_svg' in your 'mkdocs.yml' file.

Can we still use a custom emoji generator after 9.4 or is this not supported anymore?

The custom emoji generator is only used as a work around to avoid replacing API references with emojis (e.g. foo::hammer::bar is replaced today with foo: + 🔨 + :bar). If this bug could be fixed in mkdocs-material generator then we would just use that.

Related links

#4805

Use Cases

  1. Use custom emoji generator

or

  1. Improve mkdocs-material emoji generator to handle API references without replacing them with emojis

Visuals

No response

Before submitting

@squidfunk
Copy link
Owner

squidfunk commented Jun 19, 2024

Thanks for suggesting. Sounds sensible, as our plan was not to make it harder to use custom emoji generators. Could you provide a minimal reproduction, so we have something to work with? It's likely an easy fix then ☺️

@squidfunk squidfunk added the change request Issue requests a new feature or improvement label Jun 19, 2024
@kamilkrzyskow
Copy link
Collaborator

The deprecation warning comes from using the to_svg and twemoji functions from the deprecated materialx module.
https://github.com/facelessuser/mkdocs-material-extensions/blob/master/materialx/emoji.py

I don't remember any issues when migrating over to the new module, so just stop using the deprecated module in your custom emoji generator.

@evan-flynn-apexai
Copy link
Author

@squidfunk @kamilkrzyskow ahhh you are right 🤦 I updated the config file, but forgot to update the custom generator python import statement. Our custom generator was still importing the legacy from materialx.emoji import to_svg instead of the "new" from material.extensions.emoji import to_svg.

Sorry for the noise 😞

@squidfunk squidfunk added the resolved by customization Issue can be solved through customization label Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change request Issue requests a new feature or improvement resolved by customization Issue can be solved through customization
3 participants