09-08-2020, 02:19 PM | #1 |
Fanatic
Posts: 509
Karma: 60774
Join Date: Aug 2013
Device: Kobo Glo, GloHD
|
Style tweak?
Never made any custom tweaks, but I use some of the build in and are very handy.
I'm now away from my PC (vacations) with only my mobile with me and I wonder if there's a way to make all the <p class="ls" /> in an epub to <br/> or something else that KOReader recognize (just a blank line between paragraphs) using the custom style tweaks? Tried to find where the existing ones are located so I could understand the format used, but had no luck. I only found an empty folder (style tweaks?) inside the KOReader's directory. Suppose I could create a new file using the Text editor? |
09-08-2020, 02:55 PM | #2 |
Wizard
Posts: 1,617
Karma: 724945
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
|
From your description, maybe something like this?
Code:
p.ls { text-indent: 0 !important; margin-top: 1em !important; } |
09-08-2020, 04:13 PM | #3 | |
Fanatic
Posts: 509
Karma: 60774
Join Date: Aug 2013
Device: Kobo Glo, GloHD
|
Quote:
The book I read uses the "ls" class as a separator (an empty line) between some parts of every chapter. For some reason this doesn't show up in the book rendering. Maybe the stylesheet is broken or has something that the crengine doesn't support. Since I can't fix it (no PC), I thought maybe I could replace it with something more standard like a line break.. Edit: just reread your code and saw what you meant.. I'll try it and post the results. ) Last edited by embryo; 09-08-2020 at 04:17 PM. |
|
09-08-2020, 04:31 PM | #4 |
Fanatic
Posts: 509
Karma: 60774
Join Date: Aug 2013
Device: Kobo Glo, GloHD
|
It worked!
Thank you @Frenzie One question though.. Do we really want the indent set? I took it out and it works as it should.. |
09-09-2020, 03:31 AM | #5 |
Wizard
Posts: 1,617
Karma: 724945
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
|
If there's no text inside then of course indent or not doesn't matter.
|
09-09-2020, 05:02 AM | #6 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
It's an empty tag, so there's no content (unless specified with css). You may want to add page-break-after:avoid and/or turn the margin into padding, for cases where the element falls at a page/screen boundary. Or set some asterism/ornament as "content".
|
09-09-2020, 05:17 AM | #7 | ||
Fanatic
Posts: 509
Karma: 60774
Join Date: Aug 2013
Device: Kobo Glo, GloHD
|
Quote:
Quote:
I'm thinking about creating a generic css for this when I get back (and can check it better).. With that, I will just have to find the (currently) right selector and use it with any book. It happens allot to me but I never had thought about this solution..👍 Last edited by embryo; 09-09-2020 at 07:14 AM. |
||
09-26-2020, 12:11 AM | #8 | |
Junior Member
Posts: 9
Karma: 10
Join Date: Sep 2020
Device: kindle
|
Quote:
Code:
<p>Lots of spaces from here to here.</p> Lots of spaces from here to here. I had to wrap the line in code tags because 19 of those 20 spaces in the middle wouldn't otherwise render in my browser, which is by design not an error. Code:
<p>Some text...</p> <p> </p> <p></p> <p>Some more text...</p> Some text... Some more text... because both of those paragraph tags in the middle are surrounding effectively nothing, even if one does contain an ordinary space character, and are effectively ignored. However Code:
<p>Some text...</p> <p> </p> <p>Some more text...</p> Some text... Some more text... because that non breaking space isn't ignored but is often drawn even if it is invisible. (However, while I pasted a non breakspacing in that line and it's still in this edit window it's not selectable in preview. It is selectable in other applications.) |
|
09-26-2020, 12:18 AM | #9 |
Junior Member
Posts: 9
Karma: 10
Join Date: Sep 2020
Device: kindle
|
I'm a new user embryo so my reply is awaiting moderator approval and I can't edit it.
I overlooked that you specified <p/>. As self closing paragraphs are without content they will be ignored just as surely as <p></p> are ignored. |
09-26-2020, 03:53 AM | #10 |
Junior Member
Posts: 9
Karma: 10
Join Date: Sep 2020
Device: kindle
|
Many viewers will ignore information that doesn't make sense to them. Web browsers and the Calibre epub editor will, for example, display a string of spaces as a single space and empty paragraphs or paragraphs with only space characters like these
<p> </p> <p></p> <p/> are essentially ignored. They don't exist and, as you've discovered, won't add the blank line you want. However, a paragraph containing a non-breaking space will work as desired. Replace any <p class="ls" /> with <p class="ls"> </p> and you'll get a blank line. I've done it many times and KOReader handles it fine. On some systems the non-breaking space may be highlightable and selectable (like Calibre epub editor) or not (like my web browser on this forum). Note: My post above of 18 minutes past the hour (or 48 minutes past the hour if you use a half hour time zone) was an addendum to an earlier post that I was told was going to go to a new user moderator a few hours ago. The first post has not appeared but the second one has, it's a mystery. I've tried to capture the essence of the missing post here in case it never reappears. |
09-26-2020, 01:43 PM | #11 |
Wizard
Posts: 4,465
Karma: 6900052
Join Date: Dec 2009
Location: The Heart of Texas
Device: Boox Note2, AuraHD, PDA,
|
Sorry, old and slow I guess, just got online.
Luck; Ken |
09-26-2020, 09:02 PM | #12 | |
Fanatic
Posts: 509
Karma: 60774
Join Date: Aug 2013
Device: Kobo Glo, GloHD
|
Quote:
I also use <p> </p> when I want to insert a blank line, and its working OK. The reason I wanted the tweak, is for those times I get a book that uses something else that does not work for some reason. Since I can't edit the book with my reader, I had to read it like that. Without breaking lines.. Well, not anymore!! |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
User style tweak not working | sladflob | KOReader | 4 | 07-28-2021 02:11 AM |
Forma Should I get the origami-style case or the simple one-fold-style for my Forma? | droopy | Kobo Reader | 8 | 08-25-2019 05:15 PM |
Trying to tweak calibre | BluffOwl | Introduce Yourself | 1 | 03-22-2019 01:33 AM |
Style Sheet entry for a 'hanging' style | AThirstyMind | Kindle Formats | 6 | 12-10-2016 12:28 AM |
Mobi TOC style vs ePub style? | phearlez | Kindle Formats | 3 | 04-11-2010 06:35 AM |