-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.rst2html_all.sh
executable file
·56 lines (49 loc) · 1.48 KB
/
.rst2html_all.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env /bin/bash
#
# __author__='Lilian BESSON'
# __email__='lilian DOT besson AT normale D O T fr'
# __version__='0.1'
# __date__='mar. 22/09/2013 at 22h14m'
#
# A simple script to generate simple HTML pages from rST sources.
STYLE=".rst2html_all.css"
RST2HTML="rst2html --report=info --halt=none --date --no-source-link --quiet --warnings=/tmp/rst2html.log --language=fr --link-stylesheet --stylesheet=${STYLE}"
LANG="en"
BUILDDIR=".build"
for i in "$@"; do
case "$i" in
-h|--help|-?|--?)
echo -e "$0 --help file1.rst [file2.rst [...]]"
echo -e ""
echo -e "Copy all file*.rst to ${BUILDDIR}/simplehtml/file*.html"
echo -e "Help:"
echo -e " --help: to print this help message."
echo -e "Options:"
echo -e " not yet :( ..."
echo -e ""
echo -e "Copyrights: (c) Lilian Besson 2011-2013."
echo -e "Released under the term of the GPL v3 Licence."
echo -e "In particular, $0 is provide WITHOUT ANY WARANTY."
exit 0
;;
--test)
test="yes"
echo -e "Option: --test: a test.."
shift
;;
*)
echo -e "Arg $i found... Next :)"
;;
esac
done
[ -f "$HOME"/.color.sh ] && . "$HOME"/.color.sh
DIRECTION="${BUILDDIR}/simplehtml/"
mkdir -v --parents "$DIRECTION"
[ -f "$STYLE" ] && cp -vf "$STYLE" "$DIRECTION"
## for f in ./*.rst; do
for f in "$@"; do
( ${RST2HTML} "$f" "${DIRECTION}${f%.rst}.html" && AddGA.sh UA-38514290-1 "i" "${DIRECTION}${f%.rst}.html" && \
echo -e "$f -> ${DIRECTION}${f%.rst}.html" ) || exit 2
done
echo -e "${green}$0: done.${white}"
# END