Giter Site home page Giter Site logo

goffinet / docker-pandoc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tewarid/docker-pandoc

0.0 1.0 0.0 5.04 MB

Docker image with Pandoc, TeX packages to use the eisvogel template, Node.js, and mermaid-filter.

License: MIT License

Dockerfile 100.00%

docker-pandoc's Introduction

Pandoc Dockerfile

Docker Cloud Build Status

Creates a Docker image with Pandoc, TeX packages to run the eisvogel template, Node.js, and mermaid-filter.

Pull image from Docker

To fetch the latest automated build image from Docker Hub

docker pull tewarid/pandoc

This pulls the latest tag built from main branch and may not always be stable, hence it is recommended you pull a stable tag

docker pull tewarid/pandoc:latest

Stable versions are tagged manually from latest and pushed to Docker Hub

docker tag tewarid/pandoc:latest tewarid/pandoc:1.0
docker push tewarid/pandoc:1.0

Build Docker image

To build a new image

docker build -t tewarid/pandoc:latest .

Run Pandoc

Assuming you have a bash script run-pandoc.sh on the host such as

#!/bin/sh
pandoc title.md doc.md -f markdown -o doc.pdf --toc -F mermaid-filter --template ./eisvogel.tex --variable titlepage=true --variable caption-justification=centering

Here's how you can invoke it in a Docker container

docker run -v `pwd`:/workdir -w /workdir -i -t --name pandoc-container --entrypoint "/workdir/run-pandoc.sh" tewarid/pandoc:1.0

On Windows, an equivalent PowerShell command may look like

docker run -i -t -v ${PWD}:/workdir -w /workdir --name pandoc-container --entrypoint "/bin/sh ./run-pandoc.sh" tewarid/pandoc:1.0

To run the same script again

docker start -a -i pandoc-container

Remove the container when no longer needed

docker rm pandoc-container

Known Issues

  1. You will get an error message such as the following with mermaid-filter

    events.js:292
        throw er; // Unhandled 'error' event
        ^
    
    Error: ENOENT: no such file or directory, open '/tmp/tmp-11UOaQJNu37LGm.tmp.png'
    Emitted 'error' event on ReadStream instance at:
        at internal/fs/streams.js:136:12
        at FSReqCallback.oncomplete (fs.js:156:23) {
    errno: -2,
    code: 'ENOENT',
    syscall: 'open',
    path: '/tmp/tmp-11UOaQJNu37LGm.tmp.png'
    }
    Error running filter mermaid-filter:
    Filter returned error status 1
    

    To fix it, create a file called .puppeteer.json in the directory you run pandoc, that contains

    {
        "executablePath": "/usr/bin/chromium-browser",
        "args": ["--no-sandbox"]
    }

docker-pandoc's People

Contributors

tewarid avatar

Watchers

James Cloos 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.