View Single Post
Old 09-27-2014, 06:45 PM   #1
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: 27,545
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
[Plugin] PunctuationSmarten Sigil plugin

*Note: I recommend uninstalling any older versions of this plugin made for the alpha release of Sigil before installing the newer version which requires Sigil v0.8.3 and later *

*** Linux users will have to make sure that the Tk graphical python module is present if it's not already. On Debian-based flavors this can be done with "sudo apt-get install python3-tk" (or python2-tk). On Arch distributions it can be done with pacman -S tk)***

** NOTE: this plugin periodically checks for updated versions by connecting to github (where the source is maintained). See the end of this post for more details **

This plugin will work with either Python 3.4+ or Python 2.7+.

This is a Punctuation smartening plugin. It's basically the same plugin as the one I did for calibre's editor, but modified to work with Sigil. It gives you a little more granular control over the SmartyPants engine and adds the ability to define an apostrophe exceptions file for words like ('tis and such). Simply put one word per line (without the apostrophe) in a text file and it will give those words the proper apostrophe instead of a left (opening) single quote.

EDIT: also going to attach a sample apostrophe exceptions file. Be cautious that you don't include something that could be a word in its own right that just happens to follow a single quote.

PunctuationSmarten's code is hosted/maintained on Github

This plugin's update checker will only try to check for updates after at least 12 hours has elapsed since its last check. The plugin will only notify you about updates once for each new version released.

Changes
Spoiler:
v0.3.0
- redesigned to work with either Python 2.7 or Python 3.4
- make use of plugin preferences available starting with Sigil 0.8.3 (which is required)
- tweaks to smartypants' regex to deal better with unicode characters
v0.3.1
- bad version

v0.3.2
- update to make use of Sigil's upcoming autostart/autoclose feature for plugins
- files selected in Book Browser are pre-selected in plugin widget
- add update check for plugin
v0.3.3
- prevent smartypants from mangling html comments
Attached Files
File Type: txt apos_exceptions.txt (130 Bytes, 3466 views)
File Type: zip PunctuationSmarten_v0.3.3.zip (18.3 KB, 3035 views)

Last edited by DiapDealer; 04-22-2018 at 09:47 AM.
DiapDealer is offline   Reply With Quote