Anyway to automate conversion to HTML from the command line?

Pedro Melo's Avatar

Pedro Melo

15 Mar, 2014 12:00 PM

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,

  1. Support Staff 1 Posted by Brett on 15 Mar, 2014 12:39 PM

    Brett's Avatar

    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. 2 Posted by Pedro Melo on 15 Mar, 2014 09:08 PM

    Pedro Melo's Avatar

    Ok,thank you

  3. 3 Posted by Sébastien MICHO... on 06 May, 2016 08:03 PM

    Sébastien MICHOY's Avatar

    Hi Brett,

    Any news about it?

  4. Support Staff 4 Posted by Brett on 06 May, 2016 08:20 PM

    Brett's Avatar

    The CLI will probably not see updates. Out of curiosity, why not just use any available Markdown CLI utilities available?

  5. 5 Posted by Sébastien MICHO... on 06 May, 2016 08:42 PM

    Sébastien MICHOY's Avatar

    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?

  6. Support Staff 6 Posted by Brett on 06 May, 2016 09:16 PM

    Brett's Avatar

    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. 7 Posted by Sébastien MICHO... on 06 May, 2016 09:19 PM

    Sébastien MICHOY's Avatar

    Thanks, I'll take a look.

  8. 8 Posted by davidjohnmacdon... on 30 May, 2016 01:42 AM

    davidjohnmacdonald's Avatar

    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. 9 Posted by Mike on 06 Aug, 2016 04:55 AM

    Mike's Avatar

    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.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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