Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple markdown files to a single HTML

I have to convert multiple .md files into a single HTML file.

Is it possible? Pandoc can convert .md to HTMLbut not sure if it can do it for multiple files.

Or would I need to write a program to manipulate the tool?

like image 589
Mandroid Avatar asked Oct 22 '25 17:10

Mandroid


2 Answers

pandoc *.md -o result.html

Try this

like image 190
Tallboy Avatar answered Oct 24 '25 19:10

Tallboy


You can concatenate the files in lexicographical order of their names by using the following command:

pandoc *.md > all.html

For example, if in your folder, you have files like this:

k.md, w.md, t.md, a.md

they will be concatenated in following order:

a.md
k.md
t.md
w.md

the final output file will be

all.html
like image 23
Krushn Dayshmookh Avatar answered Oct 24 '25 19:10

Krushn Dayshmookh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!