Brett on 30 May, 2017 04:35 PM
As stated before, all of the fancy DOM manipulation in the world won't
bypass the issue that an application using the WebKit print system has
no idea where the page breaks will be prior to the print rendering.
Inserting footers requires knowledge of the current page height and the
size needed for the footer, and those can't be modified on a
page-by-page basis during printing.
The solution is going to be a rewrite of the RTF export, which is in the
works. This will allow output closer to Pandoc's, and also be a step
toward a PDF generator that doesn't rely on webkit.
You can use any processor you want within Marked (via Custom
Processors), but it doesn't apply to export. The best solution for
something like that would be to use a script that `tee`s the output
but then you're generating a new doc file on every update, which might
be annoying, and also would preclude any of Marked's other features.