:tocdepth: 3 :py:mod:`gws.lib.style.icon` ============================ .. py:module:: gws.lib.style.icon **Source code:** :source:`gws.lib.style.icon` Module Contents --------------- .. py:exception:: Error Bases: :py:obj:`gws.Error` GWS error. .. py:function:: parse(val: str, opts) -> Optional[ParsedIcon] Parses an url or directory path to a svg. :param val: An url or directory path containing a svg. :param opts: Url or directory path options. :returns: The svg, if the url is trusted, or if the path is in a trusted directory. .. py:class:: ParsedIcon(*args, **kwargs) Bases: :py:obj:`gws.Data` Svg data. .. py:attribute:: svg :type: gws.XmlElement Structure and attributes of the svg. .. py:function:: to_data_url(icon: ParsedIcon) -> str Converts a svg to url. :param icon: Svg object to convert. :returns: The url, or an empty string if ``icon`` is not a svg.