goldmark-pdf icon indicating copy to clipboard operation
goldmark-pdf copied to clipboard

Skip the rest of the page?

Open ivanjaros opened this issue 2 years ago • 2 comments

I want to put some content as the last page of the document, is there a way to tell the renderer to skip the rest of the current page and render the next page instead?

ivanjaros avatar Jan 22 '23 16:01 ivanjaros

There's nothing in the markdown spec for inserting page breaks and no common flavours have something similar, so this is something I will be reluctant to add to this package.

However, if you have a syntax you like and can write a goldmark parser for it, you can then write your own pdf node renderer too and pass it as an option to the PDF renderer.

stephenafamo avatar Jan 23 '23 02:01 stephenafamo

Is there an example of how to add a new node renderer?

For reference, because I was curious, here are how people are inserting page breaks in other Markdown tools

  • <div style="page-break-after: always"></div> HTML; https://markdownmonster.west-wind.com/docs/_5ne1ccv4t.htm
  • \newpage Pandoc via LaTex; https://stackoverflow.com/questions/16965490/pandoc-markdown-page-break
  • *** PDFKit; http://pdfkit.org/docs/

esnible avatar May 30 '23 23:05 esnible