Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-22-2025, 10:53 AM   #1
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: 9,727
Karma: 6774572
Join Date: Nov 2009
Device: many
Suggestions for New Plugins and Plugin Improvements

Hi All,

If you have suggestions that would improve an existing Sigil plugin or ideas for new Sigil plugins, we would be happy to hear them. Note, third party plugin developers completely control their own plugins so we can not guarantee your suggestion will be implemented, but it does not hurt to ask.

Ideas for new Sigil plugins that will benefit the vast majority of users always welcome.

Thanks,
KevinH is online now   Reply With Quote
Old 06-06-2026, 08:23 AM   #2
kawayama
slower than molasses
kawayama began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Mar 2011
Location: sweden
Device: ipad
Would it be possible to make that plugin that could
rename the selected text files based on the first headline in the file?

Let's say you have a collection of short stories, all with filenames like "split0001" etc, and you want them to be named after the short story in the file, "AShortStoryTitle".

It would make it easier to reorder the stories.
kawayama is offline   Reply With Quote
Advert
Old 06-06-2026, 09:10 AM   #3
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: 9,727
Karma: 6774572
Join Date: Nov 2009
Device: many
The only problem is that changing file names means searching for and changing any links to it in the OPF, TOC, and of course in all xhtml files that might link to it. Sigil itself has concurrent threads that does this job and a whole module of code in C++ for just that purpose. No one has written its equivalent in a Sigil plugin. To do it right takes some real work. It looks like a simple change, but renaming files properly means breaking links/urls that break things like endnotes, urls, etc. Especially when you consider that identically named files may exist in an epub as long as they are in different folders. This happens a lot when compendium epubs are generated from many books.

Last edited by KevinH; 06-06-2026 at 11:09 AM.
KevinH is online now   Reply With Quote
Old 06-06-2026, 09:24 AM   #4
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: 9,727
Karma: 6774572
Join Date: Nov 2009
Device: many
You can of course use Sigil's built in Regex Rename to select a bunch of adjacent split files and of capture the number part of the name and add a new prefix to replace the "split " with something more meaningful. This is doable in Sigil right now.

Last edited by KevinH; 06-06-2026 at 12:37 PM.
KevinH is online now   Reply With Quote
Old 06-07-2026, 03:18 AM   #5
Capricorn
Belgian Pommes Frites
Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.
 
Posts: 152
Karma: 35038
Join Date: Jan 2012
Device: Pocketbook Touch HD
Sometimes, when I run the epubcheck plugin, there is an erorr that tells me I have to add properties="svg" to the titlepage entry in the opf file, when the image in the titlepage is defined as <svg>.

It does not seem to be an important error, because the epub still works on my ebook reader, when I leave the error as is.

However, this error still annoys me, and I like to remove it. Unfortunately, a regex does not help, as I need to check if an svg tag is present in the titlepage. So, a plugin would be very helpful.

I do not know if many people have encountered this error. And I do not know how diificult it would be to programm such a plugin.

It would be nice to have the option to automatically change this.
Capricorn is offline   Reply With Quote
Advert
Old 06-07-2026, 08:17 AM   #6
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: 9,727
Karma: 6774572
Join Date: Nov 2009
Device: many
Yes, adding "svg" as a manifest property for epub3 can easily be done in Sigil, no need for a Plugin. See the Sigil: Tools -> Epub3 Tools -> Update Manifest Properties menu item.

This tool need only be run once before final verification of your epub, and will walk all the epub's files and look for missing or extraneous manifest properties, and fix them. Things like missing svg, script, math, and remote OPF manifest properties that are required by the epub3 spec. It has long been part of Sigil since epub3 support was first added.

Last edited by KevinH; 06-07-2026 at 08:23 AM.
KevinH is online now   Reply With Quote
Old 06-08-2026, 01:55 AM   #7
Capricorn
Belgian Pommes Frites
Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.
 
Posts: 152
Karma: 35038
Join Date: Jan 2012
Device: Pocketbook Touch HD
Oh man.....this is cool.
If I had known about it before.....
I recently thought my knowledge was slowly getting to a decent point...........what a mistake.....
I definitely need to dive deeper into all the functionality of Sigil. Learning by doing.

Thank you for pointing out this tool.
Capricorn is offline   Reply With Quote
Old Yesterday, 12:51 PM   #8
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: 546
Karma: 10000000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
De-hyphenator

I have been reading some older books lately, and they were obviously scanned using OCR. Although there aren't a lot of problems, there are quite a few hard hyphens that were obviously from end-of-line hyphenation.

I know the logic I want to use to find these extra hyphens, but have no idea how to actually implement it.

My thought is to search for something like [ “‘’]([a-z]+)-([a-z]+)[ .,!?”’:;/-] and then feed the two tagged sequences to spellcheck. If they are both spelled correctly, skip. If not, or if the concatenation of the two tagged sequences is spelled correctly, add this match to a list that would be displayed like spellcheck does.

The logic is that a "proper" hyphen in an EPUB source will have both sides being words, and it would be very unlikely that removing the hyphen would result in a correctly spelled word. There would still be a few false positives in the list (mostly where the hyphenation is just an alternate spelling), and it would miss some compound words that just happened to be at the end of a line and got split to the next line (like "house-boat"), but it should still help.

The search part is easy...it's the "feed it to the spell checker" that I have no clue how to accomplish.

I think something like this would also be of use to users are doing their own scanning and OCR for books they own.
nabsltd is offline   Reply With Quote
Old Yesterday, 12:59 PM   #9
dandaman
Addict
dandaman doesn't litterdandaman doesn't litterdandaman doesn't litter
 
dandaman's Avatar
 
Posts: 204
Karma: 220
Join Date: May 2026
Location: London, United Kingdom
Device: Kindle PW3, Kobo Clara Colour
You could use pyspellchecker from pip if you have a bit of programming knowledge or are willing to use AI
dandaman is offline   Reply With Quote
Old Yesterday, 01:08 PM   #10
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: 9,727
Karma: 6774572
Join Date: Nov 2009
Device: many
Or use Sigil's built-in Python Function Replace. It has the capability to spellcheck.
KevinH is online now   Reply With Quote
Old Yesterday, 09:05 PM   #11
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: 9,727
Karma: 6774572
Join Date: Nov 2009
Device: many
For those interested, this Python Function Replace works of my machine.

However you need to hard code the exact paths to the hunspell dictionary .aff and .dic files you want to use. You must also specifiy the exact path of the hunspell shared library (.dll or .so or .dylib).

So modify this code to set the correct values and you should be good to.

Code:
# use spellcheck in python function replace
# Find: \w+-\w+
def replace(match, number, file_name, metadata, data):
    if number == 1:
        from pluginhunspell import HunspellChecker
        data["affpath"] = "/Applications/Sigil.app/Contents/hunspell_dictionaries/en_US.aff"
        data["dicpath"] = "/Applications/Sigil.app/Contents/hunspell_dictionaries/en_US.dic"
        data["hunspelllib"] = "/Applications/Sigil.app/Contents/lib/libhunspell.dylib"
        replace_debug_log("affpath: " + data["affpath"] + '\n')
        replace_debug_log("dicpath: " + data["dicpath"] + '\n')
        replace_debug_log("hunspelllib: " + data["hunspelllib"] + '\n')
        hsp = HunspellChecker(data["hunspelllib"])
        hsp.loadDictionary(data["affpath"], data["dicpath"])
        data["spellme"] = hsp
    if match:
        hsp = data["spellme"]
        hyphen_text = match.group(0)
        wordlst = hyphen_text.split('-')
        all_good = True
        for wrd in wordlst:
            all_good = all_good and hsp.check(wrd) == 1
        if all_good:
            return match.group(0)
        else:
            result = []
            for wrd in wordlst:
                result.append(wrd)
            return "".join(result)

Last edited by KevinH; Yesterday at 09:41 PM.
KevinH is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Suggestions for Sigil Improvements or New Features KevinH Sigil 168 11-18-2025 12:23 PM
Hello. Where do I make suggestions for future improvements? spelunker Sigil 19 02-28-2022 11:46 AM
Conversion plugins without input plugin geek1011 Development 5 04-02-2018 05:14 PM
calibre-plugins.com: A resource for plugin developers GRiker Development 2 11-19-2014 03:52 PM
Onyx M92: Suggestions for possible improvements Lode Onyx Boox 3 02-11-2013 07:40 AM


All times are GMT -4. The time now is 07:00 PM.


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