Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 06-19-2020, 07:23 AM   #1
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 522
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
[Plugin] StylePropertiesCleanup

Globally removes user selected style properties from the CSS or html files.

Requirements
Plugin Type: Edit
MIT Licence(OSI)
Minimum Sigil requirement: v0.9.3 or higher
Python Requirements: Python 3.4+ (Bundled or External)
OS Requirements: Windows, OSX or Linux
*** Tested on Windows 10, OSX and Linux ***
Current Version: "0.1.6"

Installation
* Select Manage Plugins from the Plugins menu. In the dialog box, select either the Bundled Python or the External Python(Python 3.4+ should be installed on your computer to run this plugin externally).

* Click Add Plugin and select StylePropertiesCleanup_vXXX.zip. This will load and install the plugin into Sigil, which you can then select and run using Plugins > Edit > StylePropertiesCleanup.

Description
This simple plugin allows the user to globally remove any style property from the epub CSS or html. It gives the plugin user a safe and simpler alternative for removing unwanted style properties rather than using Sigil's Search and Replace with regex.

This plugin should work for imported html(added in v0.1.5) and epubs, including epub 3.

Usage and Features
In the input dialog textbox just type in any single style property or you can type in a space delimited or comma delimited list of style properties to be removed globally in a single batch run. This plugin should help to make it easier to clean up stylesheets and clean up html inline styling. You can use any style property you like such as font-size, font-family, page-break-before, letter-spacing, widows, orphans, -webkit-hyphens etc and then just select your options below:

1. Remove selected style properties from epub CSS only.
2. Remove selected style properties from epub html only.
3. Remove selected style properties from imported html only.(added in v0.1.5)

For imported html files only, it's also advisable to run Tools > Reformat HTML > Mend and Prettify All HTML Files in Sigil before you run this plugin to avoid any text wrapping issues. And at the end of the plugin run another dialog will report the total number of style properties removed.

Note: Be aware that option 3 will only remove style properties from the imported HTML body section -- but it will not remove any style properties from the HTML <style> section.

Changes:
Spoiler:
v0.1.6 -- Fixed a minor problem with version update notification.
v0.1.5 -- New functionality. Added a new dialog option to remove style values from imported HTML only.
-- Fixed a problem with space creep in the xml headers after plugin run.
-- Due to various problems, I changed the version update notification to a message box displayed at the end of plugin run.
v0.1.4 -- Changed dialog option descriptions.
v0.1.3 -- Standardized CSS file input format to avoid problems with style value removal in CSS.
v0.1.2 -- Fixed a problem with 'margin' and 'padding' style value detection.
v0.1.1 -- Imported HTML files can no longer be used with this plugin. Only epubs should be used with this plugin now. Appropriate changes were also made to the main window dialog. Changed from radiobuttons to checkboxes for increased choice.
v0.1.0 -- Initial release
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	24
Size:	37.0 KB
ID:	180281  
Attached Files
File Type: zip StylePropertiesCleanup_v016.zip (126.0 KB, 31 views)

Last edited by slowsmile; 07-27-2020 at 02:04 AM.
slowsmile is offline   Reply With Quote
Old 06-21-2020, 07:57 AM   #2
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 522
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
Update(v0.1.1)_:
  1. Using imported HTML files is no longer supported for this plugin(changed in v0.1.1).
  2. Appropriate changes were also made to the main dialog window. Changed from radiobuttons to checkboxes for increased choice.

Last edited by slowsmile; 06-21-2020 at 08:55 AM.
slowsmile is offline   Reply With Quote
Old 06-29-2020, 09:23 AM   #3
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 522
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
Update(v0.1.5):
  • New functionality. Added a new dialog option to remove style values from imported HTML only.
  • Fixed a problem with space creep in the xml headers after plugin run.
  • Due to various problems, I changed the version update notification to a message box displayed at the end of plugin run.

Last edited by slowsmile; 06-29-2020 at 09:30 AM.
slowsmile is offline   Reply With Quote
Old 06-29-2020, 02:01 PM   #4
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 576
Karma: 2959442
Join Date: Nov 2019
Device: none
It's crunching and removing the leading spaces in the css files as well as the xhtml files, even if you only check 1 of the boxes. Unfortunately sigil doesn't have a prettify for the css files like it does for the xhtml files.
hobnail is offline   Reply With Quote
Old 06-29-2020, 02:16 PM   #5
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 4,968
Karma: 16854743
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by hobnail View Post
Unfortunately sigil doesn't have a prettify for the css files like it does for the xhtml files.
Simply right-click a .css file in Code View and select Reformat CSS > Multiple Lines Per Style.
Doitsu is offline   Reply With Quote
Old 06-29-2020, 04:01 PM   #6
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 576
Karma: 2959442
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by Doitsu View Post
Simply right-click a .css file in Code View and select Reformat CSS > Multiple Lines Per Style.

Thank you! I wish I'd known about that earlier; I've had some books that had funky css formatting where I used calibre's editor since its prettify does both html and css.
hobnail is offline   Reply With Quote
Old 06-29-2020, 08:20 PM   #7
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 522
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
Can someone add this plugin to the Sigil Plugin Index?
slowsmile is offline   Reply With Quote
Old 06-29-2020, 09:02 PM   #8
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 4,437
Karma: 2706854
Join Date: Nov 2009
Device: many
Added now.

Quote:
Originally Posted by slowsmile View Post
Can someone add this plugin to the Sigil Plugin Index?
KevinH is offline   Reply With Quote
Old 06-29-2020, 09:50 PM   #9
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 522
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
Thanks.
slowsmile is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Metadata Source Plugin] Empty Plugin? (Fake Identifier) mneimeyer Plugins 3 11-11-2019 08:07 PM
[Plugin] QuickPrefsEdit - Edit plugin prefs json files. slowsmile Plugins 3 07-25-2018 08:14 PM
Goodread Perception Expander plugin not shown on plugin list (kobo h2o) www KOReader 4 09-28-2017 10:34 AM
Problem with my ScrambleEbook plugin and the Plugin Updater tool jackie_w Development 14 01-19-2017 10:49 PM
Plugin not customizable: Plugin: HTML Output does not need customization flyingfoxlee Conversion 2 02-24-2012 02:24 AM


All times are GMT -4. The time now is 10:52 AM.


MobileRead.com is a privately owned, operated and funded community.