
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
An MkDocs plugin to convert SVG files to PNG images.
This plugin finds SVG code blocks and image references and converts them to PNG images during the MkDocs build process. This is useful for formats that don't support SVG directly, like PDF, or for ensuring consistent image rendering across different environments.
This plugin requires CairoSVG
and its dependencies. Please ensure you have them installed:
pip install cairosvg
CairoSVG itself has some system-level dependencies (like cairo
, pango
, gdk-pixbuf
). On Debian/Ubuntu, you can install them using:
sudo apt-get update
sudo apt-get install libcairo2-dev libffi-dev libgdk-pixbuf2.0-dev libpango1.0-dev
For other operating systems, please refer to the CairoSVG documentation.
Install the plugin using pip:
pip install mkdocs-svg-to-png
Activate the plugin in mkdocs.yml
:
plugins:
- search
- svg-to-png
Note: If you have no
plugins
entry in your config file yet, you'll likely also want to add thesearch
plugin. MkDocs enables it by default if there is noplugins
entry set, but now you have to enable it explicitly.
You can customize the plugin's behavior in mkdocs.yml
:
plugins:
- svg-to-png:
output_dir: "assets/images"
image_format: "png"
dpi: 300
quality: 95
background_color: "transparent"
cache_enabled: true
cache_dir: ".svg_cache"
preserve_original: false
error_on_fail: false
log_level: "INFO"
cleanup_generated_images: false
enabled_if_env: null
temp_dir: null
output_dir
:
assets/images
.docs
directory.image_format
:
png
.png
is supported.dpi
:
300
.quality
:
95
.background_color
:
transparent
.white
), a hex code (e.g., #FFFFFF
), or transparent
.cache_enabled
:
true
.true
, generated images will be cached to avoid re-rendering on subsequent builds if the SVG content hasn't changed.cache_dir
:
.svg_cache
.preserve_original
:
false
.true
, the original SVG code block or image reference will be preserved in the Markdown output, in addition to the generated PNG image.error_on_fail
:
false
.true
, the MkDocs build will fail if any SVG to PNG conversion encounters an error. If false
, errors will be logged, and the original SVG content will be kept.log_level
:
INFO
.DEBUG
, INFO
, WARNING
, or ERROR
.cleanup_generated_images
:
false
.true
, generated PNG images will be removed from the output_dir
after the MkDocs build is complete. This is useful for CI/CD pipelines.enabled_if_env
:
null
.temp_dir
:
null
.null
, the system's default temporary directory will be used.FAQs
MkDocs plugin to convert SVG files to PNG images during build
We found that mkdocs-svg-to-png demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.