Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 04-22-2021, 02:29 AM   #406
AlanHK
Fanatic
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 597
Karma: 300000
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by KevinH View Post
It will not be changed, especially when doing it inside Sigil would be much faster than doing it via python in a plugin. No reason at all to duplicate that code.
All right, you don't think it's worth your time, but come on: "doing it inside Sigil would be much faster than doing it via python in a plugin".
If the plugin does it it will take microseconds. About 1 million times faster than me doing it manually. If I remember to do it.

It's not pure laziness. Years ago I used to hack epubs and create my own NAV file to get a pseudo epub3 that would work with iBooks. So I know how to do it manually.

But I still get tripped up. A few days ago I converted an epub2 to epub3, loaded it into Apple Books. Worked OK.
Went on to make some tweaks. Did an epubcheck and so changed the filenames, which I had not noticed earlier. Deleted the first version on the iPad and loaded the new one. Books crashes out. Tried over and over and eventually found that it is a "feature" that it caches bookmarks and other metadata, even if you delete the book; so when it could not find any of the original filenames, it blew up. A stupid way to handle the anomaly but it's the target platform. Apple don't care if your homemade epubs screw up. The solution was to change the title metadata so it appeared to be a different book.

I know you have no sympathy for Apple users, but many of us are compelled to use them and as I don't make epub3s that often, remembering to fix this by hand can slip my mind.
AlanHK is offline   Reply With Quote
Old 04-22-2021, 03:07 AM   #407
BeckyEbook
Evangelist
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 466
Karma: 1497025
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
@KevinH: So maybe to avoid the problem after conversion, give a warning about it? It's not about laziness either, but a reminder that there is still "something" to be done before starting the plugin so that everything goes according to plan.

Something like that:
Spoiler:
Code:
    file_list = list(bk.text_iter())
    for (html_id, href) in file_list:
        filename = os.path.basename(href)
        if bk.launcher_version() >= 20190927:
            filename = bk.id_to_bookpath(html_id)

        if not '.xhtml' in filename:
            print("Error: ePub3-itizer requires .xhtml extension for html files")
            print("Change the extension for all html files to .xhtml and run the plugin again")
            return -1
BeckyEbook is offline   Reply With Quote
Advert
Old 04-22-2021, 06:39 AM   #408
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 24,560
Karma: 167414566
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
@AlanHK: Patches welcome. If someone wanted to port the Sigil C++ code that updates every link in every file, manifest, index, toc, guide-reference, footnote, and css url in every epub to Python to be used in this one Sigil plugin, I'm sure adding it to this one would be considered. But for most, porting something that complicated and invasive is not something that lends itself well for use in individual plugins. Especially when it would have to be kept in sync with any future C++ bug-fixes/behavior-changes for the rest of time.

But if someone were to volunteer their time to mirror and maintain Sigil's inherent file renaming, and link-parsing/updating routines in a safe, reusable Python module that could be added to Sigil's plugin framework, I'm sure many plugin devs would be appreciative of the contribution. It would have to be limited to input/output plugins, though, since there is no file renaming ability for Sigil edit plugins.

Hell of a lot of work to undertake for someone, though. Just to take care of something someone could easily remedy by RTFM and then jotting down their own pre-conversion checklist.

Last edited by DiapDealer; 04-22-2021 at 12:03 PM.
DiapDealer is offline   Reply With Quote
Old 04-22-2021, 08:42 AM   #409
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 5,775
Karma: 3571874
Join Date: Nov 2009
Device: many
And doing it in python would be much slower unless you design a set of concurrent worker threads to walk each html file, the ncx, nav, and opf just like it exists in C++ code used now and the support code around it. It is just not worth doing.

Just run epubcheck after conversion to catch any issues. And as DiapDealer says ... RTFM.
KevinH is online now   Reply With Quote
Old 04-22-2021, 10:06 AM   #410
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 5,775
Karma: 3571874
Join Date: Nov 2009
Device: many
They really should be running epubcheck after conversion as well and epubcheck will issue the same warning.



Quote:
Originally Posted by BeckyEbook View Post
@KevinH: So maybe to avoid the problem after conversion, give a warning about it? It's not about laziness either, but a reminder that there is still "something" to be done before starting the plugin so that everything goes according to plan.

Something like that:
Spoiler:
Code:
    file_list = list(bk.text_iter())
    for (html_id, href) in file_list:
        filename = os.path.basename(href)
        if bk.launcher_version() >= 20190927:
            filename = bk.id_to_bookpath(html_id)

        if not '.xhtml' in filename:
            print("Error: ePub3-itizer requires .xhtml extension for html files")
            print("Change the extension for all html files to .xhtml and run the plugin again")
            return -1
KevinH is online now   Reply With Quote
Advert
Old 04-22-2021, 01:10 PM   #411
odamizu
just an egg
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 1,359
Karma: 2238734
Join Date: Mar 2015
Device: Kindle Oasis1 & Voyage, iOS
Quote:
Originally Posted by KevinH View Post
They really should be running epubcheck after conversion as well and epubcheck will issue the same warning.
I agree. I regularly forget to change html to xhtml before epub3-itizing. But I always run epubcheck after I'm done editing my new epub3. It flags my error. I fix the filenames in Sigil, run epubcheck again, and all is good. I don't need the plugin to issue a warning.
odamizu is offline   Reply With Quote
Old 04-22-2021, 01:25 PM   #412
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 5,775
Karma: 3571874
Join Date: Nov 2009
Device: many
Or exit since the rename to .xhtml could technically come before or after ePub3-itizer is run.
KevinH is online now   Reply With Quote
Old 04-22-2021, 01:43 PM   #413
odamizu
just an egg
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 1,359
Karma: 2238734
Join Date: Mar 2015
Device: Kindle Oasis1 & Voyage, iOS
Well, usually what happens is I run ePub3-itizer, edit book, run epubcheck, then forgot to rename to .xhtml!

In that case, it's easier to rename to .xhtml than to start all over since I've already done some editing.

Though the more this happens, the more I remember to rename to .xhtml without being prompted

Quote:
Originally Posted by KevinH View Post
Or exit since the rename to .xhtml could technically come before or after ePub3-itizer is run.
odamizu is offline   Reply With Quote
Old 04-22-2021, 09:11 PM   #414
AlanHK
Fanatic
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 597
Karma: 300000
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by DiapDealer View Post
if someone were to volunteer their time to mirror and maintain Sigil's inherent file renaming, and link-parsing/updating routines
I had assumed that a plugin could call the file rename function in Sigil, making it a trivial operation, rather than having to reimplement it from scratch.
But from your reply it seems that is not the case.

Perhaps then it could just check if there are any .html files and warn the user these are non compliant after conversion, or even before conversion and ask if it should proceed.

Maybe you don't need such a reminder, some of us do.
AlanHK is offline   Reply With Quote
Old 04-22-2021, 10:22 PM   #415
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 5,775
Karma: 3571874
Join Date: Nov 2009
Device: many
Then code it up and add it to your version. BeckyEbook's code shows the correct way to handle it.

As I have already explained, the instructions are clear on how to use the plugin, and running epubcheck afterwards is much better than a single check for xhtml file extensions.
KevinH is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Conversion Output] KePub Output Plugin jgoguen Plugins 489 09-08-2021 03:48 PM
Create a javascript quizz for Epub3 in Sigil BertrandThibaut Sigil 3 01-26-2014 09:04 AM
An epub3 version of Sigil ? apulia03 Sigil 9 11-28-2012 01:07 AM
Plugin not customizable: Plugin: HTML Output does not need customization flyingfoxlee Conversion 2 02-24-2012 02:24 AM
epub3 Sigil Poetry(fixed layout) Giggleton Sigil 7 04-04-2011 12:58 PM


All times are GMT -4. The time now is 10:14 PM.


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