Sign inSign up

opendatacoder/markdown

By opendatacoder

โ€ขUpdated over 6 years ago

Docker image that takes a markdown document as input and outputs a pdf

Image
0

280

opendatacoder/markdown repository overview

โ ๐Ÿ“ฐ markdown-converter

mit license github build status repository size python version docker build

A tool to convert markdown with help of pandoc and LaTeX to pdf

Write markdown and convert it to pdf

This tool downloads all images from any online markdown repository and converts it with help of pandoc and LaTeX into a beautiful pdf. There is also an image converter integrated to convert anmimated gif or svg images into a png image. All together this tool turns text, images, links as well as emojies ๐Ÿš€ into a pdf file.

You can choose to build the markdown converter or to run the docker container

โ ๐Ÿ“ฆ Docker Hub

Make use of the pre build docker image

docker pull opendatacoder/markdown

โ ๐Ÿ“ฆ Docker Usage

docker run --rm -v /home/ubuntu/:/app/output markdown --format md --output readme --input \
https://raw.githubusercontent.com/p3t3r67x0/markdown-converter/master/README.md

โ ๐Ÿงฑ Local Docker Setup

To run the docker container have a look at Docker Usage section

docker build -t markdown .

โ ๐Ÿงฑ Local Build Setup

# install build dependencies on debian or ubuntu
sudo apt install virtualenv python3.7 python3.7-dev \
pandoc gir1.2-rsvg-2.0 libcairo2-dev libgirepository1.0-dev \
python3-cairo python-gi-cairo python3-gi texlive-full

# create a virtualenv
virtualenv -p /usr/bin/python3.7 venv

# activate virtualenv
. venv/bin/activate

# install dependencies
pip3 install -r requirements.txt

โ ๐Ÿงฑ Local Usage

Here you have a few usage examples which you can try as well on the Docker container

โ ๐Ÿงพ Convert markdown to LaTeX and PDF

HINT: You can choose between different --format options like md or gfm and html.

Fetch all assets from a remote url and convert a markdown into a LaTeX file and render a pdf.

./convert.py --format md --output readme --input \
https://raw.githubusercontent.com/p3t3r67x0/markdown-converter/master/README.md
โ ๐Ÿงพ Convert markdown to LaTeX

Use the --dry flag to not render a pdf file but convert the markdown into a LaTeX file with all fetched assets.

./convert.py --format md --output readme --dry --input \
https://raw.githubusercontent.com/p3t3r67x0/markdown-converter/master/README.md

Tag summary

Content type

Image

Digest

Size

2 GB

Last updated

over 6 years ago

docker pull opendatacoder/markdown