Skip to content

Commit

Permalink
Pack templates and filters in Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
kadykov committed Nov 18, 2024
1 parent cde9980 commit 25cc664
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
30 changes: 14 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,33 @@ FROM fedora:${FEDORA_VERSION}

COPY --from=builder typst-x86_64-unknown-linux-musl/typst /usr/bin/typst

# ARG PANDOC_VERSION=3.1.3-29.fc40.x86_64
ARG PANDOC_VERSION=3.1.11.1-32.fc41.x86_64
ARG PANDOC_VERSION=3.1.11.1
ARG JUST_VERSION=1.35.0
ARG FIRA_SANS_VERSION=4.202
ARG IBM_PLEX_VERSION=6.4.0
ARG FONTAWESOME_VERSION=6.6.0
RUN dnf update -yq \
&& dnf install -yq \
just \
just-${JUST_VERSION} \
pandoc-${PANDOC_VERSION} \
mozilla-fira-sans-fonts \
ibm-plex-serif-fonts \
fontawesome-6-brands-fonts \
fontawesome-6-free-fonts \
mozilla-fira-sans-fonts-${FIRA_SANS_VERSION} \
ibm-plex-serif-fonts-${IBM_PLEX_VERSION} \
fontawesome-6-brands-fonts-${FONTAWESOME_VERSION} \
fontawesome-6-free-fonts-${FONTAWESOME_VERSION} \
&& dnf clean all

ENV TYPST_FONT_PATHS=/usr/share/fonts/

WORKDIR /data
ENV PANDOC_DATA_DIR=/usr/share/pandoc-${PANDOC_VERSION}/

# ARG PANDOC_VERSION_CORE=3.1.3
ARG PANDOC_VERSION_CORE=3.1.11.1
# COPY *.lua /usr/share/pandoc-${PANDOC_VERSION_CORE}/data/
# COPY typst-cv.typ typst-letter.typ /usr/share/pandoc-${PANDOC_VERSION_CORE}/data/templates/
ARG PANDOC_DIR=/usr/share/pandoc-${PANDOC_VERSION_CORE}
COPY typst-cv.typ typst-letter.typ ${PANDOC_DIR}/data/templates/
COPY *.lua /usr/local/share/pandoc/filters/
COPY *.lua ${PANDOC_DIR}/filters/
COPY typst-cv.typ typst-letter.typ ${PANDOC_DATA_DIR}/data/templates/
COPY *.lua ${PANDOC_DATA_DIR}/filters/

ARG PANDOC_CV_VERSION=0.1.0
ENV TYPST_PACKAGE_PATH=/usr/local/share/typst/packages/
COPY style.typ typst.toml ${TYPST_PACKAGE_PATH}/local/pandoc-cv/${PANDOC_CV_VERSION}/

WORKDIR /data
COPY justfile .

ENTRYPOINT [ "just", "build" ]
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ letter := "letter"
english := "en"
french := "fr"
typst := "typst compile"
pandoc := "pandoc --wrap=preserve --pdf-engine=typst --lua-filter=linkify.lua --lua-filter=typst-cv.lua"
pandoc := "pandoc --data-dir=$PANDOC_DATA_DIR --wrap=preserve --pdf-engine=typst --lua-filter=linkify.lua --lua-filter=typst-cv.lua"
pandoc-to-typst := "--to=typst | typst compile -"
private-args := '--input EMAIL="$EMAIL" --input PHONE="$PHONE"'

Expand Down

0 comments on commit 25cc664

Please sign in to comment.