Skip to content
Advertisement

Convert MediaWiki wikitext format to HTML using command line

I tend to write a good amount of documentation so the MediaWiki format to me is easy for me to understand plus it saves me a lot of time than having to write traditional HTML. I, however, also write a blog and find that switching from keyboard to mouse all the time to input the correct tags for HTML adds a lot of time. I’d like to be able to write my articles in Mediawiki syntax and then convert it to HTML for use on my blog.

I’ve tried Google-ing but must need better nomenclature as surprisingly I haven’t been able to find anything.

I use Linux and would prefer to do this from the command line.

Any one have any thoughts or ideas?

Advertisement

Answer

Looked into this a bit and think that a good route to take here would be to learn to a general markup language like restucturedtext or markdown and then be able to convert from there. Discovered a program called pandoc that can convert either of these to HTML and Mediawiki. Appreciate the help.

Example:

pandoc -f mediawiki -s myfile.mediawiki  -o myfile.html -s
Advertisement