OK. I'm assuming you already have Python installed and working.
First get the latest smartypants.py script from
here (bottom of the page). Either copy and paste the text from the browser or right-click and "save link as." Just make sure you end up with a file named "smartypants.py". (Alternatively, you can install smartypants.py as a
library module in your Python installation if you know how to do that.) I tend to use the smartypants.py script included in the calibre source.
Download and unzip the smarty-wrapper.py script from the zip-file I've attached to this post (the forum won't let me attach a .py file).
Now... put the (x)html file you want to "smarten" in a folder along with the smartypants.py file and the smarty-wrapper.py file (you can forget about the smartypants.py script if you've already installed it as a module).
From a command prompt... cd to the folder where all three files are located and issue the following command:
Code:
python smarty-wrapper.py infile.html outfile.html
Of course make sure to change infile.html to whatever the name of the file you're trying to modify really is. And change outfile.html to whatever you want your resulting new file to be called.
You can read the extensive documentation that's included in the smartypants.py script in order to modify its behavior. Just know that the default action is to smarten quotes (double and single), change -- to an mdash, and to change three consecutive periods ... into an ellipsis …