summaryrefslogtreecommitdiff
path: root/Documentation/sphinx/tmplcvt
blob: 6848f0a26fa54362d05fe0b4344686b78523c853 (plain)
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
#!/bin/bash
#
# Convert a template file into something like RST
#
# fix <function>
# feed to pandoc
# fix \_
# title line?
#
set -eu

if [ "$#" != "2" ]; then
	echo "$0 <docbook file> <rst file>"
	exit
fi

DIR=$(dirname $0)

in=$1
rst=$2
tmp=$rst.tmp

cp $in $tmp
sed --in-place -f $DIR/convert_template.sed $tmp
pandoc -s -S -f docbook -t rst -o $rst $tmp
sed --in-place -f $DIR/post_convert.sed $rst
rm $tmp
echo "book writen to $rst"