• Gyrcas ( Gyrcas@piefed.zip ) OP
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 days ago

    Does it have support for Javascript files? I did try to look into it before, but I had trouble finding what I could use to create an EPUB from my HTML file, and when I did it only took the HTML and CSS, not JS

    • cosmicrose ( cosmicrose@lemmy.blahaj.zone ) 
      link
      fedilink
      English
      arrow-up
      5
      ·
      3 days ago

      I don’t think any epub readers support JS unfortunately.

      Calibre has an ebook editor included in its installation that you can stick your HTML into. However, technically, epubs use XHTML with some XML-based extensions, so there’s some epub-specific learning involved.

      Also, there are lots of other document technologies out there that you can use to produce books, EPUBs, PDFs, etc, if you’re interested. I’m a bit of a nerd about doc prep and typography so I’ve been down a few rabbit holes. Here’s a random selection of stuff I’ve played with:

      • Asciidoctor is a markup format similar to Markdown but is a little more feature-rich. Makes nice ebooks as well as PDFs or HTML pages from the same markup file. I attempted writing a tech book once and this is what I used.
      • mdBook is mostly used for HTML documentation sites but there’s an experimental epub plugin.
      • Typst is more complicated but gives you lots of control over how the page is put together, and is mainly focused on producing print documents and PDFs. It supports a lot of features used in books.
      • LaTeX was invented decades ago because an influential computer scientist and author was writing a book and hated how typesetters laid it out, so he invented his own typesetting language, as ya do. It’s quite old but still used quite a bit, but Typst is a more modern alternative.

      In a completely different direction, if you want to use HTML and CSS and JavaScript to build interactive non-linear stories, like visual novels, there’s Twine. You can even host Twine games on itch.io for free (and they’re okay with NSFW content).