convert Markdown to PDF with css style

css之类的自己不会写/不想写可以到处找这种。下载下来之后用里面的css文件。
css 模板
https://theme.typora.io/

之后使用pandoc将其转成pdf,转好的pdf就带有相应的花里胡哨的样式了。

1
2
3
4
5
6
7
8
sudo apt update
sudo apt install pandoc
sudo apt install wkhtmltopdf # a dependency to convert HTML To pdf
wget https://raw.githubusercontent.com/simov/markdown-viewer/master/themes/github.css

# Convert test.md to test.pdf using the github.css CSS style theme
pandoc -f gfm -t html5 --metadata pagetitle="test.md" --css github.css \
test.md -o test.pdf