Version 0.8.0 - 11 December 2022
- Update: Tag Actions: Add Style filter.
- Update: Tag Actions: Modifications to config widget.
- Update: Tag Actions: Add ability to narrow down the nodes by css selectors.
- Fix: Tag Actions: Fix bug when specifying xpath and not configuring any tag filters.
- Fix: Search & Replace: Replace function name not loading in config widget.
- Fix: Expand Styles: Font size not updated in inline styles.
Style Property Filter
This filter allows you to locate tags by their style and apply actions on them. For example you can filter elements with a certain color or font-size and perform any of the available actions on them.
This filter has the following options:
- Text comparison operators to search for textual styles e.g. font-style "matches" italic
- Numerical operators for dimension based styles like font-size, margin-top, ... etc
- It supports the In-memory (not in the ebook itself) conversion of dimension units (px,pt,..etc) to be able to make a comparison on actual size regardless of the unit used.
To illustrate this, attached below is couple of chains that do the following:
- A chain that changes paragraphs to different headings (h1, h2, h3) based on the paragraph font-size. This first makes an In-memory (not in the ebook itself) conversion of all font-sizes to px.
- A modified version of the above chain: It adds another couple of limitations to paragraphs that will be converted to headings:
- It only applies to paragraphs with 80 letters or less. This is done by using the "Text Filter" with regex.
- For paragraphs to be converted into h1 and h2 headings, they must be centered and bold (by using two other style filters).
Starting with this version, the plugin has been added to the plugins index, and can be downloaded through calibre.