Skip to content

Commit

Permalink
Render PDFs to a folder
Browse files Browse the repository at this point in the history
  • Loading branch information
kadykov committed Nov 20, 2024
1 parent d02ea88 commit 1d776b5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Render with testing Docker image
run: >
docker container run
-v "${PWD}:/data"
-v "${PWD}:/data/public"
--user "$(id -u):$(id -g)"
${{ env.IMAGE_TAG_TESTING }}
Expand Down
21 changes: 13 additions & 8 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cv := "cv"
letter := "letter"
english := "en"
french := "fr"
output-dir := "./public"
typst := "typst compile"
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 -"
Expand All @@ -19,49 +20,53 @@ build-private:
just french-private

english:
mkdir -p {{output-dir}}
{{pandoc}} \
{{filename}}-{{cv}}-{{english}}.md \
-o {{filename}}-{{cv}}-{{english}}.pdf \
-o {{output-dir}}/{{filename}}-{{cv}}-{{english}}.pdf \
--template=typst-{{cv}}.typ
{{pandoc}} \
{{filename}}-{{letter}}-{{english}}.md \
-o {{filename}}-{{letter}}-{{english}}.pdf \
-o {{output-dir}}/{{filename}}-{{letter}}-{{english}}.pdf \
--template=typst-{{letter}}.typ

english-private:
mkdir -p {{output-dir}}
{{pandoc}} \
{{filename}}-{{cv}}-{{english}}.md \
--template=typst-{{cv}}.typ \
{{pandoc-to-typst}} \
{{filename}}-{{cv}}-{{english}}.pdf \
{{output-dir}}/{{filename}}-{{cv}}-{{english}}.pdf \
{{private-args}}
{{pandoc}} \
{{filename}}-{{letter}}-{{english}}.md \
--template=typst-{{letter}}.typ \
{{pandoc-to-typst}} \
{{filename}}-{{letter}}-{{english}}.pdf \
{{output-dir}}/{{filename}}-{{letter}}-{{english}}.pdf \
{{private-args}}

french:
mkdir -p {{output-dir}}
{{pandoc}} \
{{filename}}-{{cv}}-{{french}}.md \
-o {{filename}}-{{cv}}-{{french}}.pdf \
-o {{output-dir}}/{{filename}}-{{cv}}-{{french}}.pdf \
--template=typst-{{cv}}.typ
{{pandoc}} \
{{filename}}-{{letter}}-{{french}}.md \
-o {{filename}}-{{letter}}-{{french}}.pdf \
-o {{output-dir}}/{{filename}}-{{letter}}-{{french}}.pdf \
--template=typst-{{letter}}.typ

french-private:
mkdir -p {{output-dir}}
{{pandoc}} \
{{filename}}-{{cv}}-{{french}}.md \
--template=typst-{{cv}}.typ \
{{pandoc-to-typst}} \
{{filename}}-{{cv}}-{{french}}.pdf \
{{output-dir}}/{{filename}}-{{cv}}-{{french}}.pdf \
{{private-args}}
{{pandoc}} \
{{filename}}-{{letter}}-{{french}}.md \
--template=typst-{{letter}}.typ \
{{pandoc-to-typst}} \
{{filename}}-{{letter}}-{{french}}.pdf \
{{output-dir}}/{{filename}}-{{letter}}-{{french}}.pdf \
{{private-args}}

0 comments on commit 1d776b5

Please sign in to comment.