-
Notifications
You must be signed in to change notification settings - Fork 5
/
vmtkscripts2html.sh
executable file
·62 lines (51 loc) · 1.41 KB
/
vmtkscripts2html.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
57
58
59
60
61
#!/usr/bin/env bash
usage="Please specify vmtk bin directory as first argument."
if [ $# -eq 0 ]
then
echo $usage
echo
exit 1;
fi
if [ ! -d $1 ]
then
echo $usage
echo
exit 1;
fi
if [ -d vmtkscripts ]
then
rm -rf vmtkscripts
fi
mkdir vmtkscripts
scripts=`ls $1/vmtk?*`
#scripts=`basename $scripts`
if [ documentation/vmtkscripts.md ]
then
rm documentation/vmtkscripts.md
fi
echo --- >> documentation/vmtkscripts.md
echo layout: page-full-width >> documentation/vmtkscripts.md
echo --- >> documentation/vmtkscripts.md
echo >> documentation/vmtkscripts.md
echo {:.vmtklist} >> documentation/vmtkscripts.md
echo >> documentation/vmtkscripts.md
echo \# vmtkScripts reference >> documentation/vmtkscripts.md
echo >> documentation/vmtkscripts.md
echo \| Script \| Description \| >> documentation/vmtkscripts.md
echo \|:--\|:--\| >> documentation/vmtkscripts.md
for script in $scripts; do
script=`basename $script`
echo \| \[$script\]\(/vmtkscripts/${script}.html\) \| `pyperun --nolog $script --doc` \| >> documentation/vmtkscripts.md
done
for script in $scripts; do
script=`basename $script`
if [ $script == "vmtkscripts" ]
then
continue
fi
echo --- >> vmtkscripts/${script}.md
echo layout: page-full-width >> vmtkscripts/${script}.md
echo --- >> vmtkscripts/${script}.md
echo pyperun --nolog $script --html
pyperun --nolog $script --html >> vmtkscripts/${script}.md
done