5 ms·
Does EPUB support JavaScript as well? And if it doesn't, are there any similar alternatives? Seems like a single file document that can also pull in data from s
by darkhorse13 6y ago
Does EPUB support JavaScript as well? And if it doesn't, are there any similar alternatives? Seems like a single file document that can also pull in data from somewhere could be pretty useful to say the least.
- rchaud 6y agoYou know how online newspaper articles have ads appearing in between paragraphs? That is precisely how JS would be implemented in epubs. Sure, we all have pleasant visions of truly interactive ebooks driven by creatively built JS content. But in the real world, ads would be the first thing to be added if JS was supported.
- darkhorse13 6y agoI know what you mean, I really do. But think of an interactive document that keeps updating itself with remote data. That sounds really cool to me.
- finiteseries 6y agoThat’s a website.
- darkhorse13 6y agoIt is. But you can't really run an HTML file locally without at least setting up some type of server (if you plan to make requests). And I know setting up a server is extremely easy, but it's almost impossible for someone who hasn't programmed before.
- vxNsr 6y agoThe point you’re missing is that if you just change the file extension of a ePub to html it will work fine in the browser. There’s nothing special going on. Just bec most .html files are served from a remote location that doesn’t mean they need to be, you can send someone a .html file as a download which they can open from their desktop, it will work just as well as an ePub file, in fact bec the browser recognizes the file ext it will likely run it better!
- dariusj18 6y ago> you just change the file extension of a ePub to html it will work fine in the browser Isn't epub a zip file of a bunch of html docs, metadata and images?
- kcartlidge 6y ago> if you just change the file extension of a ePub to html it will work fine in the browser If that's the case, you didn't have a genuine EPUB to start with. To meet the spec it needs to be in a container (a renamed ZIP file) and have a handful of related metadata and navigation files alongside it. That said, the actual text of the book is done by HTML/CSS, but within the EPUB container file.
- BlueTemplar 6y agoI don't understand, by definition, where is that remote data going to come from, if not another computer ? Also, peer to peer software has made it easier.
- Mooty 6y agoMaybe what you are searching for is just a html page exported.
- IanGabes 6y agoMost frequently used in my experience by malware: https://en.wikipedia.org/wiki/MHTML https://en.wikipedia.org/wiki/MHTML
- vbezhenar 6y agoAccording to Wikipedia, EPUB requires readers to support the HTML5, JavaScript, CSS, SVG formats. For me it seems like another name of HTML.
- BlueTemplar 6y agoIt's still not the full specification, it doesn't seem to support current animation formats. (Fingers crossed for AV1 ?)
- rijoja 6y agoI could agree on gifs or animated pngs or something, but AV1 I think is pushing it a bit to far. What you are looking for if you want an offline webpage is electron right?
- BlueTemplar 6y agoWhy is AV1 a bad choice for that "something" ?? No, why would I want Electron ?? IMHO EPUB should specifically be script-free. And if I wanted scripts in my document¤, then instead of packaging the whole browser (that would be overkill!!) with the document like Electron does (?), I would rather use MHTML. ¤ The following was supposed to be my example, but since this website uses Flash, these scripts are no longer easily ran. But since they are described, you should have a good idea what they are going for : http://resonanceswavesandfields.blogspot.com/2007/08/phasors.html http://resonanceswavesandfields.blogspot.com/2007/08/phasors...
- rijoja 6y ago> MHO EPUB should specifically be script-free. Agreed. Yeah maybe I am just knee jerking, with AV1. Broadly speaking however there would be two schools of image and video compression, one for computer generated images and one for images of natural concepts. So AV1 isn't really suited for animated graphs and the like at the end of the day. On second thought maybe allowing in AV1 would open the door for sound, which really would take us to far away from the book format. I do definitely see the need for having animations such as the ones you link in your post however. So many things that just takes sentence and sentence to describe can still be described way more efficiently with an animation. CSS Animations or animated SVG maybe?
- progval 6y ago> EPUB 3 Reading Systems may optionally support scripting, which was explicitly discouraged in EPUB 2. http://idpf.org/epub/30/spec/epub30-changes.html#sec-new-changed-scrp http://idpf.org/epub/30/spec/epub30-changes.html#sec-new-cha...
- inetknght 6y agoBooks should be immutable much like a true real website. Anyone using javascript in a book should not be writing a book. If you're writing javascript then go write an app.
- Karawebnetwork 6y agoI can see some useful cases. For example, in a computer science book, you could update a caption space that gets its data from the web. This would allow you to display an "obsolete sample code" warning below the examples. When the user is not connected to the internet, you could display "Get online to know code snippet status". And so on.
- inetknght 6y ago> in a computer science book, you could update a caption space that gets its data from the web. First, there's opportunity for that web endpoint to stop functioning. Second, there's opportunity for that web endpoint to become taken over by malice. And third, there's opportunity to turn that caption space into an advertisement. So, to put it succinctly: fuck no. > This would allow you to display an "obsolete sample code" warning below the examples. So now the book isn't timeless. It changes. It's no longer a book. A better idea: include the "obsolete sample code" warning in the book and ask the user check for the latest practices at a URL also included in the book. > When the user is not connected to the internet, you could display "Get online to know code snippet status". And so on. When the user is not connected to the internet should be the only case ever considered for a book. Otherwise you're not writing a book. You're writing an app.
- 6y ago
- BlueTemplar 6y agoYou probably want mhtml = eml ?
- GoblinSlayer 6y agoYou want Electron.