pystitcher
pystitcher copied to clipboard
Render Markdown inline
Within the markdown, provide a way to declare pages that get rendered as stand-alone pages as well.
<!-- This only goes in bookmark-->
# Cover

# Colophon
```
# Hobbit
## There and back again
## By JRR Tolkein
```{: inline=1}

Renders a cover, a single page with the 3 lines as above, and then the foreword. So the colophon ends up linking to the middle text section
``` # Hobbit ## There and back again ## By JRR Tolkein ```{: inline=1}
Is the {: inline=1} something that would be needed? The triple backticks seem sufficient to me, but I haven't used much markdown.
I'm unsure about this - I don't think it's needed as of yet. The long-term semantics of the project aren't really well thought out and we might have inconsistencies as a result.
Do we want the markdown to reflect the structure or the content? Because if it's just structure, then we can keep it out. But if it's content, and we try to parse things like bold/emphasis/images etc as well (outside of backticks), then it might get complicated without the {inline} part.
There's also concerns with render backticks inside inline text.
Maybe we should write a forward-looking markdown doc that reflects all the possible usecases/edgecases first? I started it here: https://github.com/captn3m0/pystitcher/wiki/All-Features
Looks like I lost track of this sometime a couple of months back and just left it hanging, sorry about that :sweat_smile: So I did a bit of research on this and the best way I could find is to use Python-Markdown to convert the Markdown to HTML and then convert the HTML to a PDF using whatever works best for #4 This Markdown -> HTML -> PDF route has been done before (with Weasyprint) and looked like it worked well.