Print Document From Markdown / PDF Maker
Make PDF from markdown!
Here is an input and an output.
- GFM (GitHub Flavoured Markdown)
- GitHub emoji
- math rendering (KaTeX)
- CJK ruby
- TOC generation
- Mermaid diagrams
- syntax highlighting
- in-document link
IMPORTANT
As of now, pdfmk uses Chrome (headless mode) to print pdfs. Make sure you have installed one on your system. The executable path should be detected automatically.
Short note on chrome / chromium:
By default, deno-puppeteer ships with an old version of standalone chromium binary, which unfortunately crashes in some environments. To avoid this, we use system chrome binary, assuming you have one on your computer.
deno run -A --no-check https://github.com/haxibami/pdfmk/raw/main/cli.ts [args]
deno install -Af --no-check --name=pdfmk https://github.com/haxibami/pdfmk/raw/main/cli.ts
# DON'T FORGET ADDING DENO PATH INTO YOUR $PATH!
> pdfmk --help
pdfmk v0.0.1 - Make PDF from markdown
Usage: pdfmk <input> [output]
Version: 0.0.1
Description:
Generate PDF from Markdown file
Options:
-h, --help - Show this help.
-V, --version - Show the version number for this program.
-s, --style <stylesheet> - Path to CSS stylesheet.
--tocHeading <section> - TOC section heading. (Default: "TOC")
-f, --format <format> - Paper format. (Default: letter)
-z, --zoom <scale> - Zoom level. (Default: 1)
-m, --margin <margin> - Margin. (Default: "20mm")
-p, --prismTheme <theme> - Prism theme. 44 themes available.
-d, --mermaidTheme <theme> - Mermaid theme. 5 themes available.
--channel <channel> - (dev) Chrome release channel.
See the sample input and output for full example & display.
As per specification in remark-jaruby.
Define ruby:
{聖剣}^(エクスカリバー)
> $$
> ( \sum_{k=1}^{n} a_k b_k )^2 \leq ( \sum_{k=1}^{n} {a_k}^2 )( \sum_{k=1}^{n} {b_k}^2 )
> $$
> "$e^{i\pi} + 1 = 0$ "; Euler said.
```mermaid
sequenceDiagram
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
```
```mermaid
pie
"Dogs" : 386
"Cats" : 85
"Rats" : 15
```