chore: update Dockerfile dependencies and improve PDF build process
This commit is contained in:
parent
0249d0e85c
commit
0fea694575
5 changed files with 16 additions and 8 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -17,3 +17,5 @@ tmp*
|
||||||
vendor/bundle
|
vendor/bundle
|
||||||
*.zip
|
*.zip
|
||||||
mkdocs.yml
|
mkdocs.yml
|
||||||
|
.aider*
|
||||||
|
.env
|
||||||
|
|
|
@ -2,7 +2,7 @@ FROM node:18-bookworm-slim
|
||||||
LABEL maintainer="Glenn ROLLAND glenux@glenux.net"
|
LABEL maintainer="Glenn ROLLAND glenux@glenux.net"
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends python3 python3-pip pipenv \
|
&& apt-get install -y --no-install-recommends python3 python3-pip pipenv python3-pypandoc \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
||||||
&& truncate -s 0 /var/log/*log
|
&& truncate -s 0 /var/log/*log
|
||||||
|
@ -16,7 +16,7 @@ RUN apt-get update \
|
||||||
|
|
||||||
# Tools for building pdfs
|
# Tools for building pdfs
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends make pdftk m4 chromium \
|
&& apt-get install -y --no-install-recommends make m4 chromium pandoc ghc libghc-pandoc-dev lmodern texlive-latex-recommended texlive-latex-base texlive-latex-extra \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
||||||
&& truncate -s 0 /var/log/*log
|
&& truncate -s 0 /var/log/*log
|
||||||
|
@ -24,7 +24,7 @@ RUN apt-get update \
|
||||||
# External tools
|
# External tools
|
||||||
# yq => manage YML
|
# yq => manage YML
|
||||||
RUN curl -sSL -o /usr/local/bin/yq \
|
RUN curl -sSL -o /usr/local/bin/yq \
|
||||||
https://github.com/mikefarah/yq/releases/download/v4.18.1/yq_linux_amd64 \
|
https://github.com/mikefarah/yq/releases/download/v4.44.6/yq_linux_amd64 \
|
||||||
&& chmod +x /usr/local/bin/yq
|
&& chmod +x /usr/local/bin/yq
|
||||||
|
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
|
@ -22,6 +22,7 @@ clean: clean-docs
|
||||||
build-docs-pdf: ## build pdf docs only
|
build-docs-pdf: ## build pdf docs only
|
||||||
mkdir -p $(BUILD_DOCS_DIR)
|
mkdir -p $(BUILD_DOCS_DIR)
|
||||||
mkdir -p $(CACHE_DOCS_DIR)
|
mkdir -p $(CACHE_DOCS_DIR)
|
||||||
|
rm -f $(BUILD_DOCS_DIR)/docs.pdf
|
||||||
./utils/docs/build_combined.sh $(DOCS_DIR) $(CACHE_DOCS_DIR)/combined.md
|
./utils/docs/build_combined.sh $(DOCS_DIR) $(CACHE_DOCS_DIR)/combined.md
|
||||||
./utils/docs/build_metadata.sh mkdocs.yml $(CACHE_DOCS_DIR)/metadata.yml
|
./utils/docs/build_metadata.sh mkdocs.yml $(CACHE_DOCS_DIR)/metadata.yml
|
||||||
./utils/docs/build_pdf.py $(CACHE_DOCS_DIR)/metadata.yml $(CACHE_DOCS_DIR)/combined.md $(BUILD_DOCS_DIR)/docs.pdf
|
./utils/docs/build_pdf.py $(CACHE_DOCS_DIR)/metadata.yml $(CACHE_DOCS_DIR)/combined.md $(BUILD_DOCS_DIR)/docs.pdf
|
||||||
|
|
|
@ -33,6 +33,10 @@ if os.path.exists(output_file):
|
||||||
print(f"Output file already exists: {output_file}")
|
print(f"Output file already exists: {output_file}")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
print(f"Metadata: {metadata_file}")
|
||||||
|
print(f"Input: {input_file}")
|
||||||
|
print(f"Output: {output_file}")
|
||||||
|
|
||||||
# Build the pandoc options as a string
|
# Build the pandoc options as a string
|
||||||
pandoc_cmd = [
|
pandoc_cmd = [
|
||||||
"--toc",
|
"--toc",
|
||||||
|
@ -45,7 +49,8 @@ pandoc_cmd = [
|
||||||
"-V", "mainfont=DejaVu Serif",
|
"-V", "mainfont=DejaVu Serif",
|
||||||
"-V", "monofont=SauceCodePro Nerd Font",
|
"-V", "monofont=SauceCodePro Nerd Font",
|
||||||
"--pdf-engine=pdflatex",
|
"--pdf-engine=pdflatex",
|
||||||
"--filter=utils/docs/filter-nobg.hs",
|
"--resource-path=utils/docs",
|
||||||
|
"--filter=./utils/docs/filter-nobg.hs",
|
||||||
]
|
]
|
||||||
|
|
||||||
# from glob import glob
|
# from glob import glob
|
||||||
|
@ -54,7 +59,7 @@ pandoc_cmd = [
|
||||||
|
|
||||||
# Convert all markdown files in the chapters/ subdirectory.
|
# Convert all markdown files in the chapters/ subdirectory.
|
||||||
pypandoc.convert_file(
|
pypandoc.convert_file(
|
||||||
[input_file],
|
input_file,
|
||||||
"pdf",
|
"pdf",
|
||||||
outputfile=output_file,
|
outputfile=output_file,
|
||||||
extra_args=pandoc_cmd,
|
extra_args=pandoc_cmd,
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
% Include additional settings from external files
|
% Include additional settings from external files
|
||||||
% \input{inline_code.tex}
|
% \input{inline_code.tex}
|
||||||
% \input{bullet_styling.tex}
|
% \input{bullet_styling.tex}
|
||||||
\input{chapter_breaks.tex}
|
\input{utils/docs/chapter_breaks.tex}
|
||||||
\input{blockquote.tex}
|
\input{utils/docs/blockquote.tex}
|
||||||
\input{hyperref_setup.tex}
|
\input{utils/docs/hyperref_setup.tex}
|
||||||
|
|
||||||
% Font settings using fontspec
|
% Font settings using fontspec
|
||||||
% \usepackage{fontspec}
|
% \usepackage{fontspec}
|
||||||
|
|
Loading…
Add table
Reference in a new issue