当前位置:网站首页>One click generation and conversion of markdown directory to word format
One click generation and conversion of markdown directory to word format
2022-07-02 04:18:00 【Mingmingruyue senior】
One 、 background
Usually as a technician , I prefer to write technical articles or columns typora To write markdown Format , Because you don't need to pay much attention to format , Let me pay more attention to the content .
But if the article has many chapters , Hope to automatically generate directories .
also , In some scenarios, you need to markdown The file to word perhaps pdf Format .
A simple way is to markdown Paste the bear In the notes , Click again to generate the directory , And then export to PDF, however bear Derived from PDF Is the charge , What about swelling ?
Here is a free conversion method .
Two 、 operation
2.1 install pandoc
According to your system , Select the corresponding installation package :
https://github.com/jgm/pandoc/releases

2.2 Carry out orders
2.2.1 Generate Directory
On the command line cd To the destination folder
pandoc -s --toc --toc-depth=3 “xxxx.md” -o “xxxx2.md”
–toc-depth=3 Indicates how many levels of directories to generate
If markdown The file name has some special characters , You need to put double quotes 

Open the target markdown file , Discovery directory has been generated , Click to jump to the target location 
2.2.2 Turn into Word
The order is as follows
pandoc -f markdown -t docx “xxxx2.md” -o “xxxx2.docx”

Conversion success , One of the pictures cannot be parsed ( This can be handled manually later ).
2.2.3 Turn into PDF
The order is as follows :
pandoc xxx.md --pdf-engine=xelatex -o xxxx.pdf
2.2.4 turn epub Format
pandoc xxx.md -o xxxx.epub
Other instructions refer to
https://pandoc.org/demos.html
3、 ... and 、 summary
quite a lot markdown The bottom layer of tool conversion format is used pandoc , If the conversion part of the tool is charged , Everyone can make plenty of food and clothing by themselves .
边栏推荐
- [untitled]
- Pytoch --- use pytoch for image positioning
- [improvement class] st table to solve the interval maximum value problem [2]
- Analysis of the overall design principle of Nacos configuration center (persistence, clustering, information synchronization)
- Finally got byte offer. The 25-year-old inexperienced perception of software testing is written to you who are still confused
- 向数据库中存入数组数据,代码出错怎么解决
- Wechat applet JWT login issue token
- Play with concurrency: what's the use of interruptedexception?
- cookie、session、tooken
- Common locks in MySQL
猜你喜欢

Yolov5 network modification tutorial (modify the backbone to efficientnet, mobilenet3, regnet, etc.)

66.qt quick-qml自定义日历组件(支持竖屏和横屏)

Three years of experience in Android development interview (I regret that I didn't get n+1, Android bottom development tutorial

WPViewPDF Delphi 和 .NET 的 PDF 查看组件

Target free or target specific: a simple and effective zero sample position detection comparative learning method

JVM知识点

A summary of common interview questions in 2022, including 25 technology stacks, has helped me successfully get an offer from Tencent

【c语言】动态规划---入门到起立

Fluent icon demo

PR zero foundation introductory guide note 2
随机推荐
Microsoft Research Institute's new book "Fundamentals of data science", 479 Pages pdf
Bitmap principle code record
C语言:逻辑运算和判断选择结构例题
手撕——排序
Pytorch yolov5 exécute la résolution de bogues à partir de 0:
Where can I buy cancer insurance? Which product is better?
Use a mask to restrict the input of the qlineedit control
微信小程序 - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
树莓派GPIO引脚控制红绿灯与轰鸣器
Typescript practice for SAP ui5
Installation and use of blue lake
Which product of anti-cancer insurance is better?
C language guessing numbers game
Major domestic quantitative trading platforms
Three years of experience in Android development interview (I regret that I didn't get n+1, Android bottom development tutorial
[source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
C language: examples of logical operation and judgment selection structure
整理了一份ECS夏日省钱秘籍,这次@老用户快来领走
【leetcode】81. Search rotation sort array II
[untitled]