From d1e7ec9ae2f3373fea2568abbe957752fc7c9781 Mon Sep 17 00:00:00 2001 From: damien clochard Date: Thu, 16 May 2024 13:05:45 +0000 Subject: [PATCH 1/8] Update to pandoc 3.2 --- README.md | 7 ++--- tests/expected/dokuwiki/syntax.dokuwiki.md | 32 ++++++++++------------ ubuntu/Dockerfile | 18 +----------- 3 files changed, 18 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index c87ac83..2127fed 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ So far, we provide the 3 templates below: * [eisvogel] is designed for lecture notes and exercises with a focus on computer science. It works with `pdflatex` and `xelatex`. * [easy templates] is a collection of HTML templates -* [letter] is for writing letters in markdown. Works only with `xelatex` + You can use them simply by adding `--template=xxx` to your compilation lines: @@ -86,8 +86,6 @@ Each template has specific variables that you can use to adapt the document. Please go the project page of each template for more details. [eisvogel]: https://github.com/Wandmalfarbe/pandoc-latex-template -[leaflet]: https://gitlab.com/daamien/pandoc-leaflet-template -[letter]: https://github.com/aaronwolen/pandoc-letter [easy templates]: https://github.com/ryangrose/easy-pandoc-templates ## Filters @@ -109,7 +107,6 @@ filters below: * [pandoc-latex-margin] : Resize the margins of your PDF documents * [pandoc-latex-newpage] : Convert horizontal rule to new page in LaTeX * [pandoc-mustache] : basic variables substitution -* [pandoc-minted] : advanced syntax highlighting * [pandoc-crossref] : support for cross-referencing sections, figures, and more * [pandoc-run-postgres] : Execute SQL queries inside a markdown document * [pandoc-jinja] : Render pandoc metadata inside the document itself @@ -136,7 +133,7 @@ and [pandoc-mustache] filters. [pandoc-latex-margin]: https://github.com/chdemko/pandoc-latex-margin [pandoc-latex-newpage]: https://github.com/chdemko/pandoc-latex-newpage [pandoc-mustache]: https://github.com/michaelstepner/pandoc-mustache -[pandoc-minted]: https://github.com/nick-ulle/pandoc-minted + [pandoc-crossref]: https://github.com/lierdakil/pandoc-crossref [pandoc-run-postgres]: https://github.com/daamien/pandoc-run-postgres [pandoc-jinja]: https://github.com/daamien/pandoc-jinja diff --git a/tests/expected/dokuwiki/syntax.dokuwiki.md b/tests/expected/dokuwiki/syntax.dokuwiki.md index 86a1df2..3cbeaa6 100644 --- a/tests/expected/dokuwiki/syntax.dokuwiki.md +++ b/tests/expected/dokuwiki/syntax.dokuwiki.md @@ -123,13 +123,12 @@ Notes: open a Windows Share. To remove this warning (for all users), put the following line in `conf/lang/en/lang.php` (more details at [localization](https://www.dokuwiki.org/localization#changing_some_localized_texts_and_strings_in_your_installation)): - ` -``` + * This is a list * The second item * You may have different levels @@ -584,9 +584,8 @@ HTML example: This is some inline HTML `{=html} -```{=html}

And this is some block HTML

-``` + PHP example: @@ -606,12 +605,11 @@ echo phpversion(); echo ' (inline HTML)'; ?>`{=html} -```{=html} The same, but inside a block level element:'; echo ''.phpversion().''; echo ''; ?> -``` + **Please Note**: HTML and PHP embedding is disabled by default in the configuration. If disabled, the code is displayed instead of executed. diff --git a/ubuntu/Dockerfile b/ubuntu/Dockerfile index d4d209c..ac22ea7 100644 --- a/ubuntu/Dockerfile +++ b/ubuntu/Dockerfile @@ -5,9 +5,7 @@ # https://github.com/geometalab/docker-pandoc/blob/develop/Dockerfile # https://github.com/vpetersson/docker-pandoc/blob/master/Dockerfile -# switch to 2.20-ubuntu when released -# https://hub.docker.com/r/pandoc/extra/tags -FROM pandoc/extra:edge-ubuntu +FROM pandoc/extra:3.2-ubuntu # Set the env variables to non-interactive ENV DEBIAN_FRONTEND noninteractive @@ -126,23 +124,9 @@ RUN tlmgr init-usertree && \ ## T E M P L A T E S ## - # Templates are installed in '/.pandoc'. ARG TEMPLATES_DIR=/.pandoc/templates -# letter template -# DEPRECATED BUT KEPT FOR BACKWARD COMPAT -# Maybe switch to https://github.com/JensErat/pandoc-scrlttr2 ? -#ARG LETTER_REPO=https://raw.githubusercontent.com/aaronwolen/pandoc-letter -#ARG LETTER_VERSION=master -#RUN wget ${LETTER_REPO}/${LETTER_VERSION}/template-letter.tex -O ${TEMPLATES_DIR}/letter.latex - -# leaflet template -# DEPRECATED BUT KEPT FOR BACKWARD COMPAT -#ARG LEAFLET_REPO=https://gitlab.com/daamien/pandoc-leaflet-template/raw -#ARG LEAFLET_VERSION=1.0 -#RUN wget ${LEAFLET_REPO}/${LEAFLET_VERSION}/leaflet.latex -O ${TEMPLATES_DIR}/leaflet.latex - # Easy templates ARG EASY_REPO=https://raw.githubusercontent.com/ryangrose/easy-pandoc-templates/ ARG EASY_VERSION=9a884190fe19782f4434851053947173f8cec3d2 From 815133c29dc6347eb80d8fe19b3cb15ad31dd8c0 Mon Sep 17 00:00:00 2001 From: damien clochard Date: Thu, 16 May 2024 13:32:15 +0000 Subject: [PATCH 2/8] use pip with --break-system-packages --- ubuntu/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ubuntu/Dockerfile b/ubuntu/Dockerfile index ac22ea7..537c7bc 100644 --- a/ubuntu/Dockerfile +++ b/ubuntu/Dockerfile @@ -97,8 +97,11 @@ RUN wget https://github.com/hakimel/reveal.js/archive/${REVEALJS_VERSION}.tar.gz ## # Python filters +# The option `--break-system-packages` sounds bad but this is not +# really a problem here because we are not using Python debian packages +# anyway. ADD requirements.txt ./ -RUN pip3 --no-cache-dir install -r requirements.txt +RUN pip3 --no-cache-dir install -r requirements.txt --break-system-packages # Lua filters ARG PANDA_REPO=https://github.com/CDSoft/panda.git From 66387c8949863c90b02f6b4e868230d9beee3bc0 Mon Sep 17 00:00:00 2001 From: damien clochard Date: Thu, 16 May 2024 16:38:20 +0200 Subject: [PATCH 3/8] remove deprecated tests --- tests/extra.bats | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/tests/extra.bats b/tests/extra.bats index 02fec88..ecb7c59 100755 --- a/tests/extra.bats +++ b/tests/extra.bats @@ -123,20 +123,6 @@ teardown() { -o $OUT/sample-presentation.eisvogel.xelatex.pdf } -## 32x: Letter -## https://github.com/dalibo/pandocker/issues/178 -@test "321: Generate a PDF file using the letter template" { - skip "letter template is deprecated" - $PANDOC --pdf-engine=xelatex --template=letter $IN/letter/letter.md -o $OUT/letter.pdf -} - - -## 33x: Leaflet -@test "331: Generate a PDF brochure using the leaflet template" { - skip "leaflet template is deprecated" - $PANDOC --pdf-engine=xelatex --template=leaflet $IN/leaflet/leaflet.md -o $OUT/leaflet.pdf -} - ## ## 4xx: Fonts, Langages and Special Characters ## @@ -217,25 +203,6 @@ teardown() { ## 5xx: Filters ## -## 51x: pandoc-minted -@test "511: Generate a TEX file using the minted filter" { - skip "minted is deprecated" - DIR=pandoc-minted - $PANDOC $IN/$DIR/minted.md \ - --filter pandoc-minted \ - -o $OUT/$DIR/minted.tex -} - -@test "512: Generate a PDF file using the minted filter" { - skip "minted is deprecated" - DIR=pandoc-minted - $PANDOC $IN/$DIR/minted.md \ - --filter pandoc-minted \ - --pdf-engine=xelatex \ - --pdf-engine-opt=-shell-escape \ - -o $OUT/$DIR/minted.pdf -} - ## 52x: pandoc-include + pandoc-codeblock-include @test "521: Generate a markdown file using the include filter" { DIR=pandoc-include From 2db0ebe387c7bff07550d6f5259954b3591e3a22 Mon Sep 17 00:00:00 2001 From: damien clochard Date: Thu, 16 May 2024 17:10:17 +0200 Subject: [PATCH 4/8] Add the pandoc templates in the ubuntu $HOME --- ubuntu/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ubuntu/Dockerfile b/ubuntu/Dockerfile index 537c7bc..3950177 100644 --- a/ubuntu/Dockerfile +++ b/ubuntu/Dockerfile @@ -130,6 +130,11 @@ RUN tlmgr init-usertree && \ # Templates are installed in '/.pandoc'. ARG TEMPLATES_DIR=/.pandoc/templates +# Starting with 24.04, there's a user named `ubuntu` with id=1000 +# If docker is run with the `--user 1000` option and $HOME for pandoc +# will be `/home/ubuntu` +RUN ln -s /.pandoc /home/ubuntu/.pandoc + # Easy templates ARG EASY_REPO=https://raw.githubusercontent.com/ryangrose/easy-pandoc-templates/ ARG EASY_VERSION=9a884190fe19782f4434851053947173f8cec3d2 From 49f2e4c866f90d7277fd6b3931acf9c4ce6c18fe Mon Sep 17 00:00:00 2001 From: damien clochard Date: Thu, 16 May 2024 17:30:34 +0200 Subject: [PATCH 5/8] use multi-stage build --- .github/workflows/ubuntu.yml | 4 +- ubuntu/Dockerfile => Dockerfile | 65 ++++++++++++++++-- Makefile | 8 +++ ...requirements.full.txt => packages.full.txt | 0 ubuntu-full/Dockerfile | 66 ------------------- 5 files changed, 68 insertions(+), 75 deletions(-) rename ubuntu/Dockerfile => Dockerfile (75%) rename latex_requirements.full.txt => packages.full.txt (100%) delete mode 100644 ubuntu-full/Dockerfile diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index a1843cf..1d4d4fc 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -13,7 +13,7 @@ jobs: run: git submodule update --init --recursive - name: Build the Docker image - run: docker build . --file ubuntu/Dockerfile --tag dalibo/pandocker:xxxxx-test-githubci-ubuntu + run: docker build . --target extra --tag dalibo/pandocker:xxxxx-test-githubci-ubuntu - name: Regression Tests run: TAG=xxxxx-test-githubci-ubuntu VARIANT=ubuntu ./tests/libs/bats-core/bin/bats tests/extra.bats --tap @@ -27,7 +27,7 @@ jobs: run: git submodule update --init --recursive - name: Build the Docker image - run: docker build . --file ubuntu-full/Dockerfile --tag dalibo/pandocker:xxxxx-test-githubci-ubuntu-full + run: docker build . --target full --tag dalibo/pandocker:xxxxx-test-githubci-ubuntu-full - name: Regression Tests run: TAG=xxxxx-test-githubci-ubuntu-full VARIANT=ubuntu-full ./tests/libs/bats-core/bin/bats tests/full.bats --tap diff --git a/ubuntu/Dockerfile b/Dockerfile similarity index 75% rename from ubuntu/Dockerfile rename to Dockerfile index 3950177..443b721 100644 --- a/ubuntu/Dockerfile +++ b/Dockerfile @@ -1,11 +1,7 @@ -# A simple Pandoc machine for pandoc with filters, fonts and the latex bazaar # -# Based on : -# https://github.com/jagregory/pandoc-docker/blob/master/Dockerfile -# https://github.com/geometalab/docker-pandoc/blob/develop/Dockerfile -# https://github.com/vpetersson/docker-pandoc/blob/master/Dockerfile - -FROM pandoc/extra:3.2-ubuntu +# STAGE 1: extra variant +# +FROM pandoc/extra:3.2-ubuntu as extra # Set the env variables to non-interactive ENV DEBIAN_FRONTEND noninteractive @@ -153,3 +149,58 @@ VOLUME /pandoc WORKDIR /pandoc ENTRYPOINT ["pandoc"] + +# +# STAGE 2: full variant +# +FROM extra as full + +# Set the env variables to non-interactive +ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_PRIORITY critical +ENV DEBCONF_NOWARNINGS yes + +# +# Debian +# +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN set -x && \ + apt-get -qq update && \ + apt-get -qy install --no-install-recommends \ + # + texlive-lang-other \ + # hindi fonts + fonts-deva \ + # persian fonts + texlive-lang-arabic \ + fonts-farsiweb \ + # dia + dia \ + # Noto font families with large Unicode coverage + fonts-noto \ + fonts-noto-cjk \ + fonts-noto-cjk-extra \ + fonts-noto-color-emoji \ + fonts-noto-core \ + fonts-noto-extra \ + fonts-noto-mono \ + # clean up + && apt-get clean && \ + rm -rf /var/lib/apt/lists/* /etc/apt/apt.conf.d/01proxy + +## +## L A T E X +## +ADD packages.full.txt ./ +# The TexLive user mode database already set up; no need to run `tlmgr init-tree` +RUN tlmgr install `echo $(grep -v '^#' packages.full.txt )` && \ + # update the font map + updmap-sys + +## +## E N T R Y P O I N T +## +VOLUME /pandoc +WORKDIR /pandoc + +ENTRYPOINT ["pandoc"] diff --git a/Makefile b/Makefile index 0129dd8..228f334 100644 --- a/Makefile +++ b/Makefile @@ -69,6 +69,14 @@ stretch: stretch/Dockerfile --build-arg PANDOC_CROSSREF_VERSION=$(CROSSREF_VERSION) \ --tag $(NAME):$@-$(TAG) --file $^ . +.PHONY: extra +extra: Dockerfile + docker build --tag $(NAME):$@-$(TAG) --file $^ . --target extra + +.PHONY: full +full: Dockerfile + docker build --tag $(NAME):$@-$(TAG) --file $^ . --target full + .PHONY: ubuntu ubuntu: ubuntu/Dockerfile #: Extra variant based on Ubuntu docker build --tag $(NAME):$@-$(TAG) --file $^ . diff --git a/latex_requirements.full.txt b/packages.full.txt similarity index 100% rename from latex_requirements.full.txt rename to packages.full.txt diff --git a/ubuntu-full/Dockerfile b/ubuntu-full/Dockerfile deleted file mode 100644 index 2bca009..0000000 --- a/ubuntu-full/Dockerfile +++ /dev/null @@ -1,66 +0,0 @@ -# This versions extends the buster image with : -# -# * International Fonts -# * Emojis -# https://github.com/vpetersson/docker-pandoc/blob/master/Dockerfile -# -FROM dalibo/pandocker:latest-ubuntu - -# Proxy to APT cacher: e.g. http://apt-cacher-ng.docker:3142 -ARG APT_CACHER - -# Set the env variables to non-interactive -ENV DEBIAN_FRONTEND noninteractive -ENV DEBIAN_PRIORITY critical -ENV DEBCONF_NOWARNINGS yes - -# -# Debian -# -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -RUN set -x && \ - # Setup a cacher to speed up build - if [ -n "${APT_CACHER}" ] ; then \ - echo "Acquire::http::Proxy \"${APT_CACHER}\";" | tee /etc/apt/apt.conf.d/01proxy ; \ - fi; \ - apt-get -qq update && \ - apt-get -qy install --no-install-recommends \ - # - texlive-lang-other \ - # hindi fonts - fonts-deva \ - # persian fonts - texlive-lang-arabic \ - fonts-farsiweb \ - # dia - dia \ - # Noto font families with large Unicode coverage - fonts-noto \ - fonts-noto-cjk \ - fonts-noto-cjk-extra \ - fonts-noto-color-emoji \ - fonts-noto-core \ - fonts-noto-extra \ - fonts-noto-mono \ - # clean up - && apt-get clean && \ - rm -rf /var/lib/apt/lists/* /etc/apt/apt.conf.d/01proxy - -## -## L A T E X -## -ADD latex_requirements.full.txt ./ -# The TexLive user mode database already set up; no need to run `tlmgr init-tree` -RUN tlmgr install `echo $(grep -v '^#' latex_requirements.full.txt )` && \ - # update the font map - updmap-sys - - - -## -## E N T R Y P O I N T -## -VOLUME /pandoc -WORKDIR /pandoc - -ENTRYPOINT ["pandoc"] From aab8f8040dd27d56fbc10c654bf3dac212788607 Mon Sep 17 00:00:00 2001 From: damien clochard Date: Thu, 16 May 2024 15:25:38 +0200 Subject: [PATCH 6/8] Remove obsolete variants --- .github/workflows/alpine.yml | 23 ---- .github/workflows/buster.yml | 33 ----- .github/workflows/stretch.yml | 21 ---- FAQ.md | 37 ------ Makefile | 84 +------------ README.md | 69 +++++++---- alpine/Dockerfile | 129 -------------------- buster-full/Dockerfile | 77 ------------ buster/Dockerfile | 213 --------------------------------- cache/.gitkeep | 0 fetch-pandoc-crossref.sh | 11 -- fetch-pandoc.sh | 7 -- stretch/Dockerfile | 218 ---------------------------------- stretch/README.md | 10 -- 14 files changed, 49 insertions(+), 883 deletions(-) delete mode 100644 .github/workflows/alpine.yml delete mode 100644 .github/workflows/buster.yml delete mode 100644 .github/workflows/stretch.yml delete mode 100644 FAQ.md delete mode 100644 alpine/Dockerfile delete mode 100644 buster-full/Dockerfile delete mode 100644 buster/Dockerfile delete mode 100644 cache/.gitkeep delete mode 100755 fetch-pandoc-crossref.sh delete mode 100755 fetch-pandoc.sh delete mode 100644 stretch/Dockerfile delete mode 100644 stretch/README.md diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml deleted file mode 100644 index fe1315c..0000000 --- a/.github/workflows/alpine.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Alpine Regression Tests - -# disable automatic testing for Alpine until we decide what goes in alpine vs. alpine-full -# on: [push, workflow_dispatch] -on: [workflow_dispatch] - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - - name: Checkout submodules - run: git submodule update --init --recursive - - - name: Build the Docker image - run: docker build . --file alpine/Dockerfile --tag dalibo/pandocker:xxxxx-test-githubci-xxxxx - - - name: Regression Tests - run: TAG=xxxxx-test-githubci-xxxxx VARIANT=alpine ./tests/libs/bats-core/bin/bats tests/extra.bats --tap diff --git a/.github/workflows/buster.yml b/.github/workflows/buster.yml deleted file mode 100644 index 2731db3..0000000 --- a/.github/workflows/buster.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Buster Regression Tests - -on: [workflow_dispatch] - -jobs: - - extra: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - - name: Checkout submodules - run: git submodule update --init --recursive - - - name: Build the Docker image - run: docker build . --file buster/Dockerfile --tag dalibo/pandocker:xxxxx-test-githubci-buster - - - name: Regression Tests - run: TAG=xxxxx-test-githubci-buster VARIANT=buster ./tests/libs/bats-core/bin/bats tests/extra.bats --tap - - full: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - - name: Checkout submodules - run: git submodule update --init --recursive - - - name: Build the Docker image - run: docker build . --file buster-full/Dockerfile --tag dalibo/pandocker:xxxxx-test-githubci-buster-full - - - name: Regression Tests - run: TAG=xxxxx-test-githubci-buster-full VARIANT=buster-full ./tests/libs/bats-core/bin/bats tests/full.bats --tap diff --git a/.github/workflows/stretch.yml b/.github/workflows/stretch.yml deleted file mode 100644 index afad4cd..0000000 --- a/.github/workflows/stretch.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Stretch Image (obsolete) Regression Tests - -on: [workflow_dispatch] - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - - name: Checkout submodules - run: git submodule update --init --recursive - - - name: Build the Docker image - run: docker build . --file stretch/Dockerfile --tag dalibo/pandocker:xxxxx-test-githubci-xxxxx - - - name: Regression Tests - run: TAG=xxxxx-test-githubci-xxxxx VARIANT=stretch ./tests/libs/bats-core/bin/bats tests/extra.bats --tap diff --git a/FAQ.md b/FAQ.md deleted file mode 100644 index b5a2e2c..0000000 --- a/FAQ.md +++ /dev/null @@ -1,37 +0,0 @@ -Frequently Asked Questions -=============================================================================== - - -ERROR: "filename": openBinaryFile: does not exist (No such file or directory) --------------------------------------------------------------------------------- - -When using pandocker, you may encounter the following error message: - -``` -$ docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker foo.md -pandoc: "filename": openBinaryFile: does not exist (No such file or directory) -``` - -This means that docker could not mount the local directory as a volume and -therefore pandoc cannot see the file `foo.md` inside the container. There might -be several reasons for that, here a few ideas to try: - -1. Add `--privileged` option to the pandocker command line. Read more about - this [docker privileged mode] here : - https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities - - -2. Check if you have [SELinux] enforced on you system, with the command below: - -```console -$ sestatus -``` - -If the [SELinux] mode is `enforced`, you can try to lower it to `permissive`. - -More info about [SELinux] here: -https://fedoraproject.org/wiki/SELinux_FAQ - -[SELinux]: https://fedoraproject.org/wiki/SELinux_FAQ -[docker privileged mode]: https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities - diff --git a/Makefile b/Makefile index 228f334..5fc105e 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,3 @@ -## make dalibo/pandocker - -## -## V A R I A B L E S -## # name of the image NAME?=dalibo/pandocker @@ -10,12 +5,6 @@ NAME?=dalibo/pandocker # By default, the tag is the git branch name TAG?=$(shell git branch | grep -e "^*" | cut -d' ' -f 2) -# These versions must be changed together. -# See https://github.com/lierdakil/pandoc-crossref/releases to find the latest -# release corresponding to the desired Pandoc version. -PANDOC_VERSION?=2.17.0.1 -CROSSREF_VERSION?=0.3.12.2 - # Bats # We use bats-core instead of the original bats BATS?=tests/libs/bats-core/bin/bats @@ -41,33 +30,7 @@ endif ## T A R G E T S ## -all: build - - -## -## H E L P -## - -default:: help - -help:: #: Display this message - @echo - @echo "Pandocker Makefile targets" - @echo - @gawk 'match($$0, /([^:]*):.+#'': (.*)/, m) { printf " %-16s%s\n", m[1], m[2]}' $(MAKEFILE_LIST) | sort - @echo - - -.PHONY: build -build: ubuntu - -.PHONY: stretch -stretch: stretch/Dockerfile - docker build \ - --build-arg APT_CACHER=$${APT_CACHER-} \ - --build-arg PANDOC_VERSION=$(PANDOC_VERSION) \ - --build-arg PANDOC_CROSSREF_VERSION=$(CROSSREF_VERSION) \ - --tag $(NAME):$@-$(TAG) --file $^ . +all: extra full .PHONY: extra extra: Dockerfile @@ -77,39 +40,6 @@ extra: Dockerfile full: Dockerfile docker build --tag $(NAME):$@-$(TAG) --file $^ . --target full -.PHONY: ubuntu -ubuntu: ubuntu/Dockerfile #: Extra variant based on Ubuntu - docker build --tag $(NAME):$@-$(TAG) --file $^ . - -.PHONY: ubuntu-full -ubuntu-full: ubuntu-full/Dockerfile #: Full variant - docker build --tag $(NAME):$@-$(TAG) --file $^ . - - -.PHONY: alpine -alpine: alpine/Dockerfile - docker build --tag $(NAME):$@-$(TAG) --file $^ . - -.PHONY: alpine-full -alpine-full: alpine-full/Dockerfile - docker build --tag $(NAME):$@-$(TAG) --file $^ . - -.PHONY: buster -buster: buster/Dockerfile - docker build \ - $(BUILD_OPT) \ - --build-arg PANDOC_VERSION=$(PANDOC_VERSION) \ - --build-arg CROSSREF_VERSION=$(CROSSREF_VERSION) \ - --tag $(NAME):$@-$(TAG) \ - --file $^ . - -.PHONY: buster-full -buster-full: buster-full/Dockerfile - docker build \ - $(BUILD_OPT) \ - --tag $(NAME):$@-$(TAG) \ - --file $^ . - .PHONY: test test: #: use `TEST_ONLY=571 make test` to trigger a single test ! $(BATS) $(BATS_FILTER) tests/extra.bats @@ -125,17 +55,5 @@ clean: find tests/output -type f -and -not -name .keep -delete docker rmi $(NAME):$(TAG) -warm-cache: - ./fetch-pandoc.sh $(PANDOC_VERSION) cache/pandoc.deb - ./fetch-pandoc-crossref.sh $(PANDOC_VERSION) $(PANDOC_CROSSREF_VERSION) cache/pandoc-crossref.tar.gz - pip download --dest cache/ --requirement requirements.txt - -alpine_sh alpine-full_sh: #: enter a docker image (useful for testing) - docker run --rm -it --volume $(PWD):/pandoc --entrypoint=sh $(NAME):$(@:_bash=)-$(TAG) - -buster_bash buster-full_bash: #: enter a docker image (useful for testing) - docker run --rm -it --volume $(PWD):/pandoc --entrypoint=bash $(NAME):$(@:_bash=)-$(TAG) - ubuntu_bash ubuntu-full_bash: #: enter a docker image (useful for testing) docker run --rm -it --volume $(PWD):/pandoc --entrypoint=bash $(NAME):$(@:_bash=)-$(TAG) - diff --git a/README.md b/README.md index 2127fed..0f65e8d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ release](https://img.shields.io/github/release/dalibo/pandocker.svg?label=curren [![CI](https://github.com/dalibo/pandocker/actions/workflows/ubuntu.yml/badge.svg?branch=latest)](https://github.com/dalibo/pandocker/actions/workflows/ubuuntuOA.yml) [![Last Commit](https://img.shields.io/github/last-commit/dalibo/pandocker.svg)](https://github.com/dalibo/pandocker/branches) -A simple docker image for pandoc with [filters], [templates], [fonts] and [additional tools]. +A simple docker image for pandoc with [filters], [templates], [fonts] and +[additional tools]. [filters]: #filters [templates]: #templates @@ -21,14 +22,15 @@ Download the image with: docker pull dalibo/pandocker:stable ``` -Whenever a new stable version is released, launch that command again to refresh your image. +Whenever a new stable version is released, launch that command again to refresh +your image. ## How To Run `dalibo/pandocker` with regular `pandoc` args. Mount your files at `/pandoc`. ```console -$ docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker README.md -o README.pdf +docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker README.md -o README.pdf ``` **Notes about the docker options:** @@ -40,7 +42,6 @@ $ docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker README.md [docker runtime privileges]: https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities - * The `--rm` option destroys the container once the document is produced. This is not mandatory but it's a good practice. @@ -51,14 +52,14 @@ $ docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker README.md > Add this to your `~/.bashrc` : ```console -$ alias pandoc="docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker:stable" -$ pandoc README.md -o README.epub +alias pandoc="docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker:stable" +pandoc README.md -o README.epub ``` Alternatively, you can use a pipe like this: ```console -$ cat foo.md | docker run --rm -i dalibo/pandocker -t pdf > foo.pdf +cat foo.md | docker run --rm -i dalibo/pandocker -t pdf > foo.pdf ``` This method will not work if the source document contains images or includes... @@ -79,7 +80,7 @@ You can use them simply by adding `--template=xxx` to your compilation lines: ``` console -$ docker run [...] --pdf-engine=xelatex --template=eisvogel foo.md -o foo.pdf +docker run [...] --pdf-engine=xelatex --template=eisvogel foo.md -o foo.pdf ``` Each template has specific variables that you can use to adapt the document. @@ -90,9 +91,9 @@ Please go the project page of each template for more details. ## Filters -This docker image embeds a number of usefull pandoc filters. You can simply enable them -by adding the option `--filter xxx` where `xxx` is the name of one of the following -filters below: +This docker image embeds a number of usefull pandoc filters. You can simply +enable them by adding the option `--filter xxx` where `xxx` is the name of +one of the following filters below: * [panda] : Multi-purpose Lua filter * [pandoc-citeproc] : manage bibliographies and citations @@ -111,8 +112,6 @@ filters below: * [pandoc-run-postgres] : Execute SQL queries inside a markdown document * [pandoc-jinja] : Render pandoc metadata inside the document itself - - NOTE: By default when using the [pandoc-include] filter, the path to target files is relative to the `/pandoc` mountpoint. For instance, the `!include [foo/bar.md]` statement will look for a `/pandoc/foo/bar.md` file. @@ -142,14 +141,14 @@ and [pandoc-mustache] filters. The pandocker image includes the following open-source fonts: -* Deja Vu: https://dejavu-fonts.github.io/ -* Lato: https://fonts.google.com/specimen/Lato -* Liberation: https://github.com/liberationfonts/liberation-fonts -* Fontawesome: https://fontawesome.com/ +* Deja Vu: +* Lato: +* Liberation: +* Fontawesome: The full variant includes -* Noto: https://www.google.com/get/noto/ +* Noto: ## Supported Tags : Branch + Variant + Parent @@ -172,12 +171,10 @@ The supported tags are : Other tags are not supported and should be used with care. - ## Build it Use `make` or `docker build .` - ## Additional tools The docker image embeds additional software related to editing and publishing: @@ -194,7 +191,37 @@ These tools can be called by modifying the entrypoint of the image. For instance you can convert a `dia` source file into an SVG image like this: ``` console -$ docker run [..] --entrypoint dia dalibo/pandocker foo.dia -e foo.svg +docker run [..] --entrypoint dia dalibo/pandocker foo.dia -e foo.svg +``` + +### Frequently Asked Question + +### ERROR: "filename": openBinaryFile: does not exist (No such file or directory) + +When using pandocker, you may encounter the following error message: + +``` +$ docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker foo.md +pandoc: "filename": openBinaryFile: does not exist (No such file or directory) ``` +This means that docker could not mount the local directory as a volume and +therefore pandoc cannot see the file `foo.md` inside the container. There might +be several reasons for that, here a few ideas to try: + +1. Add `--privileged` option to the pandocker command line. Read more about + this [docker privileged mode] here : + + +2. Check if you have [SELinux] enforced on you system, with the command below: + +```console +sestatus +``` + +If the [SELinux] mode is `enforced`, you can try to lower it to `permissive`. + +More info about [SELinux] here: +[SELinux]: https://fedoraproject.org/wiki/SELinux_FAQ +[docker privileged mode]: https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities diff --git a/alpine/Dockerfile b/alpine/Dockerfile deleted file mode 100644 index 44009e9..0000000 --- a/alpine/Dockerfile +++ /dev/null @@ -1,129 +0,0 @@ -FROM pandoc/latex:2.17.0.1 - -RUN apk --no-cache add \ - bash \ - py3-pip \ - rsync \ - openssh-client \ - fontconfig \ - ttf-liberation \ - dia \ - librsvg - -RUN tlmgr update --self && \ - tlmgr install \ - # lang-french: https://packages.debian.org/sid/texlive-lang-french - aeguill \ - babel-french \ - bib-fr \ - bibleref-french \ - booktabs-fr \ - droit-fr \ - e-french \ - epslatex-fr \ - frenchmath \ - frletter \ - hyphen-french \ - impnattypo \ - mafr \ - tdsfrmath \ - # lang-european: https://packages.debian.org/sid/texlive-lang-european - babel-dutch \ - hyphen-dutch \ - #lang-german: https://packages.debian.org/sid/texlive-lang-german - babel-german \ - xpatch \ - #lang-spanish: https://packages.debian.org/unstable/texlive-lang-spanish - babel-spanish \ - hyphen-spanish \ - # minted - minted \ - ifplatform \ - etoolbox \ - xstring \ - # template-eisvogel: https://github.com/Wandmalfarbe/pandoc-latex-template#texlive - adjustbox \ - background \ - bidi \ - collectbox \ - csquotes \ - everypage \ - filehook \ - footmisc \ - footnotebackref \ - framed \ - fvextra \ - letltxmacro \ - ly1 \ - mdframed \ - mweights \ - needspace \ - pagecolor \ - sourcecodepro \ - sourcesanspro \ - titling \ - ucharcat \ - ulem \ - unicode-math \ - upquote \ - xecjk \ - xurl \ - zref \ - # template-leaflet - leaflet \ - transparent \ - titlesec \ - # template-letter - wallpaper \ - # fonts - ec \ - cm-super \ - fontawesome5 \ - # misc. - catchfile - - -## -## R E V E A L J S -## - -# pandoc 2.10+ requires revealjs 4.x -ARG REVEALJS_VERSION=4.1.2 -RUN wget https://github.com/hakimel/reveal.js/archive/${REVEALJS_VERSION}.tar.gz -O revealjs.tar.gz && \ - tar -xzvf revealjs.tar.gz && \ - cp -r reveal.js-${REVEALJS_VERSION}/dist / && \ - cp -r reveal.js-${REVEALJS_VERSION}/plugin / - -## -## F I L T E R S -## - -ADD requirements.txt ./ -RUN pip3 --no-cache-dir install -r requirements.txt - -# Templates are installed in '/.pandoc'. -ARG TEMPLATES_DIR=/.pandoc/templates - -RUN mkdir -p ${TEMPLATES_DIR} && \ - # Links for the root user - ln -s /.pandoc /root/.pandoc - -# eisvogel template -ARG EISVOGEL_REPO=https://raw.githubusercontent.com/Wandmalfarbe/pandoc-latex-template -ARG EISVOGEL_VERSION=2.0.0 -RUN wget ${EISVOGEL_REPO}/v${EISVOGEL_VERSION}/eisvogel.tex -O ${TEMPLATES_DIR}/eisvogel.latex - -# letter template -ARG LETTER_REPO=https://raw.githubusercontent.com/aaronwolen/pandoc-letter -ARG LETTER_VERSION=master -RUN wget ${LETTER_REPO}/${LETTER_VERSION}/template-letter.tex -O ${TEMPLATES_DIR}/letter.latex - -# leaflet template -ARG LEAFLET_REPO=https://gitlab.com/daamien/pandoc-leaflet-template/raw -ARG LEAFLET_VERSION=1.0 -RUN wget ${LEAFLET_REPO}/${LEAFLET_VERSION}/leaflet.latex -O ${TEMPLATES_DIR}/leaflet.latex - -VOLUME /pandoc -WORKDIR /pandoc - - diff --git a/buster-full/Dockerfile b/buster-full/Dockerfile deleted file mode 100644 index 2c7215f..0000000 --- a/buster-full/Dockerfile +++ /dev/null @@ -1,77 +0,0 @@ -# This versions extends the buster image with : -# -# * International Fonts -# * Emojis -# https://github.com/vpetersson/docker-pandoc/blob/master/Dockerfile -# -FROM dalibo/pandocker:latest-buster - -# Proxy to APT cacher: e.g. http://apt-cacher-ng.docker:3142 -ARG APT_CACHER - -# Set the env variables to non-interactive -ENV DEBIAN_FRONTEND noninteractive -ENV DEBIAN_PRIORITY critical -ENV DEBCONF_NOWARNINGS yes - -# -# Debian -# -RUN set -x && \ - # Setup a cacher to speed up build - if [ -n "${APT_CACHER}" ] ; then \ - echo "Acquire::http::Proxy \"${APT_CACHER}\";" | tee /etc/apt/apt.conf.d/01proxy ; \ - fi; \ - apt-get -qq update && \ - apt-get -qy install --no-install-recommends \ - # - texlive-lang-other \ - # hindi fonts - fonts-deva \ - # persian fonts - texlive-lang-arabic \ - fonts-farsiweb \ - # dia - dia \ - # Noto font families with large Unicode coverage - fonts-noto \ - fonts-noto-cjk \ - fonts-noto-cjk-extra \ - fonts-noto-color-emoji \ - fonts-noto-core \ - fonts-noto-extra \ - fonts-noto-mono \ - # clean up - && apt-get clean && \ - rm -rf /var/lib/apt/lists/* /etc/apt/apt.conf.d/01proxy - -## -## M I S C -## - -# -# emojis support for latex -# https://github.com/mreq/xelatex-emoji -# -ARG TEXMF=/usr/share/texmf/tex/latex/ -ARG EMOJI_DIR=/tmp/twemoji2 -RUN git clone --single-branch --depth=1 --branch gh-pages https://github.com/twitter/twemoji.git $EMOJI_DIR && \ - # fetch xelatex-emoji - mkdir -p ${TEXMF} && \ - cd ${TEXMF} && \ - git clone --single-branch --branch images https://github.com/daamien/xelatex-emoji.git xelatex-emoji2 && \ - # convert twemoji SVG files into PDF files - cp -r $EMOJI_DIR/2/svg xelatex-emoji2/images && \ - cd xelatex-emoji2/images && \ - ../bin/convert_svgs_to_pdfs ./*.svg && \ - # clean up - rm -f *.svg && \ - rm -fr ${EMOJI_DIR} && \ - # update texlive - cd ${TEXMF} && \ - texhash - -VOLUME /pandoc -WORKDIR /pandoc - -ENTRYPOINT ["pandoc"] diff --git a/buster/Dockerfile b/buster/Dockerfile deleted file mode 100644 index 175e07a..0000000 --- a/buster/Dockerfile +++ /dev/null @@ -1,213 +0,0 @@ -# A simple Pandoc machine for pandoc with filters, fonts and the latex bazaar -# -# Based on : -# https://github.com/jagregory/pandoc-docker/blob/master/Dockerfile -# https://github.com/geometalab/docker-pandoc/blob/develop/Dockerfile -# https://github.com/vpetersson/docker-pandoc/blob/master/Dockerfile - -FROM debian:buster-slim - -# Proxy to APT cacher: e.g. http://apt-cacher-ng.docker:3142 -ARG APT_CACHER - -# Set the env variables to non-interactive -ENV DEBIAN_FRONTEND noninteractive -ENV DEBIAN_PRIORITY critical -ENV DEBCONF_NOWARNINGS yes - -# -# Debian -# -RUN set -x && \ - # Setup a cacher to speed up build - if [ -n "${APT_CACHER}" ] ; then \ - echo "Acquire::http::Proxy \"${APT_CACHER}\";" | tee /etc/apt/apt.conf.d/01proxy ; \ - fi; \ - apt-get -qq update && \ - apt-get -qy install --no-install-recommends \ - # for deployment - openssh-client \ - rsync \ - # for locales and utf-8 support - locales \ - # latex toolchain - ghostscript \ - lmodern \ - texlive \ - texlive-lang-french \ - texlive-lang-german \ - texlive-lang-european \ - texlive-lang-spanish \ - texlive-luatex \ - texlive-pstricks \ - texlive-xetex \ - xzdec \ - # reveal (see issue #18) - netbase \ - # fonts - fonts-dejavu \ - fonts-font-awesome \ - fonts-lato \ - fonts-liberation \ - # build tools - make \ - git \ - parallel \ - wget \ - unzip \ - # panflute requirements - python3-pip \ - python3-setuptools \ - python3-wheel \ - python3-yaml \ - # required for PDF meta analysis - poppler-utils \ - zlibc \ - # svg conversion - librsvg2-bin \ - # clean up - && apt-get clean && \ - rm -rf /var/lib/apt/lists/* /etc/apt/apt.conf.d/01proxy - -# -# Set Locale for UTF-8 support -# This is needed for panflute filters see : -# https://github.com/dalibo/pandocker/pull/86 -# -RUN locale-gen C.UTF-8 -ENV LANG C.UTF-8 - -# -# SSH pre-config / useful for Gitlab CI -# -RUN mkdir -p ~/.ssh && \ - /bin/echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config # See Issue #87 - -# -# Add local cache/. It's empty by default so this does not change the final -# image on Docker Hub. -# -# However, once warmed with make warm-cache, it can save a lots of bandwidth. -# -ADD cache/ ./cache - -# -# Install pandoc from upstream. Debian package is too old. -# -# When incrementing this version, also increment -# PANDOC_CROSSREF_VERSION below. -ARG PANDOC_VERSION=2.17.0.1 -ADD fetch-pandoc.sh /usr/local/bin/ -RUN fetch-pandoc.sh ${PANDOC_VERSION} ./cache/pandoc.deb && \ - dpkg --install ./cache/pandoc.deb && \ - rm -f ./cache/pandoc.deb - -## -## R E V E A L J S -## - -# -# The easiest to produce reveal slides is to point to a CDN like this: -# -# -V revealjs-url=https://unpkg.com/reveal.js -# -# However it's useful to have revealjs inside pandocker when you want -# to build offline -# - -# pandoc 2.10+ requires revealjs 4.x -ARG REVEALJS_VERSION=4.1.2 -RUN wget https://github.com/hakimel/reveal.js/archive/${REVEALJS_VERSION}.tar.gz -O revealjs.tar.gz && \ - tar -xzvf revealjs.tar.gz && \ - cp -r reveal.js-${REVEALJS_VERSION}/dist / && \ - cp -r reveal.js-${REVEALJS_VERSION}/plugin / - - -## -## F I L T E R S -## - -# -# Python filters -# -ADD requirements.txt ./ -RUN pip3 --no-cache-dir install --find-links file://${PWD}/cache -r requirements.txt - -# -# pandoc-crossref -# -# This version must correspond to the correct PANDOC_VERSION. -# See https://github.com/lierdakil/pandoc-crossref/releases to find the latest -# release corresponding to the desired pandoc version. -ARG CROSSREF_REPO=https://github.com/lierdakil/pandoc-crossref/releases/download/ -ARG CROSSREF_VERSION=0.3.12.2 -RUN wget ${CROSSREF_REPO}/v${CROSSREF_VERSION}/pandoc-crossref-Linux.tar.xz -O /tmp/pandoc-crossref.tar.xz && \ - tar xf /tmp/pandoc-crossref.tar.xz && \ - install pandoc-crossref /usr/local/bin/ && \ - install -d /usr/local/man/man1 && \ - install pandoc-crossref.1 /usr/local/man/man1/ - -## -## T E M P L A T E S -## - -# If docker is run with the `--user` option, the $HOME var -# is empty when the user does not exist inside the container. -# This causes several problems for pandoc and xelatex/pdftex. -# We solve the issue by putting the pandoc templates and the -# latex packages in shared spaces (TEXMFLOCAL, TEMPLATES_DIR) -# and creating symbolic links inside the `/root` home so that -# the templates and packages can be accessed by root and a -# non-existent `--user` -# -# See Bug #110 : https://github.com/dalibo/pandocker/issues/110 -# - -# CTAM packages are installed in the system-wide latex tree -# See `kpsewhich -var-value=TEXMFLOCAL` -ENV TEXMFLOCAL=/usr/local/share/texmf - -# Templates are installed in '/.pandoc'. -ARG TEMPLATES_DIR=/.pandoc/templates - -RUN mkdir -p ${TEMPLATES_DIR} && \ - mkdir /.texlive2016 && \ - # Links for the non-existent - ln -s ${TEXMFLOCAL} /texmf && \ - # Links for the root user - ln -s /.pandoc /root/.pandoc && \ - ln -s ${TEXMFLOCAL} /root/texmf && \ - ln -s /.texlive2016 /root/.texlive2016 - -# eisvogel template -ARG EISVOGEL_REPO=https://raw.githubusercontent.com/Wandmalfarbe/pandoc-latex-template -ARG EISVOGEL_VERSION=2.0.0 -RUN wget ${EISVOGEL_REPO}/v${EISVOGEL_VERSION}/eisvogel.tex -O ${TEMPLATES_DIR}/eisvogel.latex -RUN tlmgr init-usertree && \ - # Debian/buster comes with TL2018, and thus refuses to work with the 2020 repositories, even in self mode - tlmgr option repository ftp://tug.org/historic/systems/texlive/2018/tlnet-final && \ - tlmgr install fontawesome5 awesomebox ly1 inconsolata sourcesanspro sourcecodepro mweights || \ - # This first call returns an error but the packages are installed, - # we call it again to check that everything is fine - tlmgr install fontawesome5 awesomebox ly1 inconsolata sourcesanspro sourcecodepro mweights && \ - # update the font map - updmap-sys - -# letter template -ARG LETTER_REPO=https://raw.githubusercontent.com/aaronwolen/pandoc-letter -ARG LETTER_VERSION=master -RUN wget ${LETTER_REPO}/${LETTER_VERSION}/template-letter.tex -O ${TEMPLATES_DIR}/letter.latex - -# leaflet template -ARG LEAFLET_REPO=https://gitlab.com/daamien/pandoc-leaflet-template/raw -ARG LEAFLET_VERSION=1.0 -RUN wget ${LEAFLET_REPO}/${LEAFLET_VERSION}/leaflet.latex -O ${TEMPLATES_DIR}/leaflet.latex - - -## -## E N D -## -VOLUME /pandoc -WORKDIR /pandoc - -ENTRYPOINT ["pandoc"] diff --git a/cache/.gitkeep b/cache/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/fetch-pandoc-crossref.sh b/fetch-pandoc-crossref.sh deleted file mode 100755 index 5993b6f..0000000 --- a/fetch-pandoc-crossref.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -eux - -PANDOC_VERSION=$1 -# pandoc-crossref's binaries ship with the pandoc version in the artifact, underscores instead of periods -CROSSREF_PANDOC_VERSION_ID="$(echo "${PANDOC_VERSION}" | tr '.' '_')" -PANDOC_CROSSREF_VERSION=$2 -DEST=${3-pandoc_crossref.tar.gz} -#URL=https://github.com/lierdakil/pandoc-crossref/releases/download/v${PANDOC_CROSSREF_VERSION}/linux-pandoc_${CROSSREF_PANDOC_VERSION_ID}.tar.gz -URL=https://github.com/lierdakil/pandoc-crossref/releases/download/v${PANDOC_CROSSREF_VERSION}/pandoc-crossref-Linux.tar.xz - -exec wget --continue --timestamping --output-document ${DEST} ${URL} diff --git a/fetch-pandoc.sh b/fetch-pandoc.sh deleted file mode 100755 index ce129f9..0000000 --- a/fetch-pandoc.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -eux - -PANDOC_VERSION=$1 -DEST=${2-pandoc.deb} -URL=https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-1-amd64.deb - -exec wget --continue --timestamping --output-document ${DEST} ${URL} diff --git a/stretch/Dockerfile b/stretch/Dockerfile deleted file mode 100644 index 4b6d8af..0000000 --- a/stretch/Dockerfile +++ /dev/null @@ -1,218 +0,0 @@ -# A simple Pandoc machine for pandoc with filters, fonts and the latex bazaar -# -# Based on : -# https://github.com/jagregory/pandoc-docker/blob/master/Dockerfile -# https://github.com/geometalab/docker-pandoc/blob/develop/Dockerfile -# https://github.com/vpetersson/docker-pandoc/blob/master/Dockerfile - -FROM debian:stretch-slim - -# Proxy to APT cacher: e.g. http://apt-cacher-ng.docker:3142 -ARG APT_CACHER - -# Set the env variables to non-interactive -ENV DEBIAN_FRONTEND noninteractive -ENV DEBIAN_PRIORITY critical -ENV DEBCONF_NOWARNINGS yes - -# -# Debian -# -RUN set -x && \ - # Setup a cacher to speed up build - if [ -n "${APT_CACHER}" ] ; then \ - echo "Acquire::http::Proxy \"${APT_CACHER}\";" | tee /etc/apt/apt.conf.d/01proxy ; \ - fi; \ - apt-get -qq update && \ - apt-get -qy install --no-install-recommends \ - # for deployment - openssh-client \ - rsync \ - # for locales and utf-8 support - locales \ - # latex toolchain - lmodern \ - texlive \ - texlive-lang-arabic \ - texlive-lang-french \ - texlive-lang-german \ - texlive-lang-european \ - texlive-luatex \ - texlive-pstricks \ - texlive-xetex \ - xzdec \ - # reveal (see issue #18) - netbase \ - # dia - dia \ - # fonts - fonts-font-awesome \ - fonts-dejavu \ - fonts-lato \ - fonts-liberation \ -# fonts-noto \ # /!\ noto = 63Mo - # build tools - make \ - git \ - parallel \ - wget \ - unzip \ - # panflute requirements - python3-pip \ - python3-setuptools \ - python3-wheel \ - python3-yaml \ - # required for PDF meta analysis - poppler-utils \ - zlibc \ - # for emojis and SVG conversion - librsvg2-bin \ - # clean up - && apt-get clean && \ - rm -rf /var/lib/apt/lists/* /etc/apt/apt.conf.d/01proxy - -# -# Set Locale for UTF-8 support -# This is needed for panflute filters see : -# https://github.com/dalibo/pandocker/pull/86 -# -RUN locale-gen C.UTF-8 -ENV LANG C.UTF-8 - -# -# SSH pre-config / useful for Gitlab CI -# -RUN mkdir -p ~/.ssh && \ - /bin/echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config # See Issue #87 - -# -# Add local cache/. It's empty by default so this does not change the final -# image on Docker Hub. -# -# However, once warmed with make warm-cache, it can save a lots of bandwidth. -# -ADD cache/ ./cache - -# -# Install pandoc from upstream. Debian package is too old. -# -# When incrementing this version, also increment -# PANDOC_CROSSREF_VERSION below. -ARG PANDOC_VERSION=2.9.1 -ADD fetch-pandoc.sh /usr/local/bin/ -RUN fetch-pandoc.sh ${PANDOC_VERSION} ./cache/pandoc.deb && \ - dpkg --install ./cache/pandoc.deb && \ - rm -f ./cache/pandoc.deb - -## -## F I L T E R S -## - -# -# Python filters -# -ADD requirements.txt ./ -RUN pip3 --no-cache-dir install --find-links file://${PWD}/cache -r requirements.txt - -# -# pandoc-crossref -# -# This version must correspond to the correct PANDOC_VERSION. -# See https://github.com/lierdakil/pandoc-crossref/releases to find the latest -# release corresponding to the desired pandoc version. -ARG PANDOC_CROSSREF_VERSION=0.3.6.1a -ADD fetch-pandoc-crossref.sh /usr/local/bin/ -RUN fetch-pandoc-crossref.sh ${PANDOC_VERSION} ${PANDOC_CROSSREF_VERSION} ./cache/pandoc-crossref.tar.gz && \ - tar xf ./cache/pandoc-crossref.tar.gz && \ - install pandoc-crossref /usr/local/bin/ && \ - install -d /usr/local/man/man1 && \ - install pandoc-crossref.1 /usr/local/man/man1/ - -## -## T E M P L A T E S -## - -# kpsewhich -var-value=TEXMFLOCAL -ARG TEXMFLOCAL=/usr/local/share/texmf - -# If docker is run with the `--user` option, the $HOME var -# is empty when the user does not exist inside the container. -# This causes several problems for pandoc and xelatex/pdftex. -# We solve the issue by putting the pandoc templates and the -# latex packages in shared spaces (TEXMFLOCAL, TEMPLATES_DIR) -# and creating symbolic links inside the `/root` home so that -# the templates and packages can be accessed by root and a -# non-existent `--user` -# -# See Bug #110 : https://github.com/dalibo/pandocker/issues/110 -# - -# CTAM packages are installed in the system-wide latex tree -# See `kpsewhich -var-value=TEXMFLOCAL` -ENV TEXMFLOCAL=/usr/local/share/texmf - -# Templates are installed in '/.pandoc'. -ARG TEMPLATES_DIR=/.pandoc/templates - -RUN mkdir -p ${TEMPLATES_DIR} && \ - mkdir /.texlive2016 && \ - # Links for the non-existent - ln -s ${TEXMFLOCAL} /texmf && \ - # Links for the root user - ln -s /.pandoc /root/.pandoc && \ - ln -s ${TEXMFLOCAL} /root/texmf && \ - ln -s /.texlive2016 /root/.texlive2016 - -# eisvogel template -ARG EISVOGEL_REPO=https://raw.githubusercontent.com/Wandmalfarbe/pandoc-latex-template -ARG EISVOGEL_VERSION=v1.4.0 -RUN wget ${EISVOGEL_REPO}/${EISVOGEL_VERSION}/eisvogel.tex -O ${TEMPLATES_DIR}/eisvogel.latex -RUN tlmgr init-usertree && \ - tlmgr install awesomebox fontawesome ly1 inconsolata sourcesanspro sourcecodepro mweights && \ - # fixup: download awesome-compat - # this may not be requitred with debian buster - # see: https://github.com/Wandmalfarbe/pandoc-latex-template/issues/154#issuecomment-586620431 - wget https://raw.githubusercontent.com/milouse/latex-awesomebox/master/awesomebox-compat.sty \ - -O ${TEXMFLOCAL}/tex/latex/awesomebox/awesomebox-compat.sty - -# letter template -ARG LETTER_REPO=https://raw.githubusercontent.com/aaronwolen/pandoc-letter -ARG LETTER_VERSION=master -RUN wget ${LETTER_REPO}/${LETTER_VERSION}/template-letter.tex -O ${TEMPLATES_DIR}/letter.latex - -# leaflet template -ARG LEAFLET_REPO=https://gitlab.com/daamien/pandoc-leaflet-template/raw -ARG LEAFLET_VERSION=1.0 -RUN wget ${LEAFLET_REPO}/${LEAFLET_VERSION}/leaflet.latex -O ${TEMPLATES_DIR}/leaflet.latex - - -## -## M I S C -## - -# -# emojis support for latex -# https://github.com/mreq/xelatex-emoji -# -ARG TEXMF=/usr/share/texmf/tex/latex/ -ARG EMOJI_DIR=/tmp/twemoji -RUN git clone --single-branch --depth=1 --branch gh-pages https://github.com/twitter/twemoji.git $EMOJI_DIR && \ - # fetch xelatex-emoji - mkdir -p ${TEXMF} && \ - cd ${TEXMF} && \ - git clone --single-branch --branch images https://github.com/daamien/xelatex-emoji.git && \ - # convert twemoji SVG files into PDF files - cp -r $EMOJI_DIR/2/svg xelatex-emoji/images && \ - cd xelatex-emoji/images && \ - ../bin/convert_svgs_to_pdfs ./*.svg && \ - # clean up - rm -f *.svg && \ - rm -fr ${EMOJI_DIR} && \ - # update texlive - cd ${TEXMF} && \ - texhash - -VOLUME /pandoc -WORKDIR /pandoc - -ENTRYPOINT ["pandoc"] diff --git a/stretch/README.md b/stretch/README.md deleted file mode 100644 index d1dc164..0000000 --- a/stretch/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# The stretch version of pandocker is obsolete - -From version 17.12 to 20.02, pandocker used debian stretch -as its foundation. - -This variant is now obsolete and kept here as an archive. - -As of version 21.02, we do not provide support for this -version anymore. - From 7dd10954fa11308e6a878cadeb92e7dff2ad61a6 Mon Sep 17 00:00:00 2001 From: damien clochard Date: Thu, 16 May 2024 22:05:11 +0200 Subject: [PATCH 7/8] Merge the release procedure into the CONTRIBUTING doc --- CONTRIBUTING.md | 19 +++++++++++++++++++ RELEASING.md | 18 ------------------ 2 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 RELEASING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 49baa17..08e8687 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,3 +43,22 @@ project and the interests of all those who contribute or benefit from it. As an open source project, we consider that we must maintain this information in the repository for archiving purposes in the public interest. +How To Release a new version +------------------------------------------------------------------------------- + +* [ ] Close all open ticket on the current milestone +* [ ] Create a `release` branch +* [ ] Update the [CHANGELOG.md]() +* [ ] Write a announcement in [NEWS.md]() +* [ ] Merge the `release` branch into `latest` +* [ ] Add a tag to `latest` +* [ ] Create a new [release] +* [ ] Rebase the `stable` branche from `latest` +* [ ] Wait for docker hub to rebuild the images +* [ ] Create the next milestone +* [ ] Bump the new version on `latest` +* [ ] Publish the announcement +* [ ] Bump to the new version in [CHANGELOG.md]() +* [ ] Close the current milestone + +[release]: https://github.com/dalibo/pandocker/releases diff --git a/RELEASING.md b/RELEASING.md deleted file mode 100644 index b60c70e..0000000 --- a/RELEASING.md +++ /dev/null @@ -1,18 +0,0 @@ -# How To Release a new version - -* [ ] Close all open ticket on the current milestone -* [ ] Create a `release` branch -* [ ] Update the [CHANGELOG.md]() -* [ ] Write a announcement in [NEWS.md]() -* [ ] Merge the `release` branch into `latest` -* [ ] Add a tag to `latest` -* [ ] Create a new [release] -* [ ] Rebase the `stable` branche from `latest` -* [ ] Wait for docker hub to rebuild the images -* [ ] Create the next milestone -* [ ] Bump the new version on `latest` -* [ ] Publish the announcement -* [ ] Bump to the new version in [CHANGELOG.md]() -* [ ] Close the current milestone - -[release]: https://github.com/dalibo/pandocker/releases From 4fab814760a4006a387e697c34f353626c4979c2 Mon Sep 17 00:00:00 2001 From: damien clochard Date: Thu, 16 May 2024 09:59:30 +0000 Subject: [PATCH 8/8] Update python filters --- requirements.txt | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/requirements.txt b/requirements.txt index d07fa70..bcad3b5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,34 +1,34 @@ -# https://github.com/daamien/pandoc-cover/releases +# https://github.com/daamien/pandoc-cover/releases/latest pandoc-cover==0.2.1 -# https://github.com/chdemko/pandoc-codeblock-include/releases +# https://github.com/chdemko/pandoc-codeblock-include/releases/latest # pandoc-codeblock-include==0.1 # https://github.com/DCsunset/pandoc-include/releases/latest -pandoc-include==1.2 +pandoc-include==1.3.2 # https://github.com/daamien/pandoc-jinja/releases -pandoc-jinja==0.2.2 +pandoc-jinja==0.2.4 # https://github.com/chdemko/pandoc-latex-admonition/releases/latest -pandoc-latex-admonition==1.3.2 +pandoc-latex-admonition==1.3.3.2 # https://github.com/chdemko/pandoc-latex-color/releases/latest -pandoc-latex-color==0.2.1 +pandoc-latex-color==1.0.0.3 # https://github.com/chdemko/pandoc-latex-fontsize/releases/latest -pandoc-latex-fontsize==1.1.3 +pandoc-latex-fontsize==1.1.3.3 # https://github.com/daamien/pandoc-latex-barcode/tags/ pandoc-latex-barcode==1.1.1 # https://github.com/daamien/pandoc-latex-levelup/tags pandoc-latex-levelup==1.1 # https://github.com/chdemko/pandoc-latex-margin/tags -pandoc-latex-margin==0.1.1 +pandoc-latex-margin==1.0.0.3 # https://github.com/chdemko/pandoc-latex-newpage/tags -pandoc-latex-newpage==0.2 -# https://github.com/nick-ulle/pandoc-minted -#pandoc-minted==0.2 -# https://github.com/michaelstepner/pandoc-mustache/releases/tag/0.1.0 +pandoc-latex-newpage==1.0.0.3 +# https://github.com/michaelstepner/pandoc-mustache/releases/latest pandoc-mustache==0.1 -# https://github.com/daamien/pandoc-run-postgres/releases +# https://github.com/daamien/pandoc-run-postgres/releases/latest pandoc-run-postgres==0.0.4 # https://pypdf2.readthedocs.io/en/latest/meta/CHANGELOG.html PyPDF2==2.11 # https://pygments.org/docs/changelog/ Pygments==2.15.0 -# https://github.com/sarnold/pystache/releases +# https://github.com/sarnold/pystache/releases/latest pystache==0.6 +# https://github.com/daamien/pandoc-recap/releases/latest +pandoc-recap==0.0.2