This repository was archived by the owner on Jul 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathgenerate_document.sh
More file actions
executable file
·93 lines (70 loc) · 1.73 KB
/
Copy pathgenerate_document.sh
File metadata and controls
executable file
·93 lines (70 loc) · 1.73 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/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
if ! command_exists xelatex; then
echo "Warning: Install xelatex to produce PDF output"
fi
echo ""
generate_pdf() {
if command_exists xelatex; then
# pandoc -N --template ../templates/template.tex --variable mainfont="Merriweather" --variable sansfont="Roboto" --variable monofont="Menlo" --variable fontsize=10pt --variable version=1.17.2 --pdf-engine=xelatex --toc -fmarkdown-implicit_figures -o "../container_security_verification_standard$1.pdf" *.md
echo " no PDF generated due to bugs"
else
echo " could not generate PDF, missing pdflatex"
fi
}
generate_docx() {
pandoc -s -f gfm --reference-doc=../templates/reference.docx --columns 10000 -t docx -o "../container_security_verification_standard_$1.docx" *.md
}
generate_html() {
pandoc -s -f gfm -t html5 -o "../container_security_verification_standard_$1.html" *.md
}
generate() {
echo -n "Generating CSVS ($1)..."
if [ -d "$1" ];
then
cd "$1"
generate_docx $1
generate_pdf $1
generate_html $1
cd ..
echo " done."
else
echo " No CSVS found in directory $1"
fi
}
# Arabic
#generate "ar"
# Brazil
#generate "br"
# Chinese
#generate "cn"
# Czech
#generate "cz"
# English
generate "en"
# French
#generate "fr"
# German
generate "de"
# Hebrew
#generate "heb"
# Italian
#generate "it"
# Japanese
#generate "jp"
# Korean
#generate "kr"
# Spanish
# generate "es"
# Ukraine
#generate "ukr"
echo
echo "Generated Container Security Verification Standard"