Batch export to HTML
Does the Marked app support batch export to HTML? I have a folder full of MD files and I would like to export them all to html in one action. Could I access the marked export feature from the command line?
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 Brett on 12 Dec, 2013 11:54 PM
No, this type of task is better handled with existing command line tools.
Thanks,
Brett
2 Posted by al on 20 Mar, 2014 12:44 AM
Errr.... could you recommend such a command line tool?
Support Staff 3 Posted by Brett on 20 Mar, 2014 12:49 AM
multimarkdown, pandoc, kramdown, maruku, python markdown...
You just need a script that will go through the files in the directory and run your converter of choice on them. Could be as easy as a one line bash command, but if you want to include CSS and handle moving/renaming anything, you might need a short script for it.
4 Posted by al on 20 Mar, 2014 07:00 AM
Thanks Brett, you are patient with the simple questions. I will explore those options. Basically I want to make it easier to update my work web pages by separating the development of content and common top matter (banners, menus etc) as well as CSS. Markdown makes it easy to do the content part, and Marked to preview it with experimental CSS. So then I just need something to batch convert all the markdown files to HTML (without the CSS) and then a script to glue in the top matter to each resulting file (including the reference to CSS). That would give me a new suite of pages for testing on my Mac before rsyncing to my work web server. This workflow feels like something about eight million other people must be doing, but I don't know how! Maybe everybody else in the world either uses a server-based CMS or is a proper web developer.
----
update : answering my own question, it does indeed look like multimarkdown plus a moderately simple bash script will do the trick
Support Staff 5 Posted by Brett on 20 Mar, 2014 11:15 AM
They're not all web developers, but it sounds like for your needs a CMS
wouldn't be a bad idea. You could also use a static site generator like
Jekyll or Pelican, which essentially just take a pile of Markdown files
and turn them into static websites based on templates. That's what
http://brettterpstra.com is.
-Brett