Hacker News new | ask | show | jobs
by talldayo 720 days ago
PDF and Epub support a featureset that far exceeds Markdown in it's basic specification. Translating from one to the other would be pretty lossy, but possible.

You could probably use Pandoc to do this yourself, but again I'd stress that Markdown is really not meant for rendering PDF or Epub content: https://pandoc.org/

1 comments

Hm, which features in particular are available in PDF or Epub that couldn't be replicated in Markdown? Everything I can think of (linking, headings, tables, image embedding) can also be done in Markdown. Not to mention embedded HTML could cover even more where Markdown is lacking (ex, subscript, superscript)
> Hm, which features in particular are available in PDF or Epub that couldn't be replicated in Markdown?

‘Markdown’ isn’t well defined, but here are a few that I think apply:

- headers and footers on pages

- starting chapters on a new page

- having pages, to start with

- tables where cells have multiple lines of content

- pages with multiple columns of text

- drop caps

- ‘watermarks’ on pages (e.g. a diagonal “Concept” below the text)

- centering or full justifying paragraphs

- multiple kinds of underlines.

- text colors

- control over character and line spacing

- embedded JavaScript (https://helpx.adobe.com/acrobat/using/applying-actions-scrip...)

- DRM :-) / :-(

> Not to mention embedded HTML could cover even more where Markdown is lacking

Yes, you could use that to include JavaScript for a PDF or ePub renderer and then render those on-page :-)

Once you're embedding HTML, you might as well just use HTML or something like it - you don't really get any advantage from Markdown. Markdown is supposed to make the (human) writing easier, a finished book needs good rendering on the target device - something richer markup is better suited for.
I immediately thought of “House of leaves”. That one is impossible for markdown unless you go full html+css.

But most classic literature can be just txt file (and it is)