Is there a way to process Marked Special Syntax and save resulting Markdown?

Simeon Fitch's Avatar

Simeon Fitch

05 Jun, 2014 01:20 PM

I have a multi-file document organized according to this, using the Marked Special Syntax for handling file includes:

Because I need to incorporate my content into a larger MS-Word document, I'm needing to use Pandoc for the final Markdown->DOC conversion to keep the DOC styling as close to a generic document as possible (as well as the fact I need my imbedded LaTeX to convert properly).

Is there a way to have marked process the <<[] directives and capture the results in a new Markdown file so that I can pass it to Pandoc?

I really like the multi-file facilities, just stuck with how to integrate it into a larger workflow outside of Marked.

  1. Support Staff 1 Posted by Brett on 05 Jun, 2014 02:56 PM

    Brett's Avatar

    Does running Pandoc as a custom processor not work in this case? That should pipe the compiled file straight to Pandoc with whatever arguments you need. If you've tried that and it's not sufficient, there is a way to use the custom preprocessor feature to save the compiled markdown:

    Make a script like this:

    cat | tee ~/Desktop/

    Make it executable (chmod a+x filename) and use the path to it as the Marked custom preprocessor (assuming you're using Marked 2). That will write out a Markdown document every time it updates, as well as returning the Markdown for processing in Marked.

  2. 2 Posted by Simeon Fitch on 05 Jun, 2014 04:00 PM

    Simeon Fitch's Avatar

    I think my problem is that the solution is so simple and obvious I overlooked it :-/. Yes, that works exactly as I need. Thanks!

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


? 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