summaryrefslogtreecommitdiffstats
path: root/share/extensions/scour.inx
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2016-01-12 21:23:21 +0000
committerEduard Braun <eduard.braun2@gmx.de>2016-01-12 21:23:21 +0000
commit261e6676dc18a400e7a60dd5152fde3c76a9ab47 (patch)
tree5aa00d64dc5e1fff1c41ff501b65884f7c2ae0d8 /share/extensions/scour.inx
parentUpdate CMake for poppler >= 0.20.0 dependency (diff)
downloadinkscape-261e6676dc18a400e7a60dd5152fde3c76a9ab47.tar.gz
inkscape-261e6676dc18a400e7a60dd5152fde3c76a9ab47.zip
Update Scour extension
* Update the Scour extension (scour.inkscape.py) to work with recent versions of the scour module (0.30 and later) (https://github.com/codedread/scour/) * Strip the Scour module from Inkscape source code and use an external copy of instead (i.e. make it a requirement). This avoids any potential license issues with the Scour module's Apache license 2.0 * Update Scour extension dialog (scour.inx) - add new settings added in Scour versions 0.29-0.31 - attempt to arrange/group settings intuitively - convert "help" tabs to individual tooltips for each setting This also fixes bug #748639 since the overall height of the dialog is reduced by splitting settings across three tabs and removing the "Help" tabs (they caused the increased dialog height since they contained a huge amount of text) Fixed bugs: - https://launchpad.net/bugs/1411149 - https://launchpad.net/bugs/748639 (bzr r14574.1.1)
Diffstat (limited to 'share/extensions/scour.inx')
-rw-r--r--share/extensions/scour.inx133
1 files changed, 85 insertions, 48 deletions
diff --git a/share/extensions/scour.inx b/share/extensions/scour.inx
index c97eec502..f7b8aedf7 100644
--- a/share/extensions/scour.inx
+++ b/share/extensions/scour.inx
@@ -2,60 +2,97 @@
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>Optimized SVG Output</_name>
<id>org.inkscape.output.scour</id>
- <dependency type="executable" location="extensions">scour/scour.py</dependency>
- <dependency type="executable" location="extensions">scour/svg_regex.py</dependency>
- <dependency type="executable" location="extensions">scour/yocto_css.py</dependency>
+ <dependency type="executable" location="extensions">scour.inkscape.py</dependency>
<param name="tab" type="notebook">
- <page name="Options" _gui-text="Options">
- <param name="simplify-colors" type="boolean" _gui-text="Shorten color values">true</param>
- <param name="style-to-xml" type="boolean" _gui-text="Convert CSS attributes to XML attributes">true</param>
- <param name="group-collapsing" type="boolean" _gui-text="Group collapsing">true</param>
- <param name="create-groups" type="boolean" _gui-text="Create groups for similar attributes">true</param>
- <param name="embed-rasters" type="boolean" _gui-text="Embed rasters">true</param>
- <param name="keep-editor-data" type="boolean" _gui-text="Keep editor data">false</param>
- <param name="remove-metadata" type="boolean" _gui-text="Remove metadata">false</param>
- <param name="enable-comment-stripping" type="boolean" _gui-text="Remove comments">false</param>
- <param name="renderer-workaround" type="boolean" _gui-text="Work around renderer bugs">true</param>
- <param name="enable-viewboxing" type="boolean" _gui-text="Enable viewboxing">false</param>
- <param name="strip-xml-prolog" type="boolean" _gui-text="Remove the xml declaration">false</param>
- <param name="set-precision" type="int" _gui-text="Number of significant digits for coords:">5</param>
- <param name="indent" type="enum" _gui-text="XML indentation (pretty-printing):">
+ <page name="Options" _gui-text="Options">
+ <param _gui-text="Number of significant digits for coordinates:"
+ _gui-description="Specifies the number of significant digits that should be output for coordinates. Note that significant digits are *not* the number of decimals but the overall number of digits in the output. For example if a value of &quot;3&quot; is specified, the coordinate 3.14159 is output as 3.14 while the coordinate 123.675 is output as 124."
+ name="set-precision" type="int">5</param>
+ <param name="spacer" type="description">&#160;</param>
+ <param _gui-text="Shorten color values"
+ _gui-description="Convert all color specifications to #RRGGBB (or #RGB where applicable) format."
+ name="simplify-colors" type="boolean">true</param>
+ <param _gui-text="Convert CSS attributes to XML attributes"
+ _gui-description="Convert styles from style tags and inline style=&quot;&quot; declarations into XML attributes."
+ name="style-to-xml" type="boolean">true</param>
+ <param name="spacer" type="description">&#160;</param>
+ <param _gui-text="Collapse groups"
+ _gui-description="Remove useless groups, promoting their contents up one level. Requires &quot;Remove unused IDs&quot; to be set."
+ name="group-collapsing" type="boolean">true</param>
+ <param _gui-text="Create groups for similar attributes"
+ _gui-description="Create groups for runs of elements having at least one attribute in common (e.g. fill-color, stroke-opacity, ...)."
+ name="create-groups" type="boolean">true</param>
+ <param name="spacer" type="description">&#160;</param>
+ <param _gui-text="Keep editor data"
+ _gui-description="Don't remove editor-specific elements and attributes. Currently supported: Inkscape, Sodipodi and Adobe Illustrator."
+ name="keep-editor-data" type="boolean">false</param>
+ <param _gui-text="Keep unreferenced definitions"
+ _gui-description="Keep element definitions that are not currently used in the SVG"
+ name="keep-unreferenced-defs" type="boolean">false</param>
+ <param name="spacer" type="description">&#160;</param>
+ <param _gui-text="Work around renderer bugs"
+ _gui-description="Works around some common renderer bugs (mainly libRSVG) at the cost of a slightly larger SVG file."
+ name="renderer-workaround" type="boolean">true</param>
+ </page>
+ <page name="Output" _gui-text="SVG Output">
+ <_param name="SVG_doc" type="description" appearance="header">Document options</_param>
+ <param _gui-text="Remove the XML declaration"
+ _gui-description="Removes the XML declaration (which is optional but should be provided, especially if special characters are used in the document) from the file header."
+ name="strip-xml-prolog" type="boolean">false</param>
+ <param _gui-text="Remove metadata"
+ _gui-description="Remove metadata tags along with all the contained information, which may include license and author information, alternate versions for non-SVG-enabled browsers, etc."
+ name="remove-metadata" type="boolean">false</param>
+ <param _gui-text="Remove comments"
+ _gui-description="Remove all XML comments from output."
+ name="enable-comment-stripping" type="boolean">false</param>
+ <param _gui-text="Embed raster images"
+ _gui-description="Resolve external references to raster images and embed them as Base64-encoded data URLs."
+ name="embed-rasters" type="boolean">true</param>
+ <param _gui-text="Enable viewboxing"
+ _gui-description="Set page size to 100%/100% (full width and height of the display area) and introduce a viewBox specifying the drawings dimensions."
+ name="enable-viewboxing" type="boolean">false</param>
+ <param name="spacer" type="description">&#160;</param>
+ <_param name="pretty_print" type="description" appearance="header">Pretty-printing</_param>
+ <param _gui-text="Format output with line-breaks and indentation"
+ _gui-description="Produce nicely formatted output including line-breaks. If you do not intend to hand-edit the SVG file you can disable this option to bring down the file size even more at the cost of clarity."
+ name="line-breaks" type="boolean">true</param>
+ <param _gui-text="Indentation characters:"
+ _gui-description="The type of indentation used for each level of nesting in the output. Specify &quot;None&quot; to disable indentation. This option has no effect if &quot;Format output with line-breaks and indentation&quot; is disabled."
+ name="indent" type="enum">
<_item value="space">Space</_item>
<_item value="tab">Tab</_item>
<_item msgctxt="Indent" value="none">None</_item>
</param>
+ <param _gui-text="Depth of indentation:"
+ _gui-description="The depth of the chosen type of indentation. E.g. if you choose &quot;2&quot; every nesting level in the output will be indented by two additional spaces/tabs."
+ name="nindent" type="int">1</param>
+ <param _gui-text="Strip the &quot;xml:space&quot; attribute from the root SVG element"
+ _gui-description="This is useful if the input file specifies &quot;xml:space='preserve'&quot; in the root SVG element which instructs the SVG editor not to change whitespace in the document at all (and therefore overrides the options above)."
+ name="strip-xml-space" type="boolean">false</param>
</page>
- <page name="Ids" _gui-text="Ids">
- <param name="enable-id-stripping" type="boolean" _gui-text="Remove unused ID names for elements">false</param>
- <param name="shorten-ids" type="boolean" _gui-text="Shorten IDs">false</param>
- <param name="protect-ids-noninkscape" type="boolean" _gui-text="Preserve manually created ID names not ending with digits">false</param>
- <param name="protect-ids-list" type="string" _gui-text="Preserve these ID names, comma-separated:"></param>
- <param name="protect-ids-prefix" type="string" _gui-text="Preserve ID names starting with:"></param>
- </page>
- <page name="OptionHelp" _gui-text="Help (Options)">
- <_param name="OptionsInstructions" type="description" xml:space="preserve">This extension optimizes the SVG file according to the following options:
- * Shorten color names: convert all colors to #RRGGBB or #RGB format.
- * Convert CSS attributes to XML attributes: convert styles from style tags and inline style="" declarations into XML attributes.
- * Group collapsing: removes useless g elements, promoting their contents up one level. Requires "Remove unused ID names for elements" to be set.
- * Create groups for similar attributes: create g elements for runs of elements having at least one attribute in common (e.g. fill color, stroke opacity, ...).
- * Embed rasters: embed raster images as base64-encoded data URLs.
- * Keep editor data: don't remove Inkscape, Sodipodi or Adobe Illustrator elements and attributes.
- * Remove metadata: remove metadata tags along with all the information in them, which may include license metadata, alternate versions for non-SVG-enabled browsers, etc.
- * Remove comments: remove comment tags.
- * Work around renderer bugs: emits slightly larger SVG data, but works around a bug in librsvg's renderer, which is used in Eye of GNOME and other various applications.
- * Enable viewboxing: size image to 100%/100% and introduce a viewBox.
- * Number of significant digits for coords: all coordinates are output with that number of significant digits. For example, if 3 is specified, the coordinate 3.5153 is output as 3.51 and the coordinate 471.55 is output as 472.
- * XML indentation (pretty-printing): either None for no indentation, Space to use one space per nesting level, or Tab to use one tab per nesting level.</_param>
- </page>
- <page name="IdHelp" _gui-text="Help (Ids)">
- <_param name="IDInstructions" type="description" xml:space="preserve">Ids specific options:
- * Remove unused ID names for elements: remove all unreferenced ID attributes.
- * Shorten IDs: reduce the length of all ID attributes, assigning the shortest to the most-referenced elements. For instance, #linearGradient5621, referenced 100 times, can become #a.
- * Preserve manually created ID names not ending with digits: usually, optimised SVG output removes these, but if they're needed for referencing (e.g. #middledot), you may use this option.
- * Preserve these ID names, comma-separated: you can use this in conjunction with the other preserve options if you wish to preserve some more specific ID names.
- * Preserve ID names starting with: usually, optimised SVG output removes all unused ID names, but if all of your preserved ID names start with the same prefix (e.g. #flag-mx, #flag-pt), you may use this option.</_param>
+ <page name="IDs" _gui-text="IDs">
+ <param _gui-text="Remove unused IDs"
+ _gui-description="Remove all unreferenced IDs from elements. Those are not needed for rendering."
+ name="enable-id-stripping" type="boolean">true</param>
+ <param name="spacer" type="description">&#160;</param>
+ <param _gui-text="Shorten IDs"
+ _gui-description="Minimize the length of IDs using only lowercase letters, assigning the shortest values to the most-referenced elements. For instance, &quot;linearGradient5621&quot; will become &quot;a&quot; if it is the most used element."
+ name="shorten-ids" type="boolean">false</param>
+ <param _gui-text="Prefix shortened IDs with:"
+ _gui-description="Prepend shortened IDs with the specified prefix."
+ name="shorten-ids-prefix" type="string"></param>
+ <param name="spacer" type="description">&#160;</param>
+ <param _gui-text="Preserve manually created IDs not ending with digits"
+ _gui-description="Descriptive IDs which were manually created to reference or label specific elements or groups (e.g. #arrowStart, #arrowEnd or #textLabels) will be preserved while numbered IDs (as they are generated by most SVG editors including Inkscape) will be removed/shortened."
+ name="protect-ids-noninkscape" type="boolean">true</param>
+ <param _gui-text="Preserve the following IDs:"
+ _gui-description="A comma-separated list of IDs that are to be preserved."
+ name="protect-ids-list" type="string"></param>
+ <param _gui-text="Preserve IDs starting with:"
+ _gui-description="Preserve all IDs that start with the specified prefix (e.g. specify &quot;flag&quot; to preserve &quot;flag-mx&quot;, &quot;flag-pt&quot;, etc.)."
+ name="protect-ids-prefix" type="string"></param>
</page>
- </param>
+ </param>
<output>
<extension>.svg</extension>
<mimetype>image/svg+xml</mimetype>
@@ -63,6 +100,6 @@
<_filetypetooltip>Scalable Vector Graphics</_filetypetooltip>
</output>
<script>
- <command reldir="extensions" interpreter="python">scour/scour.inkscape.py</command>
+ <command reldir="extensions" interpreter="python">scour.inkscape.py</command>
</script>
</inkscape-extension>