-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgenerate_document.sh
executable file
·56 lines (45 loc) · 1.12 KB
/
generate_document.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
#!/bin/bash
echo "OWASP Markdown Conversion Tool"
echo ""
function command_exists () {
command -v $1 >/dev/null 2>&1;
}
if ! command_exists pandoc; then
echo "Error: Please install pandoc. Cannot continue"
exit;
fi
generate_docx() {
pandoc -s -f gfm --reference-doc=../templates/reference.docx --columns 10000 --toc -t docx -o "../docs_$1/OWASP CBAS SAP Security Maturity Model $2-$1.docx" *.md
# After this process, move the Table of Contents and change the style
# of the first Heading 1 so it is on the first page
}
# generate_html() {
# pandoc -s -f markdown_github -t html5 -o "../OWASP Application Security Verification Standard 4.0-$1.html" *.md
# }
lang="en"
vers="0.8.1"
if [ -z "$1" ]
then
lang="en"
else
lang=$1
fi
if [ -z "$2" ]
then
vers="0.8"
else
vers=$2
fi
echo -n "Generating OWASP SAP Security Verification Standard $vers ($lang)..."
if [ -d "$lang" ];
then
cd "Controls_${lang}"
generate_docx $lang $vers
# generate_html $lang
cd ..
echo " done."
else
echo " No OWASP CBAS found in directory $lang"
fi
echo
echo "Generated OWASP CBAS SAP Security Maturity Model $vers"