Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/p1ass/mdtopdf
๐ณ Pandoc docker image for converting markdown to PDF using TeX typesetting
https://github.com/p1ass/mdtopdf
docker-image markdown mdtopdf tex
Last synced: 3 months ago
JSON representation
๐ณ Pandoc docker image for converting markdown to PDF using TeX typesetting
- Host: GitHub
- URL: https://github.com/p1ass/mdtopdf
- Owner: p1ass
- License: mit
- Created: 2019-02-24T04:23:55.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-04T15:59:33.000Z (about 4 years ago)
- Last Synced: 2024-08-02T13:28:50.580Z (6 months ago)
- Topics: docker-image, markdown, mdtopdf, tex
- Language: Shell
- Homepage:
- Size: 1.3 MB
- Stars: 190
- Watchers: 3
- Forks: 38
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](examples/example.md)
[example converted PDF](examples/example.pdf)
![Top Image](top_image.png)
## Getting Started
1. Pull docker image.
```bash
$ docker pull plass/mdtopdf
```โ ๏ธ This docker image size is **1.68GB**. I recommend pulling it using the fast Internet connection.
2. Generate PDF file.
```bash
$ 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
```bash
$ docker run -it --rm -v "`pwd`":/workdir plass/mdtopdf w-mdtopdf INPUT.md
```### Set alias
You can decrease typing using `alias` command as below,
```bash
$ 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.
```powershell
> 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
```bash
$ docker run -it --rm -v "`pwd`":/workdir plass/mdtopdf mdtotex INPUT.md
```### Generate html file from markdown
```bash
$ docker run -it --rm -v "`pwd`":/workdir plass/mdtopdf mdtohtml INPUT.md
```[example converted HTML](examples/example.html)
### Generate docx file from markdown
```bash
$ docker run -it --rm -v "`pwd`":/workdir plass/mdtopdf mdtodocx INPUT.md
```[example converted docx](examples/example.docx)