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 07-07-2017, 05:40 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: 493
Karma: 787388
Join Date: May 2013
Location: Philippines
Device: Android S5
[Plugin] StyleBender

Manipulates, moves or removes styling at block level in both epubs and imported html docs

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
Current Version: "0.1.4"
*** Tested on Windows 7, 8 & 10, OSX and Linux ***

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 StyleBender_vXXX.zip. This will load and install the plugin into Sigil, which you can then select and run using Plugins > Edit > StyleBender

Description
This is an edit plugin that gives you various options to move or remove html styles, inline styling and create stylesheets at block level. This plugin can also be used for for both epubs and imported html docs. If you use html docs with this plugin please ensure that they are derived only from the following doctypes: Word doc and docx(html filtered only), ODF(OO and LO docs only), GoogleDoc(as html, zipped) or AbiWord.

To load an html doc into Sigil, first open Sigil and go to Edit > Preferences > General Settings > Mend XHTML Source Code On: and set this to Open and then save it(you only have to do this once). Now you can load the html file in the normal way using File > Open(ensure File Types is set to html).

User Options(via dialog)
  • Move the html <style> section & all inline styling to new stylesheets (imported html only)
  • Move only the html <style> section to a new stylesheet (imported html only)
  • Move only the inline styling to a new stylesheet (imported html only)
  • Remove all html styles(classes) from the html
  • Remove all inline styling from the html
  • Remove all tag attributes from the html(removes all styling and leaves just the html tags)
Plugin Run
First load your epub or html doc into Sigil and then just run this plugin.

Comment
For best results and to avoid problems I would also advise that you should always run the CustomCleanerPlus plugin before running the StyleBender plugin. Using the CustomCleanerPlus plugin will ensure that the html code is both epub 2 compliant and clean which will also help to greatly reduce validation errors further on down the line when you run Epubcheck. I specifically created these two plugins to help save some cleanup and formatting time for those folks who prefer creating their epub ebooks in raw html using Sigil.

Changes

Spoiler:

v0.1.4
-- Added MIT SW Licence
v0.1.3
-- Increased dialog window font size for better readability on Macs.
v0.1.2
-- Added file type status notification in user dialog window.
v0.1.1
-- Removed OSX and Linux restrictions in plugin.xml.
v0.1.0
-- Initial release
Attached Files
File Type: zip StyleBender_v014.zip (949.4 KB, 486 views)

Last edited by slowsmile; 11-06-2017 at 10:17 PM.
slowsmile is offline   Reply With Quote
Old 07-07-2017, 05:35 PM   #2
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,450
Karma: 2493333
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Hi

Thank you for your nice efforts. Unhappily I could not install this plugin (contrary to CustomCleanerPlus) on Sigil 0.9.7. (ArchLinux 64). I have Python 3.6.1.
Attached Thumbnails
Click image for larger version

Name:	Capture du 2017-07-07 22-27-51.png
Views:	205
Size:	10.6 KB
ID:	157792  
roger64 is offline   Reply With Quote
Advert
Old 07-07-2017, 07:07 PM   #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: 493
Karma: 787388
Join Date: May 2013
Location: Philippines
Device: Android S5
@roger64...I've been having some trouble with Arch Linux in this thread regarding the user dialog display text layout for both the StyleBender and CustomCleanerPlus plugins.

What I've done to remedy your problem is that I have now taken off StyleBender's restrictions on using Linux and OSX(which was in plugin.xml) so you should now be able to use the StyleBender plugin on your Arch Linux computer without any problems.

Just download the new version of StyleBender(v0.1.1) and it shuld work on Arch Linux and OSX.

I put these os restrictions on StyleBender because I could not physically test it on Linux or OSX - even though I've put the appropriate code into StyleBender and CustomCleanerPlus to accomodate OSX and Linux.

I would also be very grateful if you could let me know on this thread if both StyleBender and CustomCleanerPlus are now working OK on Arch Linux(ie no dialog display layout problems). Much thanks.

Last edited by slowsmile; 07-08-2017 at 02:38 AM.
slowsmile is offline   Reply With Quote
Old 07-08-2017, 03:26 AM   #4
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,450
Karma: 2493333
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Hi

Sorry for a late reply due to time zone constraints.

011 version of the plugin is installed correctly and is working now for me. I tried it on a correct enough Epub. Out of the six possible choices, the first three were greyed out. I suppose that this is normal due to the fact that I did not use any inline styling?

CustomCleanerPlus is displayed and works correctly on my ArchLinux 64. I tried it with two items -setting width for some images and suppressing divs- and the result was OK.

Last edited by roger64; 07-08-2017 at 04:04 AM.
roger64 is offline   Reply With Quote
Old 07-08-2017, 10:01 AM   #5
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: 493
Karma: 787388
Join Date: May 2013
Location: Philippines
Device: Android S5
@roger64...Thanks very much for that. And since people have recently reported that the plugin works on both Ubuntu and Arch Linux I'll now allow this app for Linux I think.

Regarding the three items that were greyed out -- the first three items will always be greyed out if you are using StyleBender on epubs because there is no html css in epub html(all epub css should be in the Styles directory). So "move all styles..." and "move html styles..." are not allowed to be used with epub input. "Move inline styles..." was also greyed out because it was too complicated to do it for epubs. And anyway, there's already a Sigil plugin for moving inline styles to a css for epubs -- I think its called RemoveInlineStyles. There's no need to re-invent the wheel...

If you use StyleBender with an imported html file, then all chkbuttton options will be available in the dialog display.

Thanks again for helping out.

Last edited by slowsmile; 07-10-2017 at 01:05 AM.
slowsmile is offline   Reply With Quote
Advert
Reply

Tags
attributes, classes, styles

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FileType Plugin] YVES Bible Plugin ClashTheBunny Plugins 25 10-13-2019 12:32 AM
Problem with my ScrambleEbook plugin and the Plugin Updater tool jackie_w Development 14 01-19-2017 11:49 PM
Plugin not customizable: Plugin: HTML Output does not need customization flyingfoxlee Conversion 2 02-24-2012 03:24 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 01:27 PM
New Plugin Type Idea: Library Plugin cgranade Plugins 3 09-15-2010 01:11 PM


All times are GMT -4. The time now is 07:01 PM.


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