Skip to content

Commit

Permalink
Better warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
facelessuser committed Nov 22, 2023
1 parent 1a1139d commit c82c205
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.3.1

- **FIX**: Better deprecation warning.

## 1.3

- **NEW**: The final release. `mkdocs-material` (version 9.4) now has this library's logic built-in making this library
Expand Down
2 changes: 1 addition & 1 deletion materialx/__meta__.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,5 @@ def parse_version(ver):
return Version(major, minor, micro, release, pre, post, dev)


__version_info__ = Version(1, 3, 0, "final")
__version_info__ = Version(1, 3, 1, "final")
__version__ = __version_info__._get_canonical()
22 changes: 19 additions & 3 deletions materialx/emoji.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@
DEPRECATED = """\
Material emoji logic has been officially moved into mkdocs-material
version 9.4. Please use Material's '{}'
as mkdocs_material_extensions is deprecated and will no longer be
instead of '{}' in your 'mkdocs.yml' file.
```
markdown_extensions:
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
```
'mkdocs_material_extensions' is deprecated and will no longer be
supported moving forward. This is the last release.
"""

Expand Down Expand Up @@ -68,7 +77,10 @@ def _deprecated_func(*args, **kwargs):
return _wrapper


@deprecated(DEPRECATED.format('material.extensions.emoji.twemoji'), name='materialx.emoji.twemoji')
@deprecated(
DEPRECATED.format('material.extensions.emoji.twemoji', 'materialx.emoji.twemoji'),
name='materialx.emoji.twemoji'
)
def _patch_index(options):
"""Patch the given index."""

Expand Down Expand Up @@ -112,7 +124,11 @@ def twemoji():
return _patch_index({})


@deprecated(DEPRECATED.format('material.extensions.emoji.to_svg'), 1, name='materialx.emoji.to_svg')
@deprecated(
DEPRECATED.format('material.extensions.emoji.to_svg', 'materialx.emoji.to_svg'),
1,
name='materialx.emoji.to_svg'
)
def to_svg(index, shortname, alias, uc, alt, title, category, options, md):
"""Return SVG element."""

Expand Down

0 comments on commit c82c205

Please sign in to comment.