Metadata-Version: 2.1
Name: mkdocs-inline-select-svg-plugin
Version: 0.1.0
Summary: A MkDocs plugin that inlines SVG images matching a pattern into the output without inlining Materials theme icons.
Project-URL: Source, https://github.com/temperlang/svg-inline-mkdocs-plugin
Project-URL: Homepage, https://github.com/temperlang/svg-inline-mkdocs-plugin
Project-URL: Bug Tracker, https://github.com/temperlang/svg-inline-mkdocs-plugin/issues
Author-email: Mike Samuel <mikesamuel@gmail.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: mkdocs,mkdocs-plugin,plugin,svg
Classifier: Framework :: MkDocs
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Requires-Dist: beautifulsoup4>=4.12.0
Requires-Dist: lxml>=4.9.3
Requires-Dist: mkdocs>=1.4.0
Description-Content-Type: text/markdown

# 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/
