Skip to content
This repository was archived by the owner on Jul 6, 2021. It is now read-only.

Commit 642e887

Browse files
committed
fix: broken links in pdf
1 parent 86e973c commit 642e887

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ The following programs must be installed on the observer machine:
9999
* awk
100100
* sed
101101
* pandoc *
102-
* wkhtmltopdf *
102+
* wkhtmltopdf >= 0.12.4 *
103103

104104
Pandoc and wkhtmltopdf optional, they need for generating HTML and PDF versions
105105
of report (see `--pdf` and `--html`).
@@ -121,9 +121,14 @@ sudo apt-get install postgresql
121121
sudo apt-get install coreutils
122122
sudo apt-get install jq
123123
sudo apt-get install golang
124-
# Optional
124+
# Optional (if you need PDF/HTML)
125+
# Pandoc (needed for both HTML and PDF generation)
125126
sudo apt install pandoc
126-
sudo apt-get install wkhtmltopdf
127+
# wkhtmltopdf (needed for PDF generation)
128+
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
129+
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
130+
sudo mv wkhtmltox/bin/wkhtmlto* /usr/local/bin
131+
sudo apt-get install -y openssl libssl-dev libxrender-dev libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig
127132
```
128133

129134
MacOS (assuming that Homebrew is installed):

checkup

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,16 @@ validate_args() {
370370
echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')] ERROR: 'wkhtmltopdf' not found. Cannot generate PDF." >&2
371371
exit 1
372372
fi
373+
374+
wkhtmltopdf_ver_resp=$(wkhtmltopdf -V)
375+
wkhtmltopdf_ver_resp_lines=${wkhtmltopdf_ver_resp// /\\n}
376+
wkhtmltopdf_current_ver=$(echo -e $wkhtmltopdf_ver_resp_lines | awk '/([0-9.]+)/')
377+
wkhtmltopdf_required_ver="0.12.4"
378+
379+
if [ "$(printf '%s\n' "$wkhtmltopdf_required_ver" "$wkhtmltopdf_current_ver" | sort -V | head -n1)" != "$wkhtmltopdf_required_ver" ]; then
380+
echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')] ERROR: 'wkhtmltopdf' version is outdated. Update to $wkhtmltopdf_required_ver or newer. See README. Cannot generate PDF." >&2
381+
exit 1
382+
fi
373383
fi
374384

375385
# custom UNIX domain socket directory for PostgreSQL
@@ -782,7 +792,7 @@ glue_md_reports() {
782792
tableOfContents=""
783793
content=""
784794
echo "" >> "${out_fname}"
785-
echo "<a name=\"postgres-checkup_top\"></a>" >> "${out_fname}"
795+
echo "<a name=\"postgres-checkup_top\">&nbsp;</a>" >> "${out_fname}"
786796
echo "### Table of contents ###" >> "${out_fname}"
787797
#generate table of contents and glue reports together
788798
for cur_report in "${MD_REPORTS_DIR}"/*.md; do
@@ -795,7 +805,7 @@ glue_md_reports() {
795805
title="${title%"${title##*[![:space:]]}"}"
796806
checkId=$(echo $title | cut -c 1-4)
797807
tableOfContents="$tableOfContents\n[$title](#postgres-checkup_$checkId) "
798-
content="$content\n\n\n---\n<a name=\"postgres-checkup_$checkId\"></a>\n[Table of contents](#postgres-checkup_top)"
808+
content="$content\n\n\n---\n<a name=\"postgres-checkup_$checkId\">&nbsp;</a>\n[Table of contents](#postgres-checkup_top)"
799809
report=$(cat "${cur_report}")
800810
content="$content\n$report"
801811
done

resources/pdf.style

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ body input {
259259
}
260260

261261
body a {
262-
color: black;
262+
color: #0366d6;
263263
text-decoration: none;
264264
}
265265

@@ -1020,4 +1020,4 @@ body .pl-12 {
10201020
font-weight: bold;
10211021
color: #333;
10221022
}
1023-
</style>
1023+
</style>

0 commit comments

Comments
 (0)