Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF Export? #213

Open
xeruf opened this issue Aug 20, 2022 · 9 comments
Open

PDF Export? #213

xeruf opened this issue Aug 20, 2022 · 9 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@xeruf
Copy link

xeruf commented Aug 20, 2022

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
Copy link
Member

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.

@mikebarkmin mikebarkmin added the help wanted Extra attention is needed label Aug 20, 2022
@maxblan
Copy link

maxblan commented Aug 21, 2022

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
Copy link
Member

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
Copy link

maxblan commented Aug 21, 2022

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
Copy link
Member

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

@maxblan
Copy link

maxblan commented Jan 12, 2023

How about markdown-pdf?

@mikebarkmin
Copy link
Member

Interesting. The approach would be different:

  • With something like rebber we would have total control lover how hyperbooks markdown would to converted to latex and then to a pdf. But this comes with the downside of needing to have latex installed on the machine.
  • With markdown-pdf or rather phantomjs we would basically make more advanced screenshots of every page of the hyperbook. The problem with is approach is what do we do with tabs, collapsible and so on.

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

@mikebarkmin mikebarkmin mentioned this issue Jan 20, 2023
@mikebarkmin
Copy link
Member

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

@mikebarkmin mikebarkmin added the enhancement New feature or request label Nov 9, 2024
@mikebarkmin
Copy link
Member

We could also explore progressive web apps and offline caches to make a hyperbook installable on a device. This would also offline access to the hyperbook.

See: https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Tutorials/js13kGames/Offline_Service_workers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants