]>
Commit | Line | Data |
---|---|---|
89a66d76 JC |
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 | # | |
686b0d9b MCC |
10 | set -eu |
11 | ||
12 | if [ "$#" != "2" ]; then | |
13 | echo "$0 <docbook file> <rst file>" | |
14 | exit | |
15 | fi | |
16 | ||
17 | DIR=$(dirname $0) | |
89a66d76 JC |
18 | |
19 | in=$1 | |
20 | rst=$2 | |
21 | tmp=$rst.tmp | |
22 | ||
23 | cp $in $tmp | |
686b0d9b | 24 | sed --in-place -f $DIR/convert_template.sed $tmp |
89a66d76 | 25 | pandoc -s -S -f docbook -t rst -o $rst $tmp |
686b0d9b | 26 | sed --in-place -f $DIR/post_convert.sed $rst |
89a66d76 | 27 | rm $tmp |
686b0d9b | 28 | echo "book writen to $rst" |