openpatch / hyperbook

Hyperbook is a quick and easy way to build interactive workbooks, that support modern standards and runs superfast.
https://hyperbook.openpatch.org
MIT License
33 stars 7 forks source link

PDF Export? #213

Open xeruf opened 2 years ago

xeruf commented 2 years ago

Would it make sense to implement a PDF Export in Hyperbook or should I rather do this by stripping special syntax and using something like pandoc? I want to provide an easily downloadable offline version of our documentation (no need to be interactive except for links), and it would be nice if something like the glossary would still work.

mikebarkmin commented 2 years ago

PDF Export would be interessting, but I wonder what for example should happen with tabs, collapsibles and bitflow tasks. Is it for printing vor for provising an offline Version? Offline support can rather easily be implemented. Even the export as an Desktop app with electron should be easy to implement.

maxblan commented 2 years ago

This feature is mainly intended for printing. I suspect the easiest thing to do will be to simply omit the Hyperbook features while the PDF is generated.

mikebarkmin commented 2 years ago

I think the best result would be to convert the hyperbook markdown to regular markdown by removing or switching out the directives and then use pandoc to create a PDF. I think for tabs and collapsible they would probably just be presented after each other. Maybe a pandoc latex template for hyperbook would also be a nice addition to have a more consistent style.

I anyone will try to do something like this I really would appreciate it, but I have no time working on that feature for now.

I would suggest building a CLI tool hyperbook-to-pdf or extending to current CLI tool hyperbook pdf.

maxblan commented 2 years ago

No problem. This ferature is not that important anyway. But I'll look into it if I have time for that. Thank you for your support!

mikebarkmin commented 1 year ago

This seems to be a good starting point https://github.com/zestedesavoir/zmarkdown/tree/master/packages/rebber

maxblan commented 1 year ago

How about markdown-pdf?

mikebarkmin commented 1 year ago

Interesting. The approach would be different:

Personally, I think the rebber approach would be harder to set up but would also lead to more pleasing results.

mikebarkmin commented 1 week ago

Since, hyperbook switched to using plain remark, rebber would be a perfect fit.