Skip to content

Commit 07b8fdf

Browse files
committed
Add README
1 parent 40a3130 commit 07b8fdf

File tree

2 files changed

+168
-0
lines changed

2 files changed

+168
-0
lines changed

README-de.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
[Click here for the english version](README.md)
2+
3+
Dies ist eine Neuimplementierung der Inkscape-Generator-Erweiterung von Aurélio
4+
A. Heckert, zu finden unter <http://wiki.colivre.net/Aurium/InkscapeGenerator>
5+
6+
Ich habe diese Neuimplementierung aus zwei Gründen vorgenommen:
7+
8+
* Die ursprüngliche Erweiterung kann nur mit einigem Aufwand unter Windows
9+
genutzt werden, weil sie als Bash-Script geschrieben ist und Befehle wie `head`
10+
oder `sed` verwendet. Diese neue Implementierung ist in Python geschrieben und
11+
verwendet nur Standardfunktionen von Python und Windows.
12+
* Die ursprüngliche Erweiterung hat bei Schriftzeichen wie "`,`" oder "`"`"
13+
Probleme mit dem Parsen von CSV-Dateien.
14+
15+
#Installation
16+
17+
##Windows
18+
19+
Kopieren Sie `generator.inx` und `generator.py` in das Verzeichnis
20+
`C:\Program files\Inkscape\share\extensions`
21+
(globale Installation) oder in das Verzeichnis
22+
`C:\Users\<Username>\Application Data\Roaming\inkscape\share\extension`
23+
(Installation für einzelnen Nutzer).
24+
25+
Diese Erweiterung benötigt Python 2.7, welches ab Version 0.92.1 im
26+
Inkscape-Installer enthalten ist.
27+
28+
Folgendes ist unter Windows **NICHT** verfügbar:
29+
30+
* Fortschrittsbalken und Abbrechen-Schaltfäche während des Render-Vorgangs
31+
* Ausgabe im JPEG-Format
32+
33+
Wenn Sie die JPEG-Ausgabe benötigen, können Sie ImageMagick installieren und die
34+
Funktion `Png_to_jpg` in der Datei `generator.py` wie folgt anpassen (ersetzen
35+
Sie "`Path\to\convert.exe`" mit dem richtigen Pfad von `convert.exe`):
36+
37+
```python
38+
def Png_to_jpg(pngfile, jpgfile):
39+
Call_or_die(
40+
[
41+
'Path\to\convert.exe',
42+
'PNG:' + pngfile,
43+
'JPG:' + jpgfile
44+
],
45+
'ImageMagick Converting Error')
46+
```
47+
48+
##GNU/Linux
49+
50+
Kopieren Sie `generator.inx` und `generator.py` in das Verzeichnis
51+
`/usr/share/inkscape/extensions`
52+
(globale Installation) oder in das Verzeichnis
53+
`/home/<username>/.config/inkscape/extensions/`
54+
(Installation für einzelnen Nutzer).
55+
56+
Folgende Software wird benötigt:
57+
58+
* Python 2.7
59+
* Zenity (für besser Benutzer-Interaktion, grundsätzlich funktioniert die
60+
Erweiterung auch ohne Zenity)
61+
* Convert (Aus der ImageMagick-Suite, für den Export ins JPEG-Format)
62+
63+
# Inkompatible Änderungen
64+
65+
66+
Einige Details in der Benutzung dieser Erweiterung unterscheiden sich von der
67+
Benutzung der ursprünglichen Erweiterung:
68+
69+
* In der Bash-basierten Erweiterung mussten bestimmte Zeichen in der CSV-Datei
70+
maskiert werden. Zum Beispiel musste "`\\\\&amp;`" notiert werden, um das
71+
Zeichen "`&`" zu erhalten. In dieser Erweiterung muss "`&`"
72+
(wenn die Berücksichtigung von Sonderzeichen aktiviert ist) oder "`&amp;`"
73+
(wenn die Berücksichtigung von Sonderzeichen nicht aktiviert ist) notiert
74+
werden.
75+
76+
* In der Bash-basierten Erweiterung wurden die Zeichen "`[`", "`]`", "` `",
77+
"`$`", "`'`" und "`"`" durch einen Unterstrich ersetzt, wenn sie in einem
78+
Spaltennamen auftraten. Zum Beispiel musste für eine Spalte mit dem Namen
79+
"erster Name" der Platzhalter "`%VAR_erster_Name%` verwendet werden. Mit dieser
80+
Erweiterung findet keine solche Ersetzung statt. Es muss der Platzhalter
81+
"`%VAR_erster Name%` verwendet werden.
82+
83+
* Diese Änderungen ist nur von Bedeutung, wenn `generator.sh` nicht als
84+
Inkscape-Erweiterung genutzt, sondern direkt aufgerufen wurde: Im Bash-Script
85+
hatten einige Parameter einen Bindestrich im Namen (z.B. `--data-file`).
86+
In diesem Python-Script werden alle Parameter ohne Bindestrich geschrieben
87+
(z.B. `--datafile`).

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
[Hier geht's zur deutschen Version](README-de.md)
2+
3+
This is a reimplementation of the Inkscape generator plugin by Aurélio A.
4+
Heckert, which can be found here:
5+
<http://wiki.colivre.net/Aurium/InkscapeGenerator>
6+
7+
I did this for two reasons:
8+
9+
* It's difficult to run the original extension on Windows, since it is
10+
implemented as a bash script and uses commands like `head` or `sed`. The new
11+
implementation is done in Python and uses only standard features of Python and
12+
Windows.
13+
* The original extension has problems with correct parsing of CSV files when it
14+
comes to characters like "`,`" or "`"`".
15+
16+
#Installation
17+
18+
##Windows
19+
20+
Copy `generator.inx` and `generator.py` to
21+
`C:\Program files\Inkscape\share\extensions`
22+
(global installation) or
23+
`C:\Users\<Username>\Application Data\Roaming\inkscape\share\extension`
24+
(single user installation).
25+
26+
This extension needs Python 2.7, which is shipped with Inkscape 0.92.1 or later.
27+
28+
The following is **NOT** available on Windows:
29+
30+
* Progress bar and cancel button during generation process
31+
* Output to JPEG format
32+
33+
If you want JPEG output, you can install ImageMagick and modify the
34+
`Png_to_jpg` function in `generator.py` as follows (replace
35+
"`Path\to\convert.exe`" with the correct path to the `convert` executable):
36+
37+
```python
38+
def Png_to_jpg(pngfile, jpgfile):
39+
Call_or_die(
40+
[
41+
'Path\to\convert.exe',
42+
'PNG:' + pngfile,
43+
'JPG:' + jpgfile
44+
],
45+
'ImageMagick Converting Error')
46+
```
47+
48+
##GNU/Linux
49+
50+
Copy `generator.inx` and `generator.py` to
51+
`/usr/share/inkscape/extensions`
52+
(global installation) or
53+
`/home/<username>/.config/inkscape/extensions/`
54+
(single user installation).
55+
56+
The following software is requires:
57+
58+
* Python 2.7
59+
* Zenity (for better user interaction, the script will work without it)
60+
* Convert (from the ImageMagick suite, for JPEG export)
61+
62+
# Incompatible changes
63+
64+
Some details of the usage of this extension differ from the usage of the
65+
original extension:
66+
67+
* In the Bash-based extension, you had to escape certain characters in your CSV
68+
file. For example, you had to write "`\\\\&amp;`" to get a "`&`". With this
69+
extension, you need to write simply "`&`" (with handling of special characters
70+
enabled) or "`&amp;`" (with handling of special characters disabled).
71+
72+
* In the Bash-based extension, the characters "`[`", "`]`", "` `", "`$`", "`'`"
73+
and "`"`" were replaced by an underscore if they appear in a column name. For
74+
example, when you have a column named "first name", you had to use
75+
"`%VAR_first_name%`" as placeholder. With this extension, no such replacement
76+
occures. Your have to use the placeholder "`%VAR_first name`".
77+
78+
* This one is only important if you used `generator.sh` not as an inkscape
79+
extension, but called it directly: In the bash script, there were some parameters
80+
with a dash (i.e. "`--data-file`"). In this python script, there are no dashes
81+
in the parameters (i.e. "`--datafile`").

0 commit comments

Comments
 (0)