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

EPUB converter #8

Open
mrombout opened this issue Apr 2, 2023 · 2 comments
Open

EPUB converter #8

mrombout opened this issue Apr 2, 2023 · 2 comments

Comments

@mrombout
Copy link
Owner

mrombout commented Apr 2, 2023

It might be nice to also support exporting the gamebook to EPUB. In order to achieve this we would need to change some things so that:

  • All segments should be split into separate HTML pages.
  • All turn:<id>[] and choice:<id>[] links should link to those pages.
  • Some CSS might not be applicable for EPUB because paging works differently.
  • Create an EPUB from all generates HTML pages.
  • Embed all images in that EPUB.
@mrombout
Copy link
Owner Author

It would be great to be able to use asciidoctor-epub3, but it's based on the ruby project so it might be a pain to integrate it properly. I would either have to convert it to JS using Opal, or re-implement all the extensions in Ruby.

So it might be less trouble to implement some more extensions/converters/templates to build an EPUB of my own.

@mrombout mrombout changed the title Create EPUB export EPUB converter Aug 3, 2023
@mrombout
Copy link
Owner Author

mrombout commented Aug 3, 2023

See mrombout/Spiner#76 for some ideas on how to generate an EPUB through the web. The epub-gen library can generate EPUBs on Node.js and the fork epub-gen-memory can do so both on Node.js and the browser.

We can use the html5 converter that comes with Asciidoctor to do most of the heavy lifting. Then we need to do the following:

  • Find a good hook to produce a separate .html file for each [.segment].
  • Rewrite all links to link the those .html pages.
  • Feed in the right information and metata into epub-gen-memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant