📝 Usage
let svg = iconify::svg!
iconify::svg! will download and embed an SVG as a string. It will also cache the request,
so it won't download the same SVG twice.
let svg = "<svg>...</svg>"
Templating
It can also be used directly in rsx, or any compile-time template engine.
Maud:
html!
Askama (Currently, a bug prevents you from using the full macro path. See Issue #836)
✨ Features
- Directly embed SVGs from Iconify
- Caches requests (default feature)
- Offline mode
- SVG transforms (through API)
- (Soon) CSS fetching
🔌 Offline Mode
If you don't want iconify-rs to make requests at compile-time in CI (or other reasons), you can use offline mode with prepared icons.
- Enable the
offlinefeature. - Prepare icons by setting
ICONIFY_PREPARE=trueand runningcargo check. This will generate a directory for you inCARGO_MANIFEST_DIRcallediconswith all the icons you invoked. - Now you're ready to go! Just run
cargo buildand it will use the icons you prepared.
If you want to set a custom directory, you can also set ICONIFY_OFFLINE_DIR.