02-07-2024, 12:01 PM | #16 | |
Zealot
Posts: 131
Karma: 9236
Join Date: Jun 2020
Device: Kindle PW3 [KOReader]
|
Quote:
|
|
02-07-2024, 12:03 PM | #17 | |
Resident Curmudgeon
Posts: 74,703
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
So if I have <h2 id="chapter01">Chapter 01</h2> and I have the ToC reference the ID instead of just going to the start of the HTML file, it will be slower. The only time an ID is needed in the ToC is when you are going to someplace that's not the top of the HTML. There is nothing wrong with removing unused IDs. You don't see them. They don't do anything. They are not referenced for anything. You can't referenced them. You cannot go to a specific ID or page number (based on some pBook version). They don't do anything. If someone can show how to reference an unused ID in an eBook while viewing it, please do so. IDs do not reference anything external. They either there for a reason and they get used or they are extraneous and have no need to be there. I've seen errors in a house CSS. The problem then becomes that they keep using it and the error stays because it could be in a not often used class. Removing code you don't need is not a bad idea. But it is up to you to do so or not. When editing an eBook to be published, it's a good idea not to have any extra code. In calibre or Sigil, it's trivial to remove unused CSS. CSS is there to override defaults if needed. But there's no need to 0 out all sorts of tags. You set them as they are needed. Adding in your own CSS is not an issue. I don't add in all that much CSS. If it clashes with the existing CSS, I'll fit it so that's not an issue. You do not have to worry about any sort of inherited values. None of the CSS I add has any errors. The changes I make are my choice. But they are not wrong. The format of the eBook is based on the publisher's format and it works to be the way I prefer. I don't like large space in chapter headers, like the based font size to be the default size. I don't like a smaller font size in offset text, I don't like large indents. I don't like paragraph spaces. I don't like space for section breaks. I don't like large first letter or drop-cap. I don't like large margins or large line-height. Some emendded fonts I don't want so I remove the embedded fall or some of the embedded fonts. for example, Adobe Garamond Pro is used a lot of the base font to emulate the pBook. It's too light and I don't to read with it. So I remove it and use the font of my choice. Stripping or changing code that does some of these things is not wrong. I have a Kobo and it has settings for font, font-size, margins, and line height. So I have to remove code for the font size if it makes the base font size smaller then 1em. Overall L/R margins get removed and left at 0. Line-height gets removed so I can set it how i like. When I am done, the code is very clean and works as expected. Nothing I do is incorrect. |
|
Advert | |
|
02-07-2024, 12:04 PM | #18 |
Resident Curmudgeon
Posts: 74,703
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
You did not say you had an index. Nobody would know that without you saying so. But you don't need two IDs right after each other. If you need to go to that location via an ID, you can use just one of them.
|
02-07-2024, 12:12 PM | #19 |
Sigil Developer
Posts: 7,762
Karma: 5446592
Join Date: Nov 2009
Device: many
|
Yes removing ids can in fact break external links into the epub (see the cfi spec used by most Readium based platforms and calibre as well). They can be used in toc's, pagelists, references for internal javascript, and of course references used for linking.
As a page is loaded, a hash table of ids to dom nodes is created faster than the io of the file on the disk can be done. Jumping to an id is basically instantaneous in epub readers unless the page itself is absolutely huge (entire book all in one file). Please cite the exact speed test for loading a page you talked about. There would have to be an excessive number of ids and tons of images to load to make even a slight difference. Last edited by KevinH; 02-07-2024 at 12:16 PM. |
02-07-2024, 12:13 PM | #20 | |
Zealot
Posts: 131
Karma: 9236
Join Date: Jun 2020
Device: Kindle PW3 [KOReader]
|
Quote:
Code:
Lorem ipsum <a id="_idTextAnchor005"></a> dolor sit amet ... <p>Term<a href="part1.xhtml#_idTextAnchor005">5</a></p> |
|
Advert | |
|
02-07-2024, 12:14 PM | #21 |
Zealot
Posts: 131
Karma: 9236
Join Date: Jun 2020
Device: Kindle PW3 [KOReader]
|
|
02-07-2024, 12:17 PM | #22 |
Zealot
Posts: 131
Karma: 9236
Join Date: Jun 2020
Device: Kindle PW3 [KOReader]
|
|
02-07-2024, 12:53 PM | #23 |
Sigil Developer
Posts: 7,762
Karma: 5446592
Join Date: Nov 2009
Device: many
|
Just for the record, if I am developing an epub for someone (ie. have complete control of the design and layout that has not been made publicly available yet) then I do follow the KISS principle advocated by JSWolf, and do not in general add complexities that may not be well supported by any number of older epub e-readers out there. Of course Accessibility must still be thought about and supported as fully as possible.
I just do not modify other people epub designs and layout without very good reason. |
02-07-2024, 01:01 PM | #24 | |
Evangelist
Posts: 420
Karma: 6913952
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
|
Quote:
|
|
02-07-2024, 01:18 PM | #25 | |
the rook, bossing Never.
Posts: 11,729
Karma: 87663463
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
Quote:
Also I don't edit bought books unless they are too irritating on the ereader, or cause it to "crash" (both actually rare). I do leave drop caps, small caps etc alone if they are working. I have some automatic transforms of a minor nature on conversions and for PD like Gutenberg use the automatic paragraph style swap (which usually only affects body) and puctuation smarten of Calibre. |
|
02-07-2024, 01:25 PM | #26 |
Sigil Developer
Posts: 7,762
Karma: 5446592
Join Date: Nov 2009
Device: many
|
@nabsltd,
That approach would miss or break ids used by the epub2 toc.ncx which use <content src="blah#fragment">, and of course break the opf guide urls if they used fragments, and any ncx pagelists or adobe pagmap.xml use of fragments. Not to mention epub3 external cfi urls that use fragments, external bookmarks that use fragments, javascript uses to dentify nodes in the dom, etc. |
02-07-2024, 01:43 PM | #27 | |
Bibliophagist
Posts: 36,972
Karma: 148318166
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
Edit: As for complaining about the stylesheet in Random in Death, like most stylesheets in ebooks published by major publishers, that stylesheet is used for many different books so unused stylesheet entries are to be expected. Much like in the Vellum stylesheets that you love grumbling about. Last edited by DNSB; 02-07-2024 at 02:07 PM. |
|
02-07-2024, 01:50 PM | #28 | ||
Resident Curmudgeon
Posts: 74,703
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Quote:
|
||
02-07-2024, 02:17 PM | #29 | |
Bibliophagist
Posts: 36,972
Karma: 148318166
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
I did a quick test with a epub that has multiple subchapters within it's mass of chapters using a Kobo Sage. To the naked eyeball, going from the ToC to chapter 103 did not take any more time than going from the ToC to a subchapter in chapter 103. The chapter 103 link is to the xhtml file, the subchapters links are to an id. Using my iPhone to record the process, both took the same number of frames at 30fps from when the link went dark to when the text was displayed (averaged over 5 tests of chapter and subchapter) so any differences in timing were less than 30ms. Doing this test did reinforce my wish that you could collapse the ToC. |
|
02-07-2024, 02:26 PM | #30 |
Resident Curmudgeon
Posts: 74,703
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Nook S2 vs regular S2--bloat vs bucks?? | friedrice | Which one should I buy? | 5 | 05-05-2016 11:54 AM |
After I Edit Code, Save, and Convert, all my Code Edits are Gone | lukewrussell | Calibre | 1 | 03-14-2014 08:05 PM |
Some code help | Gray Eminence | Sigil | 3 | 12-31-2010 09:18 AM |
code help | AWOL | Sigil | 7 | 11-19-2010 11:50 AM |
Let's create a source code repository for DR 800 related code? | jraf | iRex | 3 | 03-11-2010 12:26 PM |