This repository has been archived on 2023-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
mightyscape-0.92-deprecated/extensions/fablabchemnitz_generator.inx

64 lines
4.2 KiB
Plaintext
Raw Normal View History

2019-11-14 20:05:10 +01:00
<?xml version="1.0" encoding="UTF-8"?>
<!-- inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension" -->
<inkscape-extension>
<_name>Generator (Variables)</_name>
<id>fablabchemnitz.de.generator</id>
<dependency type="executable" location="extensions">fablabchemnitz_generator.py</dependency>
<param name="tab" type="notebook">
<page name="tabA" _gui-text="Configuration">
<param name="vartype" type="enum" _gui-text="Collect values by:">
<_item value="column">column position</_item>
<_item value="name">column name</_item>
</param>
<param name="sep" type="description">•••••••••••••••••••••••••••••••••••••••••••••••••••••••••</param>
<_param name="info1" type="description">Extra textual values to be replaced:</_param>
<param name="extravars" type="string" gui-text=" "></param>
<param name="sep" type="description">•••••••••••••••••••••••••••••••••••••••••••••••••••••••••</param>
<param name="datafile" type="string" _gui-text="Data file:"></param>
<_param name="extraVarInfo" type="description">The data file must be a CSV with comma separated columns</_param>
<param name="sep" type="description">•••••••••••••••••••••••••••••••••••••••••••••••••••••••••</param>
<param name="specialchars" type="boolean" _gui-text="Handle special XML characters">true</param>
<param name="format" type="enum" _gui-text="Exportation format:">
<item value="PDF">PDF</item>
<item value="SVG">SVG</item>
<item value="PS">PS</item>
<item value="EPS">EPS</item>
<item value="PNG">PNG</item>
<item value="JPG">JPG</item>
</param>
<param name="dpi" type="string" _gui-text="DPI (for PNG and JPG):">90</param>
<param name="output" type="string" _gui-text="Output pattern:">$HOME/generator-output/%VAR_1%.pdf</param>
<param name="preview" type="boolean" _gui-text="Preview (make and show only the frist register)"></param>
</page>
<page name="tabB" _gui-text="Help">
<_param name="helpTxt" type="description">
How vars are replaced?
The replacer will walk in each data column, line-by-line, and will try to replace the %VAR_#% in the SVG by the column value.
If you select "column position", # is the column number.
If you select "column name", # is the column name, defined in the first line.
If you enable the handling of special characters, characters like &amp; are replaced with entities like &amp;amp; as required by the SVG standard. In most cases, you should enable this option.
I can replace other text paterns, like element values?
Yes. On the second field, add all extra text to be replaced in a line separated by "|", pointing to the replacer column with "=&gt;" (name or number depending on the choice up). Do not use spaces if that is not part of the blocks!
For example, we can make the red and green colors as variables to be replaced by some other colors from the database at the columns "secure color" and "sector color":
#ff0000=&gt;secure color|#00ff00=&gt;sector color
All pure red and pure green elementes will have new colors for each data line.
If you are not sure about the usable variables, run it on preview mode and the replaceable texts wil be showed to you.
</_param>
</page>
</param>
<effect needs-live-preview="false" needs-document="true">
<object-type>all</object-type>
<effects-menu>
<submenu _name="FabLab Chemnitz">
<submenu _name="Import/Export/Transfer" />
</submenu>
</effects-menu>
</effect>
<script>
<command reldir="extensions" interpreter="python">fablabchemnitz_generator.py</command>
</script>
</inkscape-extension>