当前位置:网站首页>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 .
边栏推荐
猜你喜欢
BGP experiment the next day
JVM knowledge points
《动手学深度学习》(二)-- 多层感知机
CorelDRAW Graphics Suite2022免费图形设计软件
Installation and use of blue lake
Learn more about materialapp and common attribute parsing in fluent
A thorough understanding of the development of scorecards - the determination of Y (Vintage analysis, rolling rate analysis, etc.)
Actual combat | use composite material 3 in application
Go语言介绍
Hand tear - sort
随机推荐
Wechat applet calculates the distance between the two places
WiFi 5GHz frequency
Typescript practice for SAP ui5
BGP experiment the next day
LCM of Spreadtrum platform rotates 180 °
The original author is out! Faker. JS has been controlled by the community..
Fingertips life Chapter 4 modules and packages
Handling of inconsistency between cursor and hinttext position in shutter textfield
Li Kou interview question 02.08 Loop detection
Force buckle 540 A single element in an ordered array
[JS event -- event flow]
第十六周作业
66.qt quick QML Custom Calendar component (supports vertical and horizontal screens)
Wechat applet - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
go 分支与循环
FAQ | FAQ for building applications for large screen devices
[C language] basic learning notes
Microsoft Research Institute's new book "Fundamentals of data science", 479 Pages pdf
go 语言命名规范
10 minutes to understand CMS garbage collector in JVM