Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 09-08-2020, 02:19 PM   #1
embryo
Fanatic
embryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbit
 
embryo's Avatar
 
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?
embryo is offline   Reply With Quote
Old 09-08-2020, 02:55 PM   #2
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
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;
}
Frenzie is offline   Reply With Quote
Old 09-08-2020, 04:13 PM   #3
embryo
Fanatic
embryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbit
 
embryo's Avatar
 
Posts: 509
Karma: 60774
Join Date: Aug 2013
Device: Kobo Glo, GloHD
Quote:
Originally Posted by Frenzie View Post
From your description, maybe something like this?

Code:
p.ls {
 text-indent: 0 !important;
 margin-top: 1em !important;
}
No, maybe I didn't explained it enough.
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.
embryo is offline   Reply With Quote
Old 09-08-2020, 04:31 PM   #4
embryo
Fanatic
embryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbit
 
embryo's Avatar
 
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..
embryo is offline   Reply With Quote
Old 09-09-2020, 03:31 AM   #5
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
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.
Frenzie is offline   Reply With Quote
Old 09-09-2020, 05:02 AM   #6
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
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".
Jellby is offline   Reply With Quote
Old 09-09-2020, 05:17 AM   #7
embryo
Fanatic
embryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbit
 
embryo's Avatar
 
Posts: 509
Karma: 60774
Join Date: Aug 2013
Device: Kobo Glo, GloHD
Quote:
If there's no text inside then of course indent or not doesn't matter. 😉
Thought so..😁

Quote:
Originally Posted by Jellby View Post
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".
Good ideas, thank you..
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.
embryo is offline   Reply With Quote
Old 09-26-2020, 12:11 AM   #8
hyurte
Junior Member
hyurte began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Sep 2020
Device: kindle
Quote:
Originally Posted by embryo View Post
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.
Do those paragraphs intended as empty lines have anything between the p tags? Spaces don't count. By design, viewers will render
Code:
<p>Lots of spaces from here                    to here.</p>
as

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>
will render as

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>&nbsp;</p>
<p>Some more text...</p>
will render looking like

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.)
hyurte is offline   Reply With Quote
Old 09-26-2020, 12:18 AM   #9
hyurte
Junior Member
hyurte began at the beginning.
 
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.
hyurte is offline   Reply With Quote
Old 09-26-2020, 03:53 AM   #10
hyurte
Junior Member
hyurte began at the beginning.
 
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">&nbsp;</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.
hyurte is offline   Reply With Quote
Old 09-26-2020, 01:43 PM   #11
Ken Maltby
Wizard
Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.
 
Ken Maltby's Avatar
 
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
Ken Maltby is offline   Reply With Quote
Old 09-26-2020, 09:02 PM   #12
embryo
Fanatic
embryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbitembryo with a running start, can leap into geosynchronous orbit
 
embryo's Avatar
 
Posts: 509
Karma: 60774
Join Date: Aug 2013
Device: Kobo Glo, GloHD
Quote:
Originally Posted by hyurte View Post
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">&nbsp;</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).
Thank you for the info.
I also use <p>&nbsp;</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!!
embryo is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 02:19 AM.


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