Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 09-29-2016, 11:45 AM   #1
nabsltd
Fanatic
nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.
 
Posts: 517
Karma: 8500000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
Feature Request: User stylesheet

The Calibre ebook viewer allows us to set a user stylesheet that gets applied to all books opened. I think the same concept in the editor would be useful, because it would allow us to more easily see the results of our edits.

Basically, if a user has a complex user stylesheet on the reader, then it's hard to tell if the edits are ending up looking right. After a while, you do get good at mentally changing the preview with what the user stylesheet does, but sometimes it's still tricky. The biggest one for me is that my user stylesheet has no space by default before/after <p> elements, so seeing if there is extra space when there should be (scene break, etc.) isn't easy.

I know I could simulate this by copying the user stylesheet and pasting it to the front of the stylesheet of the book I am editing, but then I need to remember to remove it before I save (since all my readers/devices have their own version of this stylesheet installed, tweaked for their idiosyncrasies).

Also, for some users, the "theme" functionality of the reader that allows quickly changing settings (which includes the user stylesheet) might be useful, but I suspect that's a lot more work.
nabsltd is online now   Reply With Quote
Old 09-29-2016, 11:58 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,889
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Do you understand how CSS interact?

The first word is Cascade. That means the LAST definition read prevails.

You can always import (add files) ANY valid file type
Then you link Stylesheets to the (x)HTML (the link tool allows selection of which. those not selected are unlinked)


Note: class=<name> only works if there is a matching style defined
theducks is offline   Reply With Quote
Advert
Old 09-29-2016, 01:07 PM   #3
nabsltd
Fanatic
nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.
 
Posts: 517
Karma: 8500000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
Quote:
Originally Posted by theducks View Post
Do you understand how CSS interact?

The first word is Cascade. That means the LAST definition read prevails.
Yes, I do, and I use the feature a lot by not listing every CSS property on every selector. See the attached for an example.

Note that there is no explicit declaration of "margin-top" on the paragraph, which is good coding practice for CSS, as it allows user stylesheets to override it if they wish. In the reader, the "margin-top: 0" in my user stylesheet sets that up the way I like it. Other users can choose differently, and end up with the book looking the way they like it. It also makes it easier for readers that support a "line spacing" or "paragraph spacing" option, so they can use a "default" stylesheet for these kinds of options, allowing cascade: reader default->user stylesheet->document stylesheet(s).

On the other hand, in the editor, not only does it display with a top margin that is non-zero (obviously from some built-in user stylesheet that I can't edit), but the "Computed final style" doesn't show that non-zero top margin anywhere.

The problem in this case is actually with the fact that -webkit-margin-before doesn't have a default of zero in the editor's built-in stylesheet.

Quote:
You can always import (add files) ANY valid file type
Then you link Stylesheets to the (x)HTML (the link tool allows selection of which. those not selected are unlinked)
Again, doing this means I would need to undo it before I save, so I get the correct defaults on each reader. Also, this particular change would be disastrous on the Onyx Boox M92 if I forget to undo, as the version of Cool Reader on it ignores all but the first link element on a page.
Attached Thumbnails
Click image for larger version

Name:	InReader.jpg
Views:	243
Size:	113.6 KB
ID:	152024   Click image for larger version

Name:	InEditor.jpg
Views:	243
Size:	83.7 KB
ID:	152025  
nabsltd is online now   Reply With Quote
Old 09-29-2016, 01:26 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,163
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Trying to simulate how a user stylesheet on a device will work in the editor is not so straightforward. It depends on how the user stylesheet is implemented in the device. For instance, some readeing software simply insert the stylesheet as an extra sheet in the document, at the start or at the eend. Some use the webkit user stylesheet facility, and so on. So just inserting a user sheet in the editormay or may not simulate what the sheet does on the device accurately.
kovidgoyal is offline   Reply With Quote
Old 09-30-2016, 11:59 PM   #5
nabsltd
Fanatic
nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.
 
Posts: 517
Karma: 8500000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
Quote:
Originally Posted by kovidgoyal View Post
So just inserting a user sheet in the editormay or may not simulate what the sheet does on the device accurately.
Agreed, but it works pretty well on the Calibre reader...books display on it almost exactly the same as on my other readers, because they all use different user stylesheets.

Mostly, I just want to be able to undo the bad webkit defaults. I know I could do that by installing from source and changing to what I want, but that can get tedious with the rapid release schedule of Calibre (which is one of the things I like about it).
nabsltd is online now   Reply With Quote
Advert
Old 10-01-2016, 01:43 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,163
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Actually running from source is trivial. Just set a single environment variable and if you want to update calibre, run a single git pull command. https://manual.calibre-ebook.com/develop.html

But, I have no problem with adding a stylesheet setting to the editor. It's just that I am a bit swamped at the moment, so open a bug report requesting the feature, and I'll get to it when I can.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Feature Request: Mask calibre server connection string with user configurable name Zealousky Calibre Companion 8 02-20-2015 08:17 AM
User agent stylesheet: a proposal roger64 Editor 4 12-27-2014 02:00 AM
Feature request: Cleaning stylesheet Terisa de morgan Editor 7 01-26-2014 10:24 AM
Novice - Need help with user stylesheet Dan__ Library Management 2 01-27-2013 05:59 AM
User Stylesheet for Adobe Digital Editions wallcraft ePub 6 09-15-2009 03:53 PM


All times are GMT -4. The time now is 11:40 AM.


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