Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tools/genappendix.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/bash

DATA_DIR="$(cd "$(dirname "${0}")/.." && pwd)"
## windows hosts require leading // instead of /
case "$OSTYPE" in
msys*) DATA_DIR="/${DATA_DIR}" ;;
cygwin*) DATA_DIR="/${DATA_DIR}" ;;
esac
docker run -v ${DATA_DIR}:/data --rm -it trivadis/mktools bash -c "cd /data; ./tools/run-in-container/genappendix.sh docs/9-appendix/appendix.md"
5 changes: 5 additions & 0 deletions tools/genpdf.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/bash

DATA_DIR="$(cd "$(dirname "${0}")/.." && pwd)"
## windows hosts require leading // instead of /
case "$OSTYPE" in
msys*) DATA_DIR="/${DATA_DIR}" ;;
cygwin*) DATA_DIR="/${DATA_DIR}" ;;
esac
docker run -v ${DATA_DIR}:/data --rm -it trivadis/mktools bash -c "cd /data; ./tools/run-in-container/genpdf.sh"
7 changes: 6 additions & 1 deletion tools/interactive.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/bash

DATA_DIR="$(cd "$(dirname "${0}")/.." && pwd)"
docker run -v ${DATA_DIR}:/data -p 8000:8000 --rm -it trivadis/mktools bash
## windows hosts require leading // instead of /
case "$OSTYPE" in
msys*) DATA_DIR="/${DATA_DIR}" ;;
cygwin*) DATA_DIR="/${DATA_DIR}" ;;
esac
docker run -v ${DATA_DIR}:/data -p 8000:8000 --rm -it trivadis/mktools bash
5 changes: 5 additions & 0 deletions tools/mike.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash

DATA_DIR="$(cd "$(dirname "${0}")/.." && pwd)"
## windows hosts require leading // instead of /
case "$OSTYPE" in
msys*) DATA_DIR="/${DATA_DIR}" ;;
cygwin*) DATA_DIR="/${DATA_DIR}" ;;
esac
GIT_USERNAME="$(git config user.name)"
GIT_EMAIL="$(git config user.email)"
COMMAND="/data/tools/run-in-container/mike.sh '${GIT_USERNAME}' '${GIT_EMAIL}' $1 $2 $3 $4"
Expand Down
17 changes: 8 additions & 9 deletions tools/run-in-container/genappendix_b_table.awk
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ BEGIN {
text=$0;
# We just remove the # G-<id>: from the beginning of the text
dummy=sub(/^# G-[[:digit:]]+: /,"",text);

# Get the second of the 4 lines and ignore it, it's empty
getline;

# Get the third of the 4 lines
getline;
# Retrieve the severity field from the third line
severity=substr($3,2,length($3)-2);

# Get the fourth and last of the 4 lines
getline;
# If the char array was filled from the last iteration, we need to empty it here
Expand All @@ -42,7 +42,7 @@ BEGIN {
char[6]="";
char[7]="";
char[8]="";

# The fourth line is a comma-separated list of characteristics - split them into an array
no_of_characteristics=split($0,characteristics,",");
for (i in characteristics) {
Expand All @@ -55,7 +55,7 @@ BEGIN {
if (characteristics[i] ~ /Reusability/ ) {char[6]="&#10008;"}
if (characteristics[i] ~ /Security/ ) {char[7]="&#10008;"}
if (characteristics[i] ~ /Testability/ ) {char[8]="&#10008;"}

# If the characteristics value is something other than these 8 values, we output an error in the text so it'll be noticed
if (!(characteristics[i] ~ /Changeability/ || \
characteristics[i] ~ /Efficiency/ || \
Expand All @@ -66,16 +66,15 @@ BEGIN {
characteristics[i] ~ /Security/ || \
characteristics[i] ~ /Testability/ )) {text="!!!CHARACTERISTIC ERROR!!!"}
}

# Output the fields of the markdown table in appendix B
print old_id, new_id, text, severity, char[1], char[2], char[3], char[4], char[5], char[6], char[7], char[8];

# Special handling - between rule G-5040 and G-5050 we output the old rule 54 that is not mapped to any new rule
if (new_id == "5040") {
print "54 | n/a | Avoid use of EXCEPTION_INIT pragma for a 20nnn error. | Major | | | | | &#10008; | | | ";
}

# Done handling the 4 lines of one .md file. Next 4 lines will be from another .md file and be handled in the next iteration.
}
}

2 changes: 1 addition & 1 deletion tools/run-in-container/genpdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function copy_resources() {
cp -r ${DATA_DIR}/docs/stylesheets ${TARGET_DIR}/docs/stylesheets
}

# Materials for MkDocs 5.5.14 uses CSS that leads to wkhtmltopdf 0.12.6 printing all line numbers before the code with
# Materials for MkDocs 5.5.14 uses CSS that leads to wkhtmltopdf 0.12.6 printing all line numbers before the code with
# - "codehilite" plugin and "linenums: true"
# - "pymdownx.highlight" plugin and "linenums_style: table" (default)
# The workaround is to use "pymdownx.highlight" with "linenums_style: pymdownx-inline" and some CSS fixes
Expand Down
5 changes: 5 additions & 0 deletions tools/serve-ghpages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@

# serves local gh-pages - use to verify deployed sites with version selector before pushing gh-pages branch
DATA_DIR="$(cd "$(dirname "${0}")/.." && pwd)"
## windows hosts require leading // instead of /
case "$OSTYPE" in
msys*) DATA_DIR="/${DATA_DIR}" ;;
cygwin*) DATA_DIR="/${DATA_DIR}" ;;
esac
docker run -v ${DATA_DIR}:/data -p 8000:8000 --rm -it trivadis/mktools bash -c "cd /data; mike serve -a 0.0.0.0:8000"
7 changes: 6 additions & 1 deletion tools/serve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@

# serves from temporary site directory - use during development for live preview of changes in docs directory
DATA_DIR="$(cd "$(dirname "${0}")/.." && pwd)"
docker run -v ${DATA_DIR}:/data -p 8000:8000 --rm -it trivadis/mktools bash -c "cd /data; mkdocs serve -a 0.0.0.0:8000"
## windows hosts require leading // instead of /
case "$OSTYPE" in
msys*) DATA_DIR="/${DATA_DIR}" ;;
cygwin*) DATA_DIR="/${DATA_DIR}" ;;
esac
docker run -v ${DATA_DIR}:/data -p 8000:8000 --rm -it trivadis/mktools bash -c "cd /data; mkdocs serve -a 0.0.0.0:8000"