Skip to content

Commit

Permalink
Merge pull request #277 from dalibo/276-upgrade-to-pandoc-32
Browse files Browse the repository at this point in the history
Update to pandoc 3.2
  • Loading branch information
daamien authored May 17, 2024
2 parents 14a81ba + 4fab814 commit 70e88da
Show file tree
Hide file tree
Showing 23 changed files with 173 additions and 1,059 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/alpine.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/buster.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/stretch.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
89 changes: 66 additions & 23 deletions ubuntu/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +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

# switch to 2.20-ubuntu when released
# https://hub.docker.com/r/pandoc/extra/tags
FROM pandoc/extra:edge-ubuntu
# STAGE 1: extra variant
#
FROM pandoc/extra:3.2-ubuntu as extra

# Set the env variables to non-interactive
ENV DEBIAN_FRONTEND noninteractive
Expand Down Expand Up @@ -99,8 +93,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
Expand All @@ -126,22 +123,13 @@ 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
# 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/
Expand All @@ -161,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"]
37 changes: 0 additions & 37 deletions FAQ.md

This file was deleted.

88 changes: 7 additions & 81 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
## make dalibo/pandocker

##
## V A R I A B L E S
##

# name of the image
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
Expand All @@ -41,66 +30,15 @@ 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
all: extra full

.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 $^ .
.PHONY: extra
extra: Dockerfile
docker build --tag $(NAME):$@-$(TAG) --file $^ . --target extra

.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: full
full: Dockerfile
docker build --tag $(NAME):$@-$(TAG) --file $^ . --target full

.PHONY: test
test: #: use `TEST_ONLY=571 make test` to trigger a single test !
Expand All @@ -117,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)

Loading

0 comments on commit 70e88da

Please sign in to comment.