Thread: Plugin guide
View Single Post
Old 07-20-2015, 09:52 AM   #1
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 202
Karma: 62362
Join Date: Jul 2015
Device: Sony
Plugin guide

Recently I was pleased to see that development on Sigil is continuing and that the latest version of Sigil accepts plugins.

When I convert scanned PDF files into ePubs, a number of formatting errors arise and I run a series of Find/Replace operations to correct some of these errors. As I sometimes forget to run some searches I decided to put some of these operations into a plugin. However, information about writing plugins for Sigil is sparse, so I have have produced a very brief guide (attached) on how to write plugins that incorporate regular expressions and hope this will be useful to others.

I am also attaching a plugin that corrects some formatting errors that are produced when converting PDFs to ePubs. I am new to Python so I would be interested in comments on my code - there may be better ways of coding the plugin.

I will continue to develop the plugin (eg I will be including code for dealing with erroneous line breaks when I get time).
Attached Files
File Type: pdf Writing Plugins for Sigil.pdf (642.5 KB, 1723 views)
File Type: epub Writing Plugins for Sigil.epub (15.6 KB, 798 views)
File Type: zip CorrectFormatErrors2A.zip (3.9 KB, 647 views)

Last edited by CalibUser; 08-09-2015 at 05:56 AM. Reason: Updating attachments
CalibUser is offline   Reply With Quote