A tool to convert markdown with help of pandoc and LaTeX 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
Make use of the pre build docker image
docker pull opendatacoder/markdown
docker run --rm -v $PWD:/home/latex/data/output opendatacoder/markdown --format md \
--output readme --input https://raw.githubusercontent.com/repository/project/README.md
In case you want to access the container you can run this command
docker run --rm -it --entrypoint /bin/bash opendatacoder/markdown
To run the docker container have a look at Docker Usage section
docker build -t markdown .
# 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
Here you have a few usage examples which you can try as well on the Docker container
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/repository/project/README.md
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/repository/project/README.md