GithubHelp home page GithubHelp logo

tioachan / mdtopdf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from p1ass/mdtopdf

0.0 0.0 0.0 1.18 MB

๐Ÿณ Pandoc docker image for converting markdown to PDF using TeX typesetting

License: MIT License

Dockerfile 30.45% Shell 47.25% TeX 22.30%

mdtopdf's Introduction

mdtopdf ๐Ÿณ

mdtopdf is the pandoc docker image for converting markdown to PDF using TeX typesetting.

Examples

You can see example markdown file and converted PDF file from the link below๐Ÿ‘‡

example markdown

example converted PDF

Top Image

Getting Started

  1. Pull docker image.
$ docker pull plass/mdtopdf

โš ๏ธ This docker image size is 1.68GB. I recommend pulling it using the fast Internet connection.

  1. Generate PDF file.
$ docker run -it --rm -v "`pwd`":/workdir plass/mdtopdf mdtopdf INPUT.md

Windows (PowerShell) : Replace `pwd` to ${pwd}
fish shell : Replace `pwd` to (pwd)

Advanced Usages

Generate PDF file on save

$ docker run -it --rm -v "`pwd`":/workdir  plass/mdtopdf w-mdtopdf INPUT.md

Set alias

You can decrease typing using alias command as below,

$ echo "alias mdtopdf='docker run -it --rm -v "`pwd`":/workdir plass/mdtopdf mdtopdf'" >> ~/.bash_profile
$ echo "alias w-mdtopdf='docker run -it --rm -v "`pwd`":/workdir  plass/mdtopdf  w-mdtopdf'" >> ~/.bash_profile
$ source ~/.bash_profile
 
$ mdtopdf INPUT.md
$ w-mdtopdf INPUT.md

zsh : Modify .zshrc instead of .bash_profile.
Ubuntu : Modify .bashrc instead of .bash_profile.

If you're using Docker for Windows, setting alias is a bit tricky. Use following command.

> echo 'Function mdtopdf {Param($file) docker run -it --rm -v ${pwd}:/workdir plass/mdtopdf mdtopdf $(Get-ChildItem $file -Name)}' >> $PROFILE
> echo 'Function mdtopdf {Param($file) docker run -it --rm -v ${pwd}:/workdir plass/mdtopdf w-mdtopdf $(Get-ChildItem $file -Name)}' >> $PROFILE
> . $PROFILE
> mdtopdf INPUT.md
> w-mdtopdf INPUT.md

Generate tex file from markdown

$ docker run -it --rm -v "`pwd`":/workdir  plass/mdtopdf mdtotex INPUT.md

Generate html file from markdown

$ docker run -it --rm -v "`pwd`":/workdir  plass/mdtopdf mdtohtml INPUT.md

example converted HTML

Generate docx file from markdown

$ docker run -it --rm -v "`pwd`":/workdir  plass/mdtopdf mdtodocx INPUT.md

example converted docx

mdtopdf's People

Contributors

dora1998 avatar honai avatar p1ass avatar tioachan avatar wt-l00 avatar ysaito8015 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.