svg-sprite / svg-sprite

SVG sprites & stacks galore — A low-level Node.js module that takes a bunch of SVG files, optimizes them and bakes them into SVG sprites of several types along with suitable stylesheet resources (e.g. CSS, Sass, LESS, Stylus, etc.)

Home Page:https://github.com/svg-sprite/svg-sprite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to create a .html template file include icon sample preview and icons name in the .HTML file beside to the final sprite file?

paladio opened this issue · comments

First of all, thank you for developing and creating this useful and practical library
I use this library with the following command and I want to create a .HTML file next to the final sprite .svg file, including svg preview and names of the generated icons so that the icons and their names are displayed in it and if necessary, the name of the icon can be Got through it.

"svg:sprite": "svg-sprite -s --symbol-dest \"src/icons\" --symbol-sprite icons-pack.svg \"src/icons/svg/*.svg\" "

How can this setting be added to the above command to create a sample preview .HTML file in the final path?
Thank you all

Please check out https://github.com/svg-sprite/svg-sprite/blob/main/docs/command-line.md

--stack-example should do what you want

Please check out https://github.com/svg-sprite/svg-sprite/blob/main/docs/command-line.md

--stack-example should do what you want

I read this page completely before but none of the flags created the desired file, is there anyone who has tested this and created the preview sample file?

I just tested v2.0.0-beta3 in symbol mode and I get an example html file:

svg-sprite --config svg-sprite.json --log=info icons/*.svg --symbol-example