Skip to content

Commit ff72ab9

Browse files
simplify CSS for wkhtmltopdf
1 parent a25daf2 commit ff72ab9

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

tools/run-in-container/genpdf.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,19 @@ function fix_footnote_links() {
4343
sed -e 's/a class="footnote-ref"/a /g' index.ori.html > index.html
4444
}
4545

46+
function fix_unsupported_css() {
47+
mv index.html temp.html
48+
sed -e 's|<style>:root.*</style>|<style>html,body,input{font-family:"Roboto"}code,kbd,pre{font-family:"Roboto Mono"}</style>|g' temp.html > index.html
49+
rm temp.html
50+
51+
OPTIONS='{"stage":false,"features":{"color-functional-notation":{"preserver":false}}}'
52+
cp assets/stylesheets/main.1d29e8d0.min.css assets/stylesheets/main.1d29e8d0.min.ori.css
53+
csstools-cli postcss-preset-env assets/stylesheets/main.1d29e8d0.min.css --replace --plugin-options ${OPTIONS}
54+
55+
cp assets/stylesheets/palette.cbb835fc.min.css assets/stylesheets/palette.cbb835fc.min.ori.css
56+
csstools-cli postcss-preset-env assets/stylesheets/palette.cbb835fc.min.css --replace --plugin-options ${OPTIONS}
57+
}
58+
4659
function write_text(){
4760
TEXT=$1
4861
echo "" >> ${TARGET_DIR}/docs/index.md
@@ -58,7 +71,9 @@ function write_guidelines(){
5871
sed -e "s|# |${HEADER} |g" $f | \
5972
sed -e 's/..\/image/image/g' | \
6073
sed -e 's|../../../../4-language-usage/3-dml-and-sql/3-transaction-control/g-3310|#g-3310-never-commit-within-a-cursor-loop|g' | \
61-
sed -e 's|../../../../4-language-usage/3-dml-and-sql/3-transaction-control/g-3320|#g-3320-try-to-move-transactions-within-a-non-cursor-loop-into-procedures|g' >> ${TARGET_DIR}/docs/index.md
74+
sed -e 's|../../../../4-language-usage/3-dml-and-sql/3-transaction-control/g-3320|#g-3320-try-to-move-transactions-within-a-non-cursor-loop-into-procedures|g' | \
75+
sed -e 's|../../../../4-language-usage/7-stored-objects/7-triggers/g-7740|#g-7740-never-handle-multiple-dml-events-per-trigger-if-primary-key-is-assigned-in-trigger|g' \
76+
>> ${TARGET_DIR}/docs/index.md
6277
done
6378
}
6479

@@ -72,6 +87,7 @@ function convert_to_pdf(){
7287
mkdocs build
7388
cd site
7489
fix_footnote_links
90+
fix_unsupported_css
7591
wkhtmltopdf --enable-local-file-access \
7692
--allow "." \
7793
--disable-smart-shrinking \
@@ -93,6 +109,7 @@ function convert_to_pdf(){
93109
toc \
94110
--xsl-style-sheet stylesheets/toc.xsl \
95111
index.html ${DATA_DIR}/docs/9-appendix/PLSQL-and-SQL-Coding-Guidelines.pdf
112+
echo docs/9-appendix/PLSQL-and-SQL-Coding-Guidelines.pdf produced.
96113
}
97114

98115
DATA_DIR="$(cd "$(dirname "${0}")/../.." && pwd)"

0 commit comments

Comments
 (0)