![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
style filtering?
Using the latest Calibre editor (3.44).
Usually (for the last two or three years I would say), when producing an ePub, I automatically join a second stylesheet, voluntarily oversized. Then, I edit the book by picking up and adding some additional styles or rules named on this second stylesheet. Last I remove the unused styles or rules, blend the two stylesheets and reorder the remaining one. I was unable to work this way because the Calibre editor removed automatically all the unused styles or rules before I started modifying anything. It is very frustrating. Is it an intended behaviour? Last edited by roger64; 06-14-2019 at 10:07 AM. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The calibre editor does not make *any* automated changes to a book whatsoever. Arre you sure you are not confusing it with Sigil? The only way it will remove unused styles is if you use the remove unused styles tool.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
![]() Sorry for this. Thanks for your reply and support. Last edited by roger64; 06-14-2019 at 10:49 AM. |
|
![]() |
![]() |
![]() |
#4 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,168
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Ummm... Sigil also needs the user to trigger removing unused styles. I've never had calibre or Sigil remove a style from a stylesheet without my triggering a unused style check.
|
![]() |
![]() |
![]() |
#5 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,718
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I wasn't claiming it removes styles automatically, but, at least the last time I used it, it did make lots of changes automatically, simply by opening a book. This was actually one of the primary things I set out not to do when writing the calibre editor.
|
![]() |
![]() |
![]() |
#7 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,168
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
Given that I've seen a fair number of epubs which did not follow the specification (OCF 2.01)which says there must be a mimetype file in the root and a META.INF directory containing the container.xml file (OCF 3.2 adds 5 other XML files that can be stored in META.INF) while leaving other file locations up to the creator of the epub container file other than not storing them in META.INF, I am ambivalent about disabling Sigil's default directory structure given that it does logical separation of text, styles, images etc. which makes my life easier when editing. I would prefer if it was an option rather than being forced when saving but I would likely turn that option on. Now if Sigil and calibre's editor made epubcheck mandatory rather than a plugin... Time to step back from that soapbox. |
|
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
changing directory structure involves much more than just moving files around, you have to re-write the contents of all those files as well to update links/references. Anyway, I am not critcizing Sigil, I was just wondering if the OP had confused the two since not automatically making changes to the book is one of the calibre editors core goals.
|
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
From the OP
Mistakes are mine. ![]() Calibre behaviour (do not modify anything if not expressly asked for by the user) is right. |
![]() |
![]() |
![]() |
#10 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,760
Karma: 5706256
Join Date: Nov 2009
Device: many
|
FWIW, I agree that not changing the original structure is generally a good thing. After Sigil releases it QtWebEngine branch and PageEdit next week, my next project will be to add an option to *not* restructure the ePub when editing no matter how inane or broken the original structure
![]() |
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Congrats on moving to web engine
![]() |
![]() |
![]() |
![]() |
#12 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,760
Karma: 5706256
Join Date: Nov 2009
Device: many
|
I am sure you are aware of most of the following but I was not ...
The asynchronous nature of QtWebEngine is way way too understated in the official docs. For example loading (as before), getting plain text or html (as documented), running javascripts (documented) are asynchronous but so are rendering (comes after loading with no signal to say rendering is complete!), grabbing focus (especially in headless mode but no signal to say you have focus), text selection (but at least there is a signal) and etc are all asynchronous and can cause issues depending on your design. In fact, I have run into many issues due to the lack of signals when trying to run in headless mode just to use a webview to extract text from an element or an entire page due to lack of signals (see QTBUG-75505). Then there is the need to override the acceptNavigationRequest in QWebEnginePage to handle links pressed but the underlying model has already generated the loadStarted() signal (BEFORE acceptNavigationRequest has returned!) and if you decide to handle a specific link type and return (false for it) the engine later generates a loadFinished(false) even though no load was ever done. (See QTBUG-75185) The false loadStarted() and loadFinished(false) can interfere with loading and running javascripts as well. I had to add state variables to determine if and when it was perfectly safe to inject/run javascript tracking all load started and loadFinished. Then there is api documented mouse, and key event handling routines that simply do NOT work (they are never invoked) as many of the user based events are handled by a delegate. So you have to add an event listener at the start and then look for new delegate being added to the QWebPageEngine and then installing listeners on them as they are handled. I still have not figured out why these delegates die and go away (seemingly at random at times). With the lack of signals for getting focus, rendering, etc, you really have to just hope that the user waits for the window to actually render before trying stuff. In fact, the whole design (when no required signals are provided) actually is very racey and I am not a fan of it. I think they should have designed a minimal set of signals to track at least the major states of the system including loading, focusing, and rendering to say the very least. We are not sure how robust the Preview Window is under QWebEngine and simple editing used in our PageEdit (extracted all of BookView as it was a PITA) into a simpler QtWebEngine separate app. Hoping to release the beta in a week or two just to finally see what has to be worked on to get something stable. All in all a good time was had by all ![]() Last edited by KevinH; 06-18-2019 at 11:07 AM. |
![]() |
![]() |
![]() |
#13 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,760
Karma: 5706256
Join Date: Nov 2009
Device: many
|
For the record, I studied both the qupzilla, and otter QWebEngine browser implementations to actually see a working model that handled real world stuff. Luckily both exist on github and have some good example working code (and some required workarounds).
|
![]() |
![]() |
![]() |
#14 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yeah in my attempts I quickly decided Qt's API was mostly rubbish and did everything I possibly could in javascript. All the application logic runs in javascript. I rely on Qt for as little as possible.
|
![]() |
![]() |
![]() |
#15 | |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
so porting calibre stuff to it was relatively painless, in comparison. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Style Sheet entry for a 'hanging' style | AThirstyMind | Kindle Formats | 6 | 12-10-2016 12:28 AM |
Search not filtering? | VelvetElvis | Library Management | 5 | 05-30-2014 05:12 AM |
Possible calibre filtering? | Glenndk | Calibre | 0 | 07-31-2010 01:34 PM |
Mobi TOC style vs ePub style? | phearlez | Kindle Formats | 3 | 04-11-2010 06:35 AM |
0.6.4 and filtering by tags | itimpi | Calibre | 3 | 08-01-2009 01:43 PM |