02-07-2024, 04:02 AM | #91 |
Zealot
Posts: 131
Karma: 9236
Join Date: Jun 2020
Device: Kindle PW3 [KOReader]
|
There is now a dedicated topic just for that
|
02-07-2024, 02:10 PM | #92 |
Evangelist
Posts: 461
Karma: 7897546
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
|
Fixed that for you.
Last edited by issybird; 02-07-2024 at 03:42 PM. Reason: Changed quote back to original. |
Advert | |
|
02-07-2024, 03:43 PM | #93 |
o saeclum infacetum
Posts: 20,674
Karma: 225870683
Join Date: Oct 2010
Location: New England
Device: H2O, Aura One, PW5
|
|
02-11-2024, 03:56 AM | #94 | ||
Guru
Posts: 973
Karma: 2209358
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, PocketBook InkPad Color 3
|
What sorts of automated tools are there that can help improve the HTML/CSS used in a book? For example:
There are CSS "minifier" tools that may help removing redundant declarations, though (I just tried one) and they seem to optimise for compactness and perhaps not human readability. Personally I'd kill for a tool that could correctly replace HarperCollins' awful typographical mess in their Discworld books of: Quote:
Quote:
|
||
02-11-2024, 08:18 AM | #95 | |
the rook, bossing Never.
Posts: 12,378
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
Quote:
Death speaks in all upper case / capitals. Unlike some newspaper style guides for AM PM BC AD NATO FM etc it doesn't have to be small caps or transformed sentence case. Your example of small caps entered in sentence case and transformed in is typically for the start of a paragraph after a break or heading. I'm sure there are far worse examples of crazy on HarperCollins, The house of Random Penguins, or small publishers like Lume. Gutenberg has a weird style guide and some of their content uses multiple nested blockquotes simply to change margin. Those can result in a column of broken single words. Standard eBooks goes to an opposite extreme Last edited by Quoth; 02-11-2024 at 08:21 AM. |
|
Advert | |
|
02-11-2024, 10:09 AM | #96 |
A Hairy Wizard
Posts: 3,225
Karma: 19000635
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
There isn’t going to be a completely automatic tool to do that, but there are a lot of different tools to do specific things. You just need to learn to use those tools.
The software authors use to create the book SHOULD have the option to export using a css stylesheet instead of inline styling. If you don’t have access to the source file then Sigil (or Calibre IIRC) have plugins that can do that. Regular expressions (regex) is a type of advanced search that you can use to find/replace phrases/text. It can easily make hundreds, or thousands, of changes in seconds. Just remember, with great power comes great risk (or something like that ). It can totally wreck your text if you make a mistake - so save/backup early and often. Calibre has a built-in tool called Regex Functions that can do Title Case (Sigil has a plug-in). As Quoth mentioned, DEATH speaks in all caps, but a regex wouldn’t know the difference between DEATH speaking and any other smallcaps. You, the coder, needs to make that distinction when you use the tools. (I haven’t read all the discworld books, but I don’t remember them specifying that he HAD to use all caps - it could be that was the only kind of typography they had to use at the time to give it that importance???) Regex example: Find: <div class="para">(.*?)</div> Replace: <p>\1</p> You can easily change the styling in the css stylesheet. |
02-11-2024, 10:24 AM | #97 | ||
Guru
Posts: 973
Karma: 2209358
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, PocketBook InkPad Color 3
|
Quote:
Quote:
My Corgi paperback copies are buried under a mound of other stuff so I can't check them readily. |
||
02-11-2024, 10:32 AM | #98 | |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
If it's for your own use, fine. I've also changed all those to small caps and made sure they render correctly in KOReader |
|
02-11-2024, 10:44 AM | #99 | |
Guru
Posts: 973
Karma: 2209358
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, PocketBook InkPad Color 3
|
Quote:
Judging from this ancient thread, ADE can render small-caps if the conditions are all correct. |
|
02-11-2024, 05:32 PM | #100 | |
Resident Curmudgeon
Posts: 76,491
Karma: 136564766
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
As for Death, the eBooks having him speaking in all caps but uses smallcaps instead of lowercase. So in order to make sure this works in all cases, a smaller font size is used instead of small caps in CSS. If you use font-variant: small-caps instead of a smaller font size, you can spoil the effect in programs that do not support small-caps. If you decide to use small-caps, you have to make sure that it's OK when it doesn't work. For example, 3P.M. will be OK if they are not in small-caps. Death speaking will not be OK. As for the regex example, that can be done (and more) with Diaps Editing Toolbag. It's a plugin for calibre editor and Sigil. I use it a lot. Last edited by JSWolf; 02-11-2024 at 05:41 PM. |
|
02-11-2024, 06:07 PM | #101 | |
Resident Curmudgeon
Posts: 76,491
Karma: 136564766
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Taking a Penguin eBook and just removing the HTML, image, and fonts results in a smaller ePub. Original ePub is 1604KB and then edited ePub is 1550KB. To me, that's much worse then Death speaking. That (IMHO) is a really good example of code bloat. |
|
02-11-2024, 06:14 PM | #102 | |
Resident Curmudgeon
Posts: 76,491
Karma: 136564766
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Sony Readers cannot render small-caps and there are other old Readers that also cannot. There is no fallback for small-caps except not to use it. |
|
02-11-2024, 06:55 PM | #103 | |
A Hairy Wizard
Posts: 3,225
Karma: 19000635
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
for example - and this is a simplification Jon not a proper MQ: Code:
HTML: <p>Death said "<span class="death">They could hear me roar in Middengard!</span>"</p> CSS: Media query - Does it support small-caps: death {font-variant:small-caps} Media query - Does it support text-transform but NOT small-caps: death {text-transform:uppercase; font-size:.9em} Media query - Does device support color but NOT small-caps: death {color:blue} Media query - is it Jon's e-ink device and doesn't support anything?? death {} The most basic styling (none) is still readable and makes perfect sense. The user will not complain because they aren't expecting any styling on their ancient device. That is a basic Media Query concept example. That doesn't take into account the possibilities of basic Cascading principles of CSS where the most recent style (lowest on the list) has priority. eg. Put your more capable css last in the list...if the device doesn't support it, then it will ignore it and go with what is earlier in the list. |
|
02-11-2024, 07:07 PM | #104 | |
Resident Curmudgeon
Posts: 76,491
Karma: 136564766
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
for example - and this is a simplification Jon not a proper MQ: Code:
HTML: <p>Death said "<span class="death">They could hear me roar in Middengard!</span>"</p> CSS: Media query - Does it support small-caps: death {font-variant:small-caps} Media query - Does it support text-transform but NOT small-caps: death {text-transform:uppercase; font-size:.9em} Media query - Does device support color but NOT small-caps: death {color:blue} Media query - is it Jon's e-ink device and doesn't support anything?? death {} The most basic styling (none) is still readable and makes perfect sense. The user will not complain because they aren't expecting any styling on their ancient device. That is a basic Media Query concept example. That doesn't take into account the possibilities of basic Cascading principles of CSS where the most recent style (lowest on the list) has priority. eg. Put your more capable css last in the list...if the device doesn't support it, then it will ignore it and go with what is earlier in the list.[/QUOTE] How would you write a media query that would override the font size and give you small-caps? |
|
02-11-2024, 07:20 PM | #105 |
A Hairy Wizard
Posts: 3,225
Karma: 19000635
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
I will leave that as a homework assignment…
|
Tags |
indesign, sigil |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Any Addons that aid in Library Cleanup and/or metadata repair/cleanup? | Meido | Calibre | 2 | 01-17-2018 04:49 AM |
Adobe InDesign and poor code | JSWolf | ePub | 15 | 01-18-2017 02:02 PM |
HTML cleanup on epub conversion | Lofwyr23 | Conversion | 4 | 06-06-2014 05:56 PM |
EPUB Expert Needed: Cant properly export epub from InDesign | crottmann | ePub | 17 | 08-27-2010 11:23 AM |
InDesign and epub | FredD | ePub | 2 | 04-13-2009 09:38 PM |