I am trying to compile one single markdown file into different outputs (HTML, EPUB and LaTeX for printing via PDF). The document requires some formats that are not native to Markdown, which means the original is not portable. However, the features I need are possible in all three output formats.
The solution I am considering is to have some custom markup in the original file and process it using sed (or any other preprocessor you advise me) to create different outuputs to feed Pandoc.
For example:
<sig>Placename, 2016</sig>
would become
<div class="signature">Placename, 2016</div>
in both HTML and EPUB, but
\signature{Placename, 2016}
in LaTeX.
and
<quote>To be or not to be</quote><qaut>Shakespeare</qaut>
would be this in HTML and EPUB
<div class="epigraph"><quote>To be or not to be</quote>Shakespeare</div>
and simply
\epigraph{To be or not to be}{Shakespeare}
in LaTeX.
Though the replacements don't seem terribly difficult, I would like some advice on how to deal with multiple instances of these replacements before invoking Pandoc (from within a Makefile, of course).
I would prefer to pipe the edited file to Pandoc using the RAM disk, but saving a tempfile on /tmp would be the same for me, since I have my /tmp on RAM.