Coder Social home page Coder Social logo

rueshyna / pandocker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dalibo/pandocker

0.0 0.0 0.0 1.52 MB

๐Ÿณ A simple docker image for pandoc with filters, templates, fonts, and the latex bazaar

Home Page: https://hub.docker.com/r/dalibo/pandocker/

License: BSD 3-Clause "New" or "Revised" License

Makefile 4.73% Shell 33.62% TeX 14.68% Dockerfile 41.83% HTML 5.15%

pandocker's Introduction

pandocker

github release Docker Image CI License Last Commit

A simple docker image for pandoc with filters, templates, fonts and additional tools.

How To

Run dalibo/pandocker with regular pandoc args. Mount your files at /pandoc.

$ docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker README.md -o README.pdf

Notes about the docker options:

  • The -v ... option will mount the current folder as the /pandoc directory inside the container. If SELinux is enabled on your system, you might need to add the --privileged tag to force access to the mouting points. For more details, read the documentation about docker runtime privileges.
  • The --rm option destroys the container once the document is produced. This is not mandatory but it's a good practice.

  • The -u option ensures that the output files will belong to you. Again this is not necessary but it's useful.

Tip: You can define a shell alias to use pandocker just like pandoc. Add this to your ~/.bashrc :

$ alias pandoc="docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker"
$ pandoc README.md -o README.epub

Alternatively, you can use a pipe like this:

$ 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...

Templates

We're shipping a selection of latex templates inside the image so that you can produce nice PDF documents without installing anything.

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.
  • leaflet creates simple 3-fold brochures. Works only with xelatex
  • letter is for writing letters in markdown. Works only with xelatex

You can use them simply by adding --template=xxx to your compilation lines:

$ 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. 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:

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. You can use the docker arg --workdir="some/place/elsewhere" to specify another location. The same principle applies to the pandoc-codeblock-include and pandoc-mustache filters.

Fonts

The pandocker image includes the following open-source fonts:

Supported Tags

You can use 3 different versions of this machine with the following tags:

  • latest: this is the default
  • latest-alpine : the latest version, based on alpine
  • stable or 20.02: for production

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:

  • dia a simple tool to design diagrams
  • poppler-utils a collection of tools built to manage PDF and extract content
  • rsync for deployment

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:

$ docker run [..] --entrypoint dia dalibo/pandocker foo.dia -e foo.svg

pandocker's People

Contributors

daamien avatar bersace avatar colindean avatar krysztophe avatar julmon avatar bjarkt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.