Name | mkdocs-inline-select-svg-plugin JSON |
Version |
0.1.0
JSON |
| download |
home_page | |
Summary | A MkDocs plugin that inlines SVG images matching a pattern into the output without inlining Materials theme icons. |
upload_time | 2023-11-08 21:23:05 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.8 |
license | |
keywords |
mkdocs
mkdocs-plugin
plugin
svg
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# mkdocs-plugin-inline-select-svg
A [MkDocs plugin] that inlines SVG images matching a pattern into the output without inlining Materials theme icons.
This operates post HTML generation looking for `img` elements like
```html
<img src="foo.svg" ...>
```
When the *src* is a path-local URL with a path component that ends
with `.svg` and it matches the configured pattern then the file is
read from the local file system and inlined in place.
Alt text is ignored in favour of any SVG `<title>` element.
If the SVG contains any elements marked with `class="do-not-inline"`,
they will not be included in the inlined content.
This is useful when your SVG images contain `<style>` elements that
you do not want to bleed into the containing scope, and your Mkdocs
configuration includes extra CSS stylesheets that suffice.
## Usage
To download and install this module, run:
```sh
pip install mkdocs-inline-select-svg-plugin
```
Enable the plugin in your *mkdocs.yml* by adding `inline-select-svg` as a list item under the *plugins* section. Since that section will almost certainly include *search* you might end up with something like this:
```yaml
plugins:
- search
- inline-select-svg
```
If you want to filter which SVGs to inline, by path, you can specify a regular expression using the *pattern* config option thus:
```yaml
plugins:
- search
- inline-select-svg:
pattern: "[.]inline[.]svg$"
```
With that configuration, `<img src="../foo.inline.svg">` would be
inlined but `<img src="../foo.svg">` would not.
[MkDocs plugin]: https://www.mkdocs.org/dev-guide/plugins/
Raw data
{
"_id": null,
"home_page": "",
"name": "mkdocs-inline-select-svg-plugin",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "mkdocs,mkdocs-plugin,plugin,svg",
"author": "",
"author_email": "Mike Samuel <mikesamuel@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/d9/d4/ba1f0fba644e541701fa40e24124a983126e6b205afb7b2ab6e53f246f83/mkdocs_inline_select_svg_plugin-0.1.0.tar.gz",
"platform": null,
"description": "# mkdocs-plugin-inline-select-svg\n\nA [MkDocs plugin] that inlines SVG images matching a pattern into the output without inlining Materials theme icons.\n\nThis operates post HTML generation looking for `img` elements like\n\n```html\n<img src=\"foo.svg\" ...>\n```\n\nWhen the *src* is a path-local URL with a path component that ends\nwith `.svg` and it matches the configured pattern then the file is\nread from the local file system and inlined in place.\n\nAlt text is ignored in favour of any SVG `<title>` element.\n\nIf the SVG contains any elements marked with `class=\"do-not-inline\"`,\nthey will not be included in the inlined content.\nThis is useful when your SVG images contain `<style>` elements that\nyou do not want to bleed into the containing scope, and your Mkdocs\nconfiguration includes extra CSS stylesheets that suffice.\n\n## Usage\n\nTo download and install this module, run:\n\n```sh\npip install mkdocs-inline-select-svg-plugin\n```\n\nEnable the plugin in your *mkdocs.yml* by adding `inline-select-svg` as a list item under the *plugins* section. Since that section will almost certainly include *search* you might end up with something like this:\n\n```yaml\nplugins:\n - search\n - inline-select-svg\n```\n\nIf you want to filter which SVGs to inline, by path, you can specify a regular expression using the *pattern* config option thus:\n\n```yaml\nplugins:\n - search\n - inline-select-svg:\n pattern: \"[.]inline[.]svg$\"\n```\n\nWith that configuration, `<img src=\"../foo.inline.svg\">` would be\ninlined but `<img src=\"../foo.svg\">` would not.\n\n[MkDocs plugin]: https://www.mkdocs.org/dev-guide/plugins/\n",
"bugtrack_url": null,
"license": "",
"summary": "A MkDocs plugin that inlines SVG images matching a pattern into the output without inlining Materials theme icons.",
"version": "0.1.0",
"project_urls": {
"Bug Tracker": "https://github.com/temperlang/svg-inline-mkdocs-plugin/issues",
"Homepage": "https://github.com/temperlang/svg-inline-mkdocs-plugin",
"Source": "https://github.com/temperlang/svg-inline-mkdocs-plugin"
},
"split_keywords": [
"mkdocs",
"mkdocs-plugin",
"plugin",
"svg"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "83cca3cb392357c65563a5208b3b430a6569bd400aff7a1683451ab96eed3249",
"md5": "e05ebfba07cc06e7ea2d09fd9d8b00a8",
"sha256": "e35e242a0d51c844576b75258e15a29f05b8aaeaf871b209368df2e880fcaf5b"
},
"downloads": -1,
"filename": "mkdocs_inline_select_svg_plugin-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e05ebfba07cc06e7ea2d09fd9d8b00a8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 8303,
"upload_time": "2023-11-08T21:23:04",
"upload_time_iso_8601": "2023-11-08T21:23:04.106317Z",
"url": "https://files.pythonhosted.org/packages/83/cc/a3cb392357c65563a5208b3b430a6569bd400aff7a1683451ab96eed3249/mkdocs_inline_select_svg_plugin-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d9d4ba1f0fba644e541701fa40e24124a983126e6b205afb7b2ab6e53f246f83",
"md5": "5e44885166e0c67eb66f9896a8cd97bf",
"sha256": "b2cfa3c79f6809fd86c778adfb7b8da9c6c101c98acf50b3de7169fcbc8d3daf"
},
"downloads": -1,
"filename": "mkdocs_inline_select_svg_plugin-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "5e44885166e0c67eb66f9896a8cd97bf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 8473,
"upload_time": "2023-11-08T21:23:05",
"upload_time_iso_8601": "2023-11-08T21:23:05.585177Z",
"url": "https://files.pythonhosted.org/packages/d9/d4/ba1f0fba644e541701fa40e24124a983126e6b205afb7b2ab6e53f246f83/mkdocs_inline_select_svg_plugin-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-08 21:23:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "temperlang",
"github_project": "svg-inline-mkdocs-plugin",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "mkdocs-inline-select-svg-plugin"
}