您的位置 首页 linux 运维

pandoc 安装(linux)

pandoc是一款强大的文档转换工具,本文将为大家介绍一下使用此工具可以进行相互转换的文件格式。

1、首先从官网下载安装包

wget https://kt-ai-league.oss-cn-beijing.aliyuncs.com/dep/pandoc-3.2.1-linux-amd64.tar.gz

https://github.com/jgm/pandoc/releases/tag/3.1.6

wget https://github.com/jgm/pandoc/releases/download/3.1.6/pandoc-3.1.6-linux-amd64.tar.gz

 

(Release pandoc 3.1.6 · jgm/pandoc · GitHub)

 

2- 解压

我们放到 /opt 目录下

ln -s /opt/pandoc-3.1.6/bin/pandoc /usr/bin/pandoc

验证:

pandoc --version

4-安装完成即可使用markdown转html文件了

准备 test.md

# 1-你的愁人

index



# 2我的爱人

sadf 

撒旦法

转换:

pandoc test.md -o test.html

 

html转pdf
pandoc --pdf-engine=xelatex -H /root/pandoc/conf/head.tex -V mainfont=“Microsoft YaHei’” test.html -o test.pdf

java中实现
将cmd改成html转pdf即可

html转word
pandoc -o test.word test.html

https://blog.csdn.net/qq_43601009/article/details/134055074

 

欢迎来撩 : 汇总all

白眉大叔

关于白眉大叔linux云计算: 白眉大叔

热门文章