METADATA 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. Metadata-Version: 2.1
  2. Name: mkdocs-material-extensions
  3. Version: 1.0
  4. Summary: Extension pack for Python Markdown.
  5. Home-page: https://github.com/facelessuser/mkdocs-material-extensions
  6. Author: Isaac Muse
  7. Author-email: Isaac.Muse@gmail.com
  8. License: MIT License
  9. Keywords: markdown extensions
  10. Platform: UNKNOWN
  11. Classifier: Development Status :: 5 - Production/Stable
  12. Classifier: Environment :: Console
  13. Classifier: Intended Audience :: Developers
  14. Classifier: License :: OSI Approved :: MIT License
  15. Classifier: Operating System :: OS Independent
  16. Classifier: Programming Language :: Python :: 3
  17. Classifier: Programming Language :: Python :: 3.5
  18. Classifier: Programming Language :: Python :: 3.6
  19. Classifier: Programming Language :: Python :: 3.7
  20. Classifier: Programming Language :: Python :: 3.8
  21. Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
  22. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  23. Classifier: Topic :: Text Processing :: Filters
  24. Classifier: Topic :: Text Processing :: Markup :: HTML
  25. Requires-Python: >=3.5
  26. Description-Content-Type: text/markdown
  27. Requires-Dist: mkdocs-material (>=5.0.0)
  28. [![Donate via PayPal][donate-image]][donate-link]
  29. [![Build][github-ci-image]][github-ci-link]
  30. [![Coverage Status][codecov-image]][codecov-link]
  31. [![PyPI Version][pypi-image]][pypi-link]
  32. [![PyPI - Python Version][python-image]][pypi-link]
  33. ![License][license-image-mit]
  34. # MkDocs Material Extensions
  35. Markdown extension resources for [MkDocs for Material][mkdocs-material]
  36. ## Install
  37. ```
  38. pip install mkdocs-material-extensions
  39. ```
  40. ## Inline SVG Icons
  41. MkDocs Material provides numerous icons from Material, FontAwesome, and Octicons, but it does so by inlining the SVG
  42. icons into the source. Currently there is no easy way access these icons and arbitrarily insert them into Markdown
  43. content. Users must include the icon fonts themselves and do it with HTML.
  44. This module allows you to use PyMdown Extensions' [Emoji][emoji] extension to enable easy insertion of MkDocs Material's
  45. SVG assets using simple `:emoji-syntax:`. This is done by creating our own [emoji index][emoji-index] and
  46. [emoji generator][emoji-generator]. The custom index provides a modified version of the Emoji extensions Twemoji
  47. index.
  48. In addition to the custom index, you must also specify the associated custom generator. This will will find the
  49. appropriate icon and insert it into your Markdown content as an inlined SVG.
  50. Example:
  51. ```yaml
  52. markdown_extensions:
  53. - pymdownx.emoji:
  54. emoji_index: !!python/name:materialx.emoji.twemoji
  55. emoji_generator: !!python/name:materialx.emoji.to_svg
  56. ```
  57. Then, using the folder structure of Material's `.icons` folder, you can specify icons:
  58. ```
  59. We can use Material Icons :material-airplane:.
  60. We can also use Fontawesome Icons :fontawesome-solid-ambulance:.
  61. That's not all, we can also use Octicons :octicons-octoface:.
  62. ```
  63. ## Using Local Custom Icons
  64. In MkDocs, you can override theme assets locally, and even add assets to the theme. Unfortunately, the Markdown parsing
  65. process isn't aware of the MkDocs environment. Luckily, if you are using PyMdown Extensions 7.1, you can pass in custom
  66. icon paths that will be used when constructing the emoji index and include your custom SVG assets. If a folder path of
  67. `theme/my_icons` was given to the index builder, all icons under `my_project/my_icons`, even in sub-folders, would
  68. become part of the index.
  69. ```yaml
  70. markdown_extensions:
  71. - pymdownx.emoji:
  72. emoji_index: !!python/name:materialx.emoji.twemoji
  73. emoji_generator: !!python/name:materialx.emoji.to_svg
  74. options:
  75. custom_icons:
  76. - theme/my_icons
  77. ```
  78. If given an icon at `my_project/my_icons/animals/bird.svg`, the icon would be available using the emoji syntax as
  79. `:animals-bird:`. Notice that the base folder that is provided doesn't contribute to the icon's name. Also, folders
  80. are separated with `-`. Folder names and icon names should be compatible with the emoji syntax, so special characters
  81. should be avoided -- `-` and `_` are okay.
  82. You can provide as many paths as you would like, and they will be evaluated in the order that they are specified. The
  83. Material theme's own icons will be evaluated after all custom paths. This allows a user to override Material's icons if
  84. desired.
  85. If an icon name is already in the index, the icon will not be added. It is recommended to always have your icons in
  86. sub-folders to help namespace them to avoid name collisions. In the example above, `bird` was under `animals` which
  87. created the name `:animals-bird:` and helped create a more unique name with less of a chance of creating a duplicate
  88. name with existing emoji and Material icons.
  89. [emoji]: https://facelessuser.github.io/pymdown-extensions/extensions/emoji/
  90. [emoji-index]: https://facelessuser.github.io/pymdown-extensions/extensions/emoji/#custom-emoji-indexes
  91. [emoji-generator]: https://facelessuser.github.io/pymdown-extensions/extensions/emoji/#custom-emoji-generators
  92. [mkdocs-material]: https://github.com/squidfunk/mkdocs-material
  93. [donate-image]: https://img.shields.io/badge/Donate-PayPal-3fabd1?logo=paypal
  94. [donate-link]: https://www.paypal.me/facelessuser
  95. [github-ci-image]: https://github.com/facelessuser/mkdocs-material-extensions/workflows/build/badge.svg
  96. [github-ci-link]: https://github.com/facelessuser/mkdocs-material-extensions/actions?workflow=build
  97. [discord-image]: https://img.shields.io/discord/678289859768745989?logo=discord&logoColor=aaaaaa&color=mediumpurple&labelColor=333333
  98. [discord-link]: https://discord.gg/fqQ7ypS
  99. [codecov-image]: https://img.shields.io/codecov/c/github/facelessuser/mkdocs-material-extensions/master.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333
  100. [codecov-link]: https://codecov.io/github/facelessuser/mkdocs-material-extensions
  101. [pypi-image]: https://img.shields.io/pypi/v/mkdocs-material-extensions.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333
  102. [pypi-link]: https://pypi.python.org/pypi/mkdocs-material-extensions
  103. [python-image]: https://img.shields.io/pypi/pyversions/mkdocs-material-extensions?logo=python&logoColor=aaaaaa&labelColor=333333
  104. [license-image-mit]: https://img.shields.io/badge/license-MIT-blue.svg?labelColor=333333