convert lots of md files to html with one command?
Suppose I have 30 markdown files in a folder. I want to run a command to bulk convert them to HTML. In Pandoc, I could use something like find . -name \*.md -type f -exec pandoc -s -o {}.html {} \;. What can I use with Multimarkdown to accomplish a similar thing? I want to avoid converting each file individually.
Also, how do I specify that I need head matter included?
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by fletcher on 17 Nov, 2014 07:14 PM
If you read the MultiMarkdown User's guide:
or look at the command line help:
you will see how to use MultiMarkdown. In particular, you can read about the batch mode that lets you handle multiple files.
I'm not sure what you mean by needing "head matter included."
Fletcher
2 Posted by tomjohnson1492 on 17 Nov, 2014 07:21 PM
Thanks for your response. The MMD user guide says that batch conversion is
done with this:
multimarkdown -b file1.txt file2.txt file3.txt
However, I don't want to specify all the files that I want included in the
batch conversion. I have approximately 30 or more files here. I want to
enter something like this:
multimarkdown -b
Then ideally multimarkdown would look through all the files contained in
the folder and convert them from markdown to html. However, when I run this
command, Terminal just hangs.
Am I required to specify each file that I want included in batch processing?
Thanks for your help,
Tom
---------------------
801-822-2241
blog: idratherbewriting.com
twitter: tomjohnson
Support Staff 3 Posted by fletcher on 17 Nov, 2014 07:26 PM
I recommend that you find some good resources on using the command line.
It's very powerful and worth learning about if you want to improve
your efficiency with most things you can do on a computer:
multimarkdown -b *.txt
Your idea of:
multimarkdown -b
is an incomplete command, since you didn't specify any filenames.
Fletcher
4 Posted by tomjohnson1492 on 17 Nov, 2014 07:41 PM
Thank you. That works. (Also, yes, I need to increase my knowledge of
command line syntax....)
One more question, if you don't mind. I need the HTML file to include
header information, such as <html><body>. Is there any argument to add
there that would get this header info included in the html output?
Tom
---------------------
801-822-2241
blog: idratherbewriting.com
twitter: tomjohnson
Support Staff 5 Posted by fletcher on 17 Nov, 2014 08:06 PM
Again -- if you look in the User's Guide, or in the help on the command
line, there is an option to force a full HTML document including <head>,
etc.
The User's guide is by no means perfect, but it really does have a lot
of useful information in it that may prove helpful to you.
F-
6 Posted by tomjohnson1492 on 17 Nov, 2014 09:01 PM
Great! Thank you. I had looked in the help before but didn't realize that
the full or force a complete document was the option I needed. (It makes
sense though.)
Here's the full working command:
multimarkdown -f -b *.md
Thanks for developing such a great tool. This is going to revolutionize my
DITA workflow (hopefully).
Tom
---------------------
801-822-2241
blog: idratherbewriting.com
twitter: tomjohnson
Support Staff 7 Posted by fletcher on 17 Nov, 2014 09:14 PM
Glad it's working!
F-
fletcher closed this discussion on 17 Nov, 2014 09:14 PM.