Mandroid
Mandroid

Reputation: 7468

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?

Upvotes: 3

Views: 4458

Answers (2)

Krushn Dayshmookh
Krushn Dayshmookh

Reputation: 161

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

Upvotes: 3

Tallboy
Tallboy

Reputation: 13407

pandoc *.md -o result.html

Try this

Upvotes: 2

Related Questions