diff --git a/scour.inkscape.py b/scour.inkscape.py index f21e223..ad3bfcd 100755 --- a/scour.inkscape.py +++ b/scour.inkscape.py @@ -22,12 +22,18 @@ class ScourInkscape (inkex.Effect): self.OptionParser.add_option("--enable-id-stripping", type="inkbool", action="store", dest="strip_ids", default=False, help="remove all un-referenced ID attributes") + self.OptionParser.add_option("--shorten-ids", type="inkbool", + action="store", dest="shorten_ids", default=False, + help="shorten all ID attributes to the least number of letters possible") self.OptionParser.add_option("--embed-rasters", type="inkbool", action="store", dest="embed_rasters", default=True, help="won't embed rasters as base64-encoded data") self.OptionParser.add_option("--keep-editor-data", type="inkbool", action="store", dest="keep_editor_data", default=False, help="won't remove Inkscape, Sodipodi or Adobe Illustrator elements and attributes") + self.OptionParser.add_option("--remove-metadata", type="inkbool", + action="store", dest="remove_metadata", default=False, + help="remove elements (which may contain license metadata etc.)") self.OptionParser.add_option("--strip-xml-prolog", type="inkbool", action="store", dest="strip_xml_prolog", default=False, help="won't output the prolog") @@ -40,7 +46,12 @@ class ScourInkscape (inkex.Effect): self.OptionParser.add_option("--enable-viewboxing", type="inkbool", action="store", dest="enable_viewboxing", default=False, help="changes document width/height to 100%/100% and creates viewbox coordinates") - + self.OptionParser.add_option("--enable-comment-stripping", type="inkbool", + action="store", dest="strip_comments", default=False, + help="remove all comments") + self.OptionParser.add_option("--renderer-workaround", type="inkbool", + action="store", dest="renderer_workaround", default=False, + help="work around various renderer bugs (currently only librsvg)") def effect(self): input = file(sys.argv[12], "r") diff --git a/scour.inx b/scour.inx index 63050e8..4254882 100644 --- a/scour.inx +++ b/scour.inx @@ -7,16 +7,20 @@ yocto_css.py - true - true + true + true true - false + false + false true false + false + false + false false - false - 5 - + false + 5 + <_item value="space">Space <_item value="tab">Tab <_item value="none">None @@ -24,16 +28,19 @@ <_param name="instructions" type="description" xml:space="preserve">This extension optimizes the SVG file according to the following options: - * Simplify colors: convert all colors to #RRGGBB format. - * Style to xml: convert styles into XML attributes. - * Group collapsing: collapse group elements. - * Enable id stripping: remove all un-referenced ID attributes. - * Embed rasters: embed rasters as base64-encoded data. + * Shorten color names: convert all colors to #RRGGBB or #RGB format. + * Convert CSS attributes to XML attributes: convert styles from