TagMechanic: conveniently remove, change the attributes of (and/or convert to different html elements) those pesky, nestable spans and divs (as well as a few others for convenience).
This is a "rebranding" of my "Span/Div Editor" calibre-edit plugin for those who may remember and/or use it.
Minimum Sigil requirement: v0.8.900 or higher
Python Requirements: Python 3.4+ (Bundled or external) or Python 2.7+
OS Requirements: Windows/Linux/OS X
*** 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" for python 3 or "sudo apt-get install python-tk" for Python 2. ***
1) This plugin operates on the Text files selected/highlighted in Sigil's Book Browser, so make sure you highlight the files you want to work with before launching the plugin.
2) Then choose the action you wish to perform (modify/delete), select the tag you want to perform that action on, the attribute you want to match (No attributes means you want to work with those elements that HAVE no attributes at all) and the value that that attribute should have. If the value you entered is a regular expression, check the regex box (capture groups cannot be reinserted later so they will be ignored if present). Otherwise, it is assumed that what you have entered in the New Attribute box is a literal string.
3) If you've chosen to modify a tag, you need to specify whether you want to change the tag to another tag, or change its attributes, or both. If you've chosen to change the tag to something else, then you need to enter all the attributes you want (or check the box to copy the existing attributes) otherwise the tag will be changed to the new tag with no attributes if left empty.
Configuration: Right-clicking anywhere on the Plugin's dialog box should give you the option to customize the plugin. In that dialog, you'll be able to change/add/remove what tags are available to change the various tags to. You can also change/add/remove things the list of attributes to look for. They're just comma-separated lists of elements/attributes, get cute and you might break something. There's a Reset to Default button if you get in trouble.
After seeing the general report of what was done (or not done), you'll have the opportunity to commit the changes, or to bail out if you get chicken. ;)
TagMechanic'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. No nagging, I promise.
Changes
v0.4.1
This is a "rebranding" of my "Span/Div Editor" calibre-edit plugin for those who may remember and/or use it.
Minimum Sigil requirement: v0.8.900 or higher
Python Requirements: Python 3.4+ (Bundled or external) or Python 2.7+
OS Requirements: Windows/Linux/OS X
*** 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" for python 3 or "sudo apt-get install python-tk" for Python 2. ***
1) This plugin operates on the Text files selected/highlighted in Sigil's Book Browser, so make sure you highlight the files you want to work with before launching the plugin.
2) Then choose the action you wish to perform (modify/delete), select the tag you want to perform that action on, the attribute you want to match (No attributes means you want to work with those elements that HAVE no attributes at all) and the value that that attribute should have. If the value you entered is a regular expression, check the regex box (capture groups cannot be reinserted later so they will be ignored if present). Otherwise, it is assumed that what you have entered in the New Attribute box is a literal string.
3) If you've chosen to modify a tag, you need to specify whether you want to change the tag to another tag, or change its attributes, or both. If you've chosen to change the tag to something else, then you need to enter all the attributes you want (or check the box to copy the existing attributes) otherwise the tag will be changed to the new tag with no attributes if left empty.
Configuration: Right-clicking anywhere on the Plugin's dialog box should give you the option to customize the plugin. In that dialog, you'll be able to change/add/remove what tags are available to change the various tags to. You can also change/add/remove things the list of attributes to look for. They're just comma-separated lists of elements/attributes, get cute and you might break something. There's a Reset to Default button if you get in trouble.
After seeing the general report of what was done (or not done), you'll have the opportunity to commit the changes, or to bail out if you get chicken. ;)
TagMechanic'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. No nagging, I promise.
Changes
v0.4.1
- Port from calibre/Qt to Sigil/Tkinter