File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,17 @@ function copy_resources() {
1212 cp -r ${DATA_DIR} /docs/stylesheets ${TARGET_DIR} /docs/stylesheets
1313}
1414
15+ # Materials for MkDocs 5.5.14 uses CSS that leads to wkhtmltopdf 0.12.6 printing all line numbers before the code with
16+ # - "codehilite" plugin and "linenums: true"
17+ # - "pymdownx.highlight" plugin and "linenums_style: table" (default)
18+ # The workaround is to use "pymdownx.highlight" with "linenums_style: pymdownx-inline" and some CSS fixes
19+ # This is acceptable since the PDF is the secondary format and "pymdownx.highlight" is the newer plugin
20+ # with some nice features for the HTML version.
21+ function fix_mkdocs_yml() {
22+ mv ${TARGET_DIR} /mkdocs.yml ${TARGET_DIR} /mkdocs.ori.yml
23+ sed -e ' s/linenums_style: table/linenums_style: pymdownx-inline/g' ${TARGET_DIR} /mkdocs.ori.yml > ${TARGET_DIR} /mkdocs.yml
24+ }
25+
1526function create_cover() {
1627 sed -e " s/#VERSION#/$( get_version) /g" ${DATA_DIR} /docs/cover-template.html \
1728 | sed -e " s/#YEAR#/$( date +' %Y' ) /g" > ${TARGET_DIR} /docs/cover.html
@@ -85,6 +96,7 @@ TARGET_DIR=${DATA_DIR}/pdf
8596
8697create_target_dir
8798copy_resources
99+ fix_mkdocs_yml
88100create_cover
89101write_file " index.md"
90102write_file " 1-introduction/introduction.md"
You can’t perform that action at this time.
0 commit comments