Forum Archive

Preprocessing (Multi) Markdown Before Converting To HTML

MartinPacker

I'd like to mimic the built-in Markdown to HTML function but with a twist...

... I want to preprocess the source text before throwing it through the (Multi)Markdown to HTML conversion process and then displaying it.

I assume the way to do this is to have three stages in a script:

1) Python on Source document writing transformed text to output.
2) Conversion to HTML on input from 1, writing to output.
3) Displaying input HTML in console.

Is this about right?

Initial ideas include:

1) Pulling in referenced files.
2) Converting symbols - e.g &fred; - to text. (Definition line is .se fred=your text to replace it
3) Checking footnote references are clean.

You might be able to think of some more.

MartinPacker

On idea 2 it seems Multimarkdown 4.4.2 allows you to include metadata items in text...

fred: jim

Here is [%fred].

The symbol above should resolve nicely. It doesn't in Editorial and it doesn't in Byword. I wonder what level of Multimarkdown processor Editorial is using.