-
Notifications
You must be signed in to change notification settings - Fork 4
/
generator.inx
78 lines (58 loc) · 3.79 KB
/
generator.inx
1
2
3
4
5
6
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="UTF-8"?>
<!-- inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension" -->
<inkscape-extension>
<_name>Generator</_name>
<id>generator.aurium.colivre.coop.br</id>
<dependency type="executable" location="extensions">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 an UTF-8 CSV file 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 first 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 & are replaced with entities like &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 "=>" (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=>secure color|#00ff00=>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="Export"/>
</effects-menu>
</effect>
<script>
<command reldir="extensions" interpreter="python">generator.py</command>
</script>
</inkscape-extension>