Merge tag 'v4.11-next-fixes' of https://github.com/mbgg/linux-mediatek into fixes
[sfrench/cifs-2.6.git] / Documentation / sphinx / tmplcvt
1 #!/bin/bash
2 #
3 # Convert a template file into something like RST
4 #
5 # fix <function>
6 # feed to pandoc
7 # fix \_
8 # title line?
9 #
10 set -eu
11
12 if [ "$#" != "2" ]; then
13         echo "$0 <docbook file> <rst file>"
14         exit
15 fi
16
17 DIR=$(dirname $0)
18
19 in=$1
20 rst=$2
21 tmp=$rst.tmp
22
23 cp $in $tmp
24 sed --in-place -f $DIR/convert_template.sed $tmp
25 pandoc -s -S -f docbook -t rst -o $rst $tmp
26 sed --in-place -f $DIR/post_convert.sed $rst
27 rm $tmp
28 echo "book writen to $rst"