Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 08-06-2025, 04:02 PM   #16
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,838
Karma: 6120478
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by Quoth View Post
A nonsense personal attack that ignores reality. If you need javascript then maybe you need to write an iOS or Andriod app.
In what way is this personal?

Look at all of your posts on MR in threads on epub3 and/or javascript objectively like a data analyst would. You have put down epub3 and javascript in every one of them! You do so in an authoritative voice quoting your "long experience". Your bias is showing.

I started programming in 1976 and was a paid professional programmer for a time in the late 1970s and early 1980s before I decided to go back and get a PhD in Operations/Applied Mathematics. But that in no way means my opinion is worth more than anyone else's so I try to clearly state an "opinion" and not a fact most of the time. But you are so wrong on these subjects. You do not need an application for simple javascript in an epub. And not all books are basic fiction. So intelligent use of javascript in epub can be useful. These are not debatable points.

Go back and re-read what you wrote. It is time to stop trying to close down epub3 and javascript threads on MR. You are not helping anyone. I will now put you on ignore. Please do the same for me. As we must agree to disagree.

And be forewarned that inside the Sigil area, where I moderate, your constant attacks on epub3 and javascript will not be tolerated.

Last edited by KevinH; 08-06-2025 at 04:09 PM.
KevinH is offline   Reply With Quote
Old 08-06-2025, 05:12 PM   #17
Slevin#7
Connoisseur
Slevin#7 began at the beginning.
 
Posts: 71
Karma: 10
Join Date: May 2025
Device: iPad
I agree that for most pure fiction stories EPUB2 is sufficient. But there are many other scopes where full EPUB3 functionality inlcluding JS would have great benefit. For example educational books with Q&A sections, interactive storylines, escape stories, science texts, etc etc.

Also, as soon as there is a broad support I would bet that there will be a more and more amount of some interactive content, and who can say today what some intelligent people might come up with. New technology usually brings new possibilities no one thought before of. So let's embrace the future together and make sure to always have enough coffee and cookies in handy...
Slevin#7 is offline   Reply With Quote
Advert
Old 08-06-2025, 06:33 PM   #18
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 14,227
Karma: 105299897
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Quote:
Originally Posted by Slevin#7 View Post
IFor example educational books with Q&A sections, interactive storylines, escape stories, science texts, etc etc.
An app is easier and more likely to work and easier to distribute for those. Once you have used the framework once different content is easy to swap for titles of the same functionality.

Science texts can certainly be done with zero javascript but benefit from epub3 reflowable as a more flexible alternate to PDF. PDF is better for fixed layout.
Quoth is offline   Reply With Quote
Old 08-06-2025, 07:47 PM   #19
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,818
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Slevin#7 View Post
I agree that for most pure fiction stories EPUB2 is sufficient. But there are many other scopes where full EPUB3 functionality inlcluding JS would have great benefit
Yes, it is true that if the design is not very demanding, CSS2 may be sufficient in many cases, but epubs should still be epub3 (even if they only use CSS2). If the device accepts CSS3 and you're only providing CSS2, then the users are receiving a reading experience inferior to what they can expect.

That's why all epubs should be epub3 (since they can be opened by devices that only support epub2), containing the best code available for modern devices and fallback code for older ones. This way, users with modern e-readers will get the best out of them, and users with older e-readers will still get a satisfactory, but not optimal, reading experience.

And even novels and fiction books, without demanding design, can benefit from JavaScript. How? In many of my comments, I've affirmed the convenience of having the following property declared in the stylesheet:

Code:
body {
font-size: 1em;
}
With this, all the dimensions of the other elements set to "em" are referenced to that size defined in body. So if at any point, in body, instead of "font-size: 1em" we have "font-size: 0.8em", ALL the elements of the epub set to "em" will reduce their size (it would happen the other way around if the font-size increases). And where does JavaScript intervene? Well, it's very easy with JavaScript to determine the height and width of the viewport, know the available space (we'll know if the epub was opened on a large, medium, or small screen), and thus set an appropriate font size. This way, if the script detects a large screen, it does nothing, but if it detects a small screen, it overwrites the font-size value for body in the stylesheet to, for example, 0.8em. And with just this, all the values set to "em" in the epub are reduced. Of course, this don't negate the users' ability to set the font size they prefer, but it does provide a starting point, a point of comparison, to see how the epub looks with the optimal font size based on the detected screen size.

There are also other uses of JavaScript for fiction epubs that greatly improve the layout (for example, preventing text from overflowing in a block regardless of the user-defined font size; the text will always remain adjusted to the block size). And of course, adding hyphenation on devices that don't natively support this feature. This topic was recently discussed on the Sigil forum, when I asked Kevin if he could enable the Fetch API so that the Hyphenopoly script could also work in Sigil.

Last edited by RbnJrg; 08-06-2025 at 07:54 PM.
RbnJrg is offline   Reply With Quote
Old Yesterday, 02:46 AM   #20
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,564
Karma: 169115148
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by KevinH View Post
Epub2 is dead as a spec. Amazon is not king. And Javascript when used intelligently can be useful. Perhaps it is time to let the past go.
I agree that ePub2 is no longer a consideration.

However, I would have to disagree that Amazon is not king for commercial ebooks. For the authors, I do work for, even those who have gone wide, the majority of their income is from Amazon. For that reason, I can not and will not consider adding Javascript for any purpose where it's lack would be noticed. I will have to admit Kindle take down notices were responsible for a fair chunk of my early ebook cleanup jobs and a couple of those were due to ePub3 ebooks that used JavaScript.

For my personal use, I can go wild on using advanced features but for commercial work, KISS is definitely the only way to go. I do use a mix of ePub2 and ePub3 code but that is as far as I go at this time.

Last edited by DNSB; Yesterday at 02:50 AM.
DNSB is offline   Reply With Quote
Advert
Old Yesterday, 08:22 AM   #21
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,818
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by DNSB View Post
I agree that ePub2 is no longer a consideration.

However, I would have to disagree that Amazon is not king for commercial ebooks. For the authors, I do work for, even those who have gone wide, the majority of their income is from Amazon. For that reason, I can not and will not consider adding Javascript for any purpose where it's lack would be noticed. I will have to admit Kindle take down notices were responsible for a fair chunk of my early ebook cleanup jobs and a couple of those were due to ePub3 ebooks that used JavaScript.

For my personal use, I can go wild on using advanced features but for commercial work, KISS is definitely the only way to go. I do use a mix of ePub2 and ePub3 code but that is as far as I go at this time.
I think since this is the epub forum, we shouldn't speak about Amazon here, because the epub destined to be a .azw3 or .KFX format is another kind of epub. But of course, those epubs can't have js (and many others css3 properties).
RbnJrg is offline   Reply With Quote
Old Yesterday, 01:48 PM   #22
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,564
Karma: 169115148
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by RbnJrg View Post
I think since this is the epub forum, we shouldn't speak about Amazon here, because the epub destined to be a .azw3 or .KFX format is another kind of epub. But of course, those epubs can't have js (and many others css3 properties).
Not sure if I would call it another kind of ePub but different restrictions. OTOH, I remember at one point generating separate ePubs for Amazon KDP, B&N Nook and Kobo for a couple of authors. I have no real wish to revisit those days unless there was some compelling reason to do so.
DNSB is offline   Reply With Quote
Old Today, 05:14 AM   #23
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,736
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Quoth View Post
Once you add animation or interaction or video or sound, it's no longer a book. It's best done as an app and not pretending to be a book.
Creating an app instead of an epub with JavaScript is overkill. Moreover, you'd have to maintain code bases for all supported platforms.

While most reflowable fiction epubs usually don't benefit much from JavaScript, except for adding hyphenation, JavaScript can be very useful for non-fiction books, in particular textbooks.

Years ago I saw an example of an electronics textbook that contained a formula whose values could be changed.

I created a similar example that illustrates a physics formula.
(It works fine with Thorium and ADE 4.5.)

If you wanted to do this with a static epub, you'd have to add at least 4 images to illustrate how changes to the input values affect the result.

JavaScript might also be useful for other kinds of textbooks. For example, you can use it to show/hide interlinear text.

Just because you haven't seen commercial books that use JavaScript, you shouldn't flat-out deny its usefulness or keep insisting that apps are the only way to go!
Attached Thumbnails
Click image for larger version

Name:	script_example.png
Views:	6
Size:	32.8 KB
ID:	217380  
Attached Files
File Type: epub range_js_example.epub (11.9 KB, 3 views)

Last edited by Doitsu; Today at 06:09 AM.
Doitsu is offline   Reply With Quote
Old Today, 06:12 AM   #24
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 14,227
Karma: 105299897
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Oh I have seen commercial ebooks using javascript.

Also stupid fixed layout epub3 that is more awkward than PDF. However that's nothing to do with javascript.


It may make sense to use javascript in epub3, but really creation and maintenance in the long term is no better than an app and app distribution will work to more users.

I'd like to see a reflowable epub version where footnotes don't need clicked, don't popup, and render on the same page as the source, like changing page size on the word processor. Also that no hand-coding is needed. Just a docx import. The epub2 should have had it.

1. Epub was developed for novels.

2. A mistake Web people taking over the spec prior to epub 3 as they were bound to add loads of stuff to try and compete with PDFs and apps, but lose sight of what books need.

I look forward to an epub4 with clear versions/indication of kind of thing the file is.

Last edited by Quoth; Today at 06:18 AM.
Quoth is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript in ePub. Vijay ePub 22 12-28-2023 09:43 AM
Aura {A1} epub 3.0 renderer javascript support? pluma Kobo Reader 1 01-13-2017 03:53 PM
Hints for javascript in epub ? fxp33 Kobo Developer's Corner 6 08-09-2014 01:18 PM
Javascript in ePub Techno4 ePub 9 11-05-2012 12:50 PM
epub et javascript zelda_pinwheel Software 9 12-09-2010 04:56 PM


All times are GMT -4. The time now is 12:04 PM.


MobileRead.com is a privately owned, operated and funded community.