|
|
#16 | |
|
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 15,442
Karma: 114319649
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
Quote:
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. |
|
|
|
|
|
|
#17 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,930
Karma: 9600001
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
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;
}
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. |
|
|
|
|
|
|
#18 | |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 51,689
Karma: 179962432
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
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; 08-07-2025 at 02:50 AM. |
|
|
|
|
|
|
#19 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,930
Karma: 9600001
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
|
|
|
|
|
|
|
#20 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 51,689
Karma: 179962432
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
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.
|
|
|
|
|
|
#21 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,818
Karma: 24222221
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
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! Last edited by Doitsu; 08-08-2025 at 06:09 AM. |
|
|
|
|
|
|
#22 |
|
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 15,442
Karma: 114319649
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; 08-08-2025 at 06:18 AM. |
|
|
|
![]() |
|
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 |