|
a/src/doc/user/xmlmake.sh |
|
b/src/doc/user/xmlmake.sh |
1 |
#!/bin/sh
|
1 |
#!/bin/sh
|
2 |
|
2 |
|
3 |
# A script to produce the Recoll manual with an xml toolchain.
|
3 |
# A script to produce the Recoll manual with an xml toolchain.
|
|
|
4 |
# Tools used:
|
|
|
5 |
# - xsltproc
|
|
|
6 |
# - The docbook-xsl styleets
|
|
|
7 |
# - dblatex for producing the PDF.
|
|
|
8 |
#
|
4 |
# Limitations:
|
9 |
# Limitations:
|
5 |
# - Does not produce the links to the whole/chunked versions at the top
|
10 |
# - Does not produce the links to the whole/chunked versions at the top
|
6 |
# of the document
|
11 |
# of the document
|
7 |
# - The anchor names from the source text are converted to uppercase by
|
12 |
# - The anchor names from the source text are converted to uppercase
|
8 |
# the sgml toolchain. This does not happen with the xml toolchain,
|
13 |
# by the sgml toolchain. This does not happen with the xml
|
9 |
# which means that external links like
|
14 |
# toolchain, which means that external links like
|
10 |
# usermanual.html#RCL.CONFIG.INDEXING won't work because fragments are
|
15 |
# usermanual.html#RCL.CONFIG.INDEXING won't work because fragments
|
11 |
# case-sensitive. This could be solved by converting all ids inside the
|
16 |
# are case-sensitive. This has been solved by converting all ids
|
12 |
# source file to upper-case.
|
17 |
# inside the source file to upper-case. DON'T REINTRODUCE
|
13 |
# - No simple way to produce pdf
|
18 |
# lower-case IDS
|
14 |
|
19 |
|
15 |
# Wherever docbook.xsl and chunk.xsl live
|
20 |
# Wherever docbook.xsl and chunk.xsl live
|
16 |
# Fbsd
|
21 |
# Fbsd
|
17 |
#XSLDIR="/usr/local/share/xsl/docbook/"
|
22 |
#XSLDIR="/usr/local/share/xsl/docbook/"
|
18 |
# Mac
|
23 |
# Mac
|
|
... |
|
... |
21 |
XSLDIR="/usr/share/xml/docbook/stylesheet/docbook-xsl/"
|
26 |
XSLDIR="/usr/share/xml/docbook/stylesheet/docbook-xsl/"
|
22 |
|
27 |
|
23 |
dochunky=1
|
28 |
dochunky=1
|
24 |
test $# -eq 1 && dochunky=0
|
29 |
test $# -eq 1 && dochunky=0
|
25 |
|
30 |
|
26 |
# Remove the SGML header and uncomment the XML one + convert from iso-8859-1
|
31 |
# Remove the SGML header and uncomment the XML one. Also used to iconv
|
27 |
# to utf-8
|
32 |
# from iso-8859-1 to UTF-8, but the SGML manual is now UTF-8 ? Would
|
|
|
33 |
# that work with the sgml toolchain ??
|
|
|
34 |
echo '<?xml version="1.0" encoding="UTF-8"?>' > usermanual.xml
|
28 |
sed -e '\!//FreeBSD//DTD!d' \
|
35 |
sed -e '\!//FreeBSD//DTD!d' \
|
29 |
-e '\!DTD DocBook XML!s/<!--//' \
|
36 |
-e '\!DTD DocBook XML!s/<!--//' \
|
30 |
-e '\!/docbookx.dtd!s/-->//' \
|
37 |
-e '\!/docbookx.dtd!s/-->//' \
|
31 |
< usermanual.sgml \
|
38 |
< usermanual.sgml \
|
32 |
| iconv -f iso-8859-1 -t utf-8 \
|
|
|
33 |
> usermanual.xml
|
39 |
>> usermanual.xml
|
34 |
|
40 |
|
35 |
# Options common to the single-file and chunked versions
|
41 |
# Options common to the single-file and chunked versions
|
36 |
commonoptions="--stringparam section.autolabel 1 \
|
42 |
commonoptions="--stringparam section.autolabel 1 \
|
37 |
--stringparam section.autolabel.max.depth 3 \
|
43 |
--stringparam section.autolabel.max.depth 3 \
|
38 |
--stringparam section.label.includes.component.label 1 \
|
44 |
--stringparam section.label.includes.component.label 1 \
|
|
... |
|
... |
57 |
"$XSLDIR/html/docbook.xsl" \
|
63 |
"$XSLDIR/html/docbook.xsl" \
|
58 |
usermanual.xml
|
64 |
usermanual.xml
|
59 |
|
65 |
|
60 |
tidy -indent usermanual-xml.html > tmpfile
|
66 |
tidy -indent usermanual-xml.html > tmpfile
|
61 |
mv -f tmpfile usermanual-xml.html
|
67 |
mv -f tmpfile usermanual-xml.html
|
|
|
68 |
|
|
|
69 |
# And the pdf with dblatex
|
|
|
70 |
dblatex usermanual.xml
|