Code to PDF converter using vim + wkhtmltopdf
1.3K
Code to PDF converter using vim + wkhtmltopdf
Source code is available at GitHub.
Convert source codes to PDF files with vim + wkhtmltopdf
This docker image is inspired by ソースコードをPDF化する(2022年版, Vimユーザ向け) (Japanese page) and is based on docker-wkhtmltopdf.
docker pull pman0214/code2pdf
Default WORKDIR is /app.
Note that -t option is MANDATORY to use vim.
Default operation is convert all the files in the current directory.
docker run -t --rm -v $PWD:/app pman0214/code2pdf
You can explicitly call code2pdf command.
docker run -t --rm -v $PWD:/app pman0214/code2pdf code2pdf *.java
You can specify output directory with the -o option. But remember, path have to be inside a docker container.
mkdir out
docker run -t --rm -v $PWD:/app -w /app/src pman0214/code2pdf code2pdf -o ../out/ *.java
If you want to build this image by yourself, please prepare for a multi-architecture builder referring to the official documents.
docker run --privileged --rm tonistiigi/binfmt --uninstall "qemu-*"
docker run --privileged --rm tonistiigi/binfmt --install all
docker buildx create --name multiarch --driver docker-container
docker buildx use multiarch
docker buildx inspect --bootstrap
In this example, multiarch is the name of the multi-architecture builder.
You can build this image with your own multi-architecture builder.
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t "code2pdf" \
. --load
--push option instead of --load with appropriate tag pushes built images to GitHub.
All the source files are released under the MIT license.
See LICENSE.
Copyright (c) 2022, Shigemi ISHIDA
shirotelin colorscheme is released under the MIT license.
Copyright (c) 2019 yasukotelin
Cica font is released under the SIL Open Font License 1.1.
Copyright (c) 2018, Takahiro Minami (https://tmnm.tech), with Reserved Font Name Cica.
Content type
Image
Digest
sha256:93a68c40d…
Size
79.2 MB
Last updated
almost 3 years ago
docker pull pman0214/code2pdf