Markdown 文件批量转换为 pdf 用十几行 Python 代码和格式转换界黑魔法 Pandoc ,迅速搞定。 需求 有个朋友提出,希望把目录中的许多 markdown 文件,批量转换为对应名称的 pdf 格式文件。我于是编写了一个 Python 脚本,并且分享给你。如果你有类似的需求,欢迎使用。 由于使用了 pandoc 作为转换工具,因此 Markdown 文件里的图片链接,不论是本地存储的(只测试了绝对路径情况),还是图床上的,都可以正确转换并且显示到 pdf 文件里。 数据 我已经把代码和样例 Markdown 文件,都为你放在了这个 github repo 中。 你可以直接点击这个链接,下载压缩包 。 在 macOS 上默认的下载位置,是 。 下载后,解压该压缩包,咱们的演示目录就准备好了。名称是 。 压缩包里面,有4个文件。 其中的是运行脚本; 和 是咱们的两个示例 Markdown 文件。你尝试之后,可以换成自己的一批 Markdown 文件。 是转换是采用的模板,这个模板并非我做的,它来自于这个 github 项目。 如果你
| Stars | 218 |
| Forks | 53 |
| Language | TeX |
| Category | AI Tool |
| Quality Score | 48.9983588842685/100 |
| Open Issues | 3 |
| Last Updated | 2018-11-02 |
| Created | 2018-09-11 |
| Est. Tokens | ~3k |
Explore other popular ai tool tools:
demo-batch-markdown-to-pdf is an open-source ai tool by wshuyi with 218 GitHub stars.
demo-batch-markdown-to-pdf is primarily written in TeX.
You can find installation instructions and usage details in the demo-batch-markdown-to-pdf GitHub repository at github.com/wshuyi/demo-batch-markdown-to-pdf. The project has 218 stars and 53 forks, indicating an active community.