pystitcher icon indicating copy to clipboard operation
pystitcher copied to clipboard

Render Markdown inline

Open captn3m0 opened this issue 4 years ago • 4 comments

Within the markdown, provide a way to declare pages that get rendered as stand-alone pages as well.

<!-- This only goes in bookmark-->
# Cover

![Cover](cover.pdf)

# Colophon

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

![Foreword](foreword.pdf)

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

captn3m0 avatar May 26 '21 15:05 captn3m0

```
# 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.

Vonter avatar Jun 30 '21 17:06 Vonter

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

captn3m0 avatar Jul 01 '21 10:07 captn3m0

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.

Vonter avatar Jan 02 '22 05:01 Vonter