Name | markdown-icons JSON |
Version |
3.0
JSON |
| download |
home_page | None |
Summary | Markdown extension to display icons |
upload_time | 2025-01-22 09:22:38 |
maintainer | None |
docs_url | None |
author | None |
requires_python | None |
license | Copyright 2024 Tom Hubrecht Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
markdown
icons
fontawesome
bootstrap
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# markdown-icons (`iconfonts.py`)
Easily display icon fonts in python markdown. Just add the CSS necessary for your font and add this extension.
This is a 3rd party extension for [Python Markdown](https://pythonhosted.org/Markdown/). You can see a [full list of 3rd party extensions here](https://github.com/Python-Markdown/markdown/wiki/Third-Party-Extensions).
Although this works with any icon font, users can use a `mod` syntax to add more prefixed classes to support [Font Awesome](https://fontawesome.com/) and its special classes such as `2x, 3x, muted, spin, etc`
Furthermore, users can add their own `user_mod` syntax to add additional, non-prefixed, pre-defined classes for greater control over their icons while allowing you to control exactly what styles are allowed.
See the [python markdown documentation](https://python-markdown.github.io/) for more information.
# Current Version: 3.0
# Syntax:
- Accepts a-z, A-Z, 0-9, \_(underscore), and - (hypen)
- Uses [HTML Entity](http://www.w3schools.com/html/html_entities.asp) like syntax: `&entity_name;`
```
&icon-html5;
&icon-css3;
&icon-my-icon;
```
Mod syntax:
```
&icon-html5:2x;
&icon-quote:3x,muted;
&icon-spinner:large,spin;
```
User mod syntax:
```
&icon-html5::red;
&icon-quote:2x:bold;
```
#### Example Markdown:
```
I love &icon-html5; and &icon-css3;
&icon-spinner:large,spin; Sorry we have to load...
```
##### Output:
```
I love <i aria-hidden="true" class="icon-html5"></i> and <i aria-hidden="true" class="icon-css3"></i>
<i aria-hidden="true" class="icon-spinner icon-large icon-spin"></i> Sorry we have to load...
```
# Usage / Setup:
#### Default Prefix is "icon-":
```python
md = markdown.Markdown(extensions=["iconfonts"])
converted_text = md.convert(text)
```
#### Use a custom Prefix:
```python
md = markdown.Markdown(
extensions=["iconfonts"],
extension_configs={"iconfonts": {"prefix": "mypref-"}},
)
converted_text = md.convert(text)
```
#### No prefix:
This isn't suggested, as it will take over the already built in HTML Entities
```python
md = markdown.Markdown(
extensions=["iconfonts"],
extension_configs={"iconfonts": {"prefix": ""}},
)
converted_text = md.convert(text)
```
#### The `base` option allows for use of Bootstrap and FontAwesome icons
```python
md = markdown.Markdown(extensions=['iconfonts'])
converted_text = md.convert(text)
```
**Input:** `&icon-html5;`
**Output:** `<i aria-hidden="true" class="icon icon-html5"></i>`
#### Combine options with a comma:
```python
md = markdown.Markdown(
extensions=["iconfonts"],
extension_configs={"iconfonts": {"prefix": "fa-", "base": "fa"}},
)
converted_text = md.convert(text)
```
**Input!** `&icon-spinner:spin:red,bold;`
**Output:** `<i aria-hidden="true" class="icon-spinner icon-spin red bold"></i>`
#### `prefix_base_pairs` option
The `prefix_base_pairs` option allows for multiple prefix-base pairs to be specified, to allow you to support both Bootstrap 3/Glyphicon and FontAwesome icons
```python
md = markdown.Markdown(extensions=['iconfonts'],
extension_configs={
'iconfonts': {
'prefix_base_pairs': {
'fa-': 'fa',
'glyphicon-': 'glyphicon',
}
}
})
converted_text = md.convert(text)
```
**Input:** `&glyphicon-remove; &fa-html5;`
**Output:** `<i aria-hidden="true" class="glyphicon glyphicon-remove"></i> <i aria-hidden="true" class="fa fa-html5"></i>`
Raw data
{
"_id": null,
"home_page": null,
"name": "markdown-icons",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "markdown, icons, fontawesome, bootstrap",
"author": null,
"author_email": "Tom Hubrecht <pypi@mail.hubrecht.ovh>, Eric Eastwood <contact@ericeastwood.com>",
"download_url": "https://files.pythonhosted.org/packages/75/26/3cfb9471fe8ae7171a835c2d0a6503ad8a3af7de32008e9393068cddb81f/markdown_icons-3.0.tar.gz",
"platform": null,
"description": "# markdown-icons (`iconfonts.py`)\n\nEasily display icon fonts in python markdown. Just add the CSS necessary for your font and add this extension.\n\nThis is a 3rd party extension for [Python Markdown](https://pythonhosted.org/Markdown/). You can see a [full list of 3rd party extensions here](https://github.com/Python-Markdown/markdown/wiki/Third-Party-Extensions).\n\nAlthough this works with any icon font, users can use a `mod` syntax to add more prefixed classes to support [Font Awesome](https://fontawesome.com/) and its special classes such as `2x, 3x, muted, spin, etc`\n\nFurthermore, users can add their own `user_mod` syntax to add additional, non-prefixed, pre-defined classes for greater control over their icons while allowing you to control exactly what styles are allowed.\n\nSee the [python markdown documentation](https://python-markdown.github.io/) for more information.\n\n# Current Version: 3.0\n\n# Syntax:\n\n- Accepts a-z, A-Z, 0-9, \\_(underscore), and - (hypen)\n- Uses [HTML Entity](http://www.w3schools.com/html/html_entities.asp) like syntax: `&entity_name;`\n\n```\n&icon-html5;\n&icon-css3;\n&icon-my-icon;\n```\n\nMod syntax:\n\n```\n&icon-html5:2x;\n&icon-quote:3x,muted;\n&icon-spinner:large,spin;\n```\n\nUser mod syntax:\n\n```\n&icon-html5::red;\n&icon-quote:2x:bold;\n```\n\n#### Example Markdown:\n\n```\nI love &icon-html5; and &icon-css3;\n&icon-spinner:large,spin; Sorry we have to load...\n```\n\n##### Output:\n\n```\nI love <i aria-hidden=\"true\" class=\"icon-html5\"></i> and <i aria-hidden=\"true\" class=\"icon-css3\"></i>\n<i aria-hidden=\"true\" class=\"icon-spinner icon-large icon-spin\"></i> Sorry we have to load...\n```\n\n# Usage / Setup:\n\n#### Default Prefix is \"icon-\":\n\n```python\nmd = markdown.Markdown(extensions=[\"iconfonts\"])\nconverted_text = md.convert(text)\n```\n\n#### Use a custom Prefix:\n\n```python\nmd = markdown.Markdown(\n extensions=[\"iconfonts\"],\n extension_configs={\"iconfonts\": {\"prefix\": \"mypref-\"}},\n)\nconverted_text = md.convert(text)\n```\n\n#### No prefix:\n\nThis isn't suggested, as it will take over the already built in HTML Entities\n\n```python\nmd = markdown.Markdown(\n extensions=[\"iconfonts\"],\n extension_configs={\"iconfonts\": {\"prefix\": \"\"}},\n)\nconverted_text = md.convert(text)\n```\n\n#### The `base` option allows for use of Bootstrap and FontAwesome icons\n\n```python\nmd = markdown.Markdown(extensions=['iconfonts'])\nconverted_text = md.convert(text)\n```\n\n**Input:** `&icon-html5;`\n\n**Output:** `<i aria-hidden=\"true\" class=\"icon icon-html5\"></i>`\n\n#### Combine options with a comma:\n\n```python\nmd = markdown.Markdown(\n extensions=[\"iconfonts\"],\n extension_configs={\"iconfonts\": {\"prefix\": \"fa-\", \"base\": \"fa\"}},\n)\nconverted_text = md.convert(text)\n```\n\n**Input!** `&icon-spinner:spin:red,bold;`\n\n**Output:** `<i aria-hidden=\"true\" class=\"icon-spinner icon-spin red bold\"></i>`\n\n#### `prefix_base_pairs` option\n\nThe `prefix_base_pairs` option allows for multiple prefix-base pairs to be specified, to allow you to support both Bootstrap 3/Glyphicon and FontAwesome icons\n\n```python\nmd = markdown.Markdown(extensions=['iconfonts'],\n extension_configs={\n 'iconfonts': {\n 'prefix_base_pairs': {\n 'fa-': 'fa',\n 'glyphicon-': 'glyphicon',\n }\n }\n })\nconverted_text = md.convert(text)\n```\n\n**Input:** `&glyphicon-remove; &fa-html5;`\n\n**Output:** `<i aria-hidden=\"true\" class=\"glyphicon glyphicon-remove\"></i> <i aria-hidden=\"true\" class=\"fa fa-html5\"></i>`\n",
"bugtrack_url": null,
"license": "Copyright 2024 Tom Hubrecht Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Markdown extension to display icons",
"version": "3.0",
"project_urls": {
"Homepage": "https://github.com/Tom-Hubrecht/markdown-icons",
"Issues": "https://github.com/Tom-Hubrecht/markdown-icons/issues",
"Repository": "https://github.com/Tom-Hubrecht/markdown-icons"
},
"split_keywords": [
"markdown",
" icons",
" fontawesome",
" bootstrap"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2e38cf2d06a12132974151e0353eb76ec150938a3dee7383c68f5a8d1fead1eb",
"md5": "5b601b644c554d9603ee1a88003a9150",
"sha256": "921f1b90e3ebe046fb2142bc59bf8c3b97e816bd3e04283c3f242948c02007ef"
},
"downloads": -1,
"filename": "markdown_icons-3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5b601b644c554d9603ee1a88003a9150",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5847,
"upload_time": "2025-01-22T09:22:37",
"upload_time_iso_8601": "2025-01-22T09:22:37.238235Z",
"url": "https://files.pythonhosted.org/packages/2e/38/cf2d06a12132974151e0353eb76ec150938a3dee7383c68f5a8d1fead1eb/markdown_icons-3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "75263cfb9471fe8ae7171a835c2d0a6503ad8a3af7de32008e9393068cddb81f",
"md5": "28a497420841af4bf714a2068bd576bc",
"sha256": "4371ac5d761a0f733094505b59691cb7368365e331d45d3ac886703aa77cfae3"
},
"downloads": -1,
"filename": "markdown_icons-3.0.tar.gz",
"has_sig": false,
"md5_digest": "28a497420841af4bf714a2068bd576bc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5398,
"upload_time": "2025-01-22T09:22:38",
"upload_time_iso_8601": "2025-01-22T09:22:38.378018Z",
"url": "https://files.pythonhosted.org/packages/75/26/3cfb9471fe8ae7171a835c2d0a6503ad8a3af7de32008e9393068cddb81f/markdown_icons-3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-22 09:22:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Tom-Hubrecht",
"github_project": "markdown-icons",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "markdown-icons"
}