Anyway to automate conversion to HTML from the command line?
Hi,
Can I use the mark command line tool to say "load this file, convert it to HTML, and save it as x.html?"
This would make my workflow much much easier, because I could use this on Makefiles and pre-commit hooks…
Thanks,
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 15 Mar, 2014 12:39 PM
It's in the cards, but no, not right now. The only thing the CLI can do
is open a file in Marked at this point (same as `open -a Marked
filename`).
I am planning to broaden it, though.
-Brett
2 Posted by Pedro Melo on 15 Mar, 2014 09:08 PM
Ok,thank you
3 Posted by Sébastien MICHO... on 06 May, 2016 08:03 PM
Hi Brett,
Any news about it?
Support Staff 4 Posted by Brett on 06 May, 2016 08:20 PM
The CLI will probably not see updates. Out of curiosity, why not just use any available Markdown CLI utilities available?
5 Posted by Sébastien MICHO... on 06 May, 2016 08:42 PM
I use Marked quite often, so it is already installed on my laptop and I'm sure it works correctly. Moreover it manages GFM and deals with custom CSS.
I guess I will try Discount. It's the GFM processor you use, isn't it?
Some advices?
Support Staff 6 Posted by Brett on 06 May, 2016 09:16 PM
Discount is the base of the GFM processor, but as far as I know, the CLI doesn't handle all of the GutHub addons. You might look at Kramdown or Maruku.
-Brett
7 Posted by Sébastien MICHO... on 06 May, 2016 09:19 PM
Thanks, I'll take a look.
8 Posted by davidjohnmacdon... on 30 May, 2016 01:42 AM
I would just like to add that I too would love to see more features added to the CLI. I use Marked to create both HTML and paginated PDFs of very large (over 100 pages) multi-file documents, images, footnotes, and tables. Neither MMD nor Pandoc render the same way as Marked on my files. I would buy this as an in-app purchase as I did for the writing tools.
9 Posted by Mike on 06 Aug, 2016 04:55 AM
Add one more vote for a scripted way to generate html from markdown with Marked 2. I looked at the CLI tools mentioned here and I don't see any that would do what Marked 2 does without a lot of hassle.
I already spent a lot of effort tweaking the custom CSS for the way the Marked 2 converter renders. It would be great to use it in an automated fashion.