scour.inx 8.59 KB
Newer Older
1 2
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
3
    <_name>Optimized SVG Output</_name>
4
    <id>org.inkscape.output.scour</id>
Patrick Storz's avatar
Patrick Storz committed
5
    <dependency type="executable" location="extensions">scour.inkscape.py</dependency>
Nicolas Dufour's avatar
Nicolas Dufour committed
6
    <param name="tab" type="notebook">
Patrick Storz's avatar
Patrick Storz committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
        <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">
Nicolas Dufour's avatar
Nicolas Dufour committed
62 63
                <_item value="space">Space</_item>
                <_item value="tab">Tab</_item>
64
                <_item msgctxt="Indent" value="none">None</_item>
Nicolas Dufour's avatar
Nicolas Dufour committed
65
            </param>
Patrick Storz's avatar
Patrick Storz committed
66 67 68 69 70 71
            <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>
Nicolas Dufour's avatar
Nicolas Dufour committed
72
        </page>
Patrick Storz's avatar
Patrick Storz committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
        <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>
Nicolas Dufour's avatar
Nicolas Dufour committed
94
        </page>
Patrick Storz's avatar
Patrick Storz committed
95
    </param>
96 97 98
    <output>
        <extension>.svg</extension>
        <mimetype>image/svg+xml</mimetype>
99
        <_filetypename>Optimized SVG (*.svg)</_filetypename>
100 101 102
        <_filetypetooltip>Scalable Vector Graphics</_filetypetooltip>
    </output>
    <script>
Patrick Storz's avatar
Patrick Storz committed
103
        <command reldir="extensions" interpreter="python">scour.inkscape.py</command>
104 105
    </script>
</inkscape-extension>