~frigory/inkscape-docs/tutos-fr

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
#! /bin/bash

# You will need Saxon 6.5.3 -- http://saxon.sourceforge.net/
# as well as a SVN build of Inkscape.
#
# At the time of writing, it is difficult to use Saxon without using
# non-free Java (of version >= 1.4).
#
# Usage:
#
#   ./make-html xml-file [ saxon-path [ inkscape-path ] ]
# or
#   ./make-html tutorial [ saxon-path [ inkscape-path [ language ] ] ]
#
# Examples:
#
#   ./make-html basic
#   ./make-html basic/tutorial-basic.es.xml
#   ./make-html basic /usr/share/saxon/lib/saxon.jar /usr/bin/inkscape es

set -e

case "$1" in
   *.xml)
      dir=`dirname "$1"`
      xml="$1"
      html=`echo "$xml" | sed 's,\.xml$,.html,'`
      ;;

   *)
      if [ "$4" != "" ]; then
	 lang=".$4"
      else
	 lang=""
      fi
      dir="$1"
      xml="$1/keys-$1$lang.xml"
      html="$1/keys-$1$lang.html"
      ;;
esac

if [ "$3" = "" ]; then
   inkscape="/usr/bin/inkscape"
else
   inkscape="$3"
fi

if [ "$2" = "" ]; then
   saxon="/usr/share/saxon/lib/saxon.jar"
else
   saxon="$2"
fi

echo -n "Making $html... "

java -classpath "${saxon}:$PWD/../javaclasses/" \
	com.icl.saxon.StyleSheet -o "$html" \
	"$xml" keys-html.xsl \
	ill-path="$dir/" ink-path="$inkscape"

echo "done"