1 |
10508
|
aaronmk
|
#!/bin/bash -e
|
2 |
|
|
# cleans up and formats Gimp's image map for publishing
|
3 |
|
|
. "$(dirname "${BASH_SOURCE[0]}")"/../../../lib/runscripts/util.run
|
4 |
|
|
.rel ../../../lib/sh/local.sh
|
5 |
|
|
|
6 |
|
|
if self_not_included; then
|
7 |
|
|
|
8 |
10541
|
aaronmk
|
reset()
|
9 |
|
|
{ :
|
10 |
|
|
# TODO: generate this from ../document.mwb.xml by matching occurrences of
|
11 |
|
|
# ^ <value type="string" key="name">(.+)</value>$
|
12 |
|
|
# and extracting the dimensions of the form
|
13 |
|
|
# <value type="real" key="{left,top,width,height}">
|
14 |
|
|
# (units are mm e+02)
|
15 |
|
|
}
|
16 |
|
|
|
17 |
10508
|
aaronmk
|
cleanup()
|
18 |
|
|
{
|
19 |
|
|
echo_func; set_make_vars
|
20 |
10510
|
aaronmk
|
in_place "$top_file" $sed_cmd \
|
21 |
|
|
-e 's/&/\&/g
|
22 |
|
|
# undo double-encodings' \
|
23 |
10516
|
aaronmk
|
-e 's/ +( -->)/\1/g
|
24 |
10510
|
aaronmk
|
# trim growing whitespace' \
|
25 |
|
|
|
26 |
10508
|
aaronmk
|
}
|
27 |
|
|
|
28 |
|
|
index.htm/make()
|
29 |
|
|
{
|
30 |
|
|
echo_func; set_make_vars
|
31 |
|
|
stdout="$target" to_file sed \
|
32 |
|
|
-e 's/( alt="[^:"]*): ([^"]*)(")/\1\3 title="\2"/g' \
|
33 |
|
|
"$top_file"
|
34 |
|
|
}
|
35 |
|
|
|
36 |
|
|
all()
|
37 |
|
|
{
|
38 |
|
|
echo_func
|
39 |
|
|
cleanup
|
40 |
|
|
index.htm/make
|
41 |
|
|
}
|
42 |
|
|
|
43 |
|
|
fi
|