Automagically generate web friendly svg for specified directory. Can also strip filename to create shorter symbol id.
Could save a few more bytes by minifying. The advantage here is that the combined svg file can be retrieved one time in your html and used multiple times in the same page. Additionally, once retrieved, the browser should cache it and reduce the number of calls in the future.
Using the example usage below, you could then reference ww_11 in html code like so:
Automagically generate web friendly svg for specified directory. Can also strip filename to create shorter symbol id.
Could save a few more bytes by minifying. The advantage here is that the combined svg file can be retrieved one time in your html and used multiple times in the same page. Additionally, once retrieved, the browser should cache it and reduce the number of calls in the future.
Using the example usage below, you could then reference ww_11 in html code like so:
<svg xmlns="http://www.w3.org/2000/svg"><use xlink:href="/path/to/file/ww_PresentWeather.svg#ww_11"></use></svg>
Args: symbols directory, basename replacement
Example usage:
$ python gen_web_symbols.py ww_PresentWeather WeatherSymbol_WMOPresentWeather > ww_PresentWeather.svg