10-31-2017, 10:23 PM | #1 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
[Plugin] NormalizeScrivEpub
Reformats and normalizes Scrivener epubs Requirements Plugin Type: Edit Minimum Sigil requirement: v0.9.3 or higher Python Requirements: Python 3.4+ (Bundled or External) OS Requirements: Windows, Linux or OSX *** Tested on Windows 7, 8 & 10 only *** Current Version: "0.1.3" 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 NormalizeScrivEpub_vXXX.zip. This will load and install the plugin into Sigil, which you can then select and run the plugin by selecting Plugins > Edit > NormalizeScrivEpub. Description This simple edit plugin addresses some of the niggles I've had in the past with my own Scrivener conversions to epub. This plugin should only be used with Scrivener-generated epubs and does the following: * Optionally converts the styling of all main headings(which are all formatted with <p> tags in Scrivener epubs) to <h1> tags. * The user can also directly format the new <h1> tags from plugin prefs to more easily pre-style the new headings in the epub before running the plugin. * The plugin will also automatically remove Scrivener's TOC file(contents.xhtml) and replace it with another more stylish standard TOC(Level 1 only). * Reformats all ebook image dimensions as percentages of screen height/width. This will ensure correct display of smaller images across all epub ereaders and KF8 devices(added in v0.1.2). If specifically uploading to Kindle then the AddKindleMediaQueries plugin should also be run on the epub(for Kindle uploads only) to ensure that all smaller ebook images are correctly dual formatted for proper display across all KF8 and older KF7(mobi7) Kindle devices. * A new toc css file will also be created in the epub. * Converts all epub text and headings to default serif throughout. * Formats all epub links in standard blue with underline. * Adds globals and presets to stylesheet.css to help avoid Look Inside issues on KDP upload. Adjusting Heading 1 Style If required, you can pre-style and change the default set_h1_style properties in plugin prefs before you run the plugin. Or you can simply re-style h1 in the main stylesheet after you run the plugin. The default prefs for this plugin looks like this: { "set_h1_style": "h1 {\nfont-size: 1.167em;\nfont-weight: bold;\ntext-align: center;\ntext-indent: 0em;\n}\n", "add_h1_tags": true } The add_h1_tags option allows the user to completely control heading 1 formatting. If set to true, heading p tags will be converted to h1 tags and the appropriate h1 styling will be added to the css. If set to false by the plugin user then the p tag to h1 tag transformation will be prevented. The default setting for this property is true.(added in v0.1.1) Caveat * Make sure that you run this plugin directly after conversion to epub from Scrivener otherwise you may have problems i.e do any manual formatting/changes to your epub in Sigil after running this plugin. * Please also ensure that all internal links are appropriately formatted in your epub before you run this plugin, otherwise heading duplications or other problems might occur in the new epub after you run this plugin. * All table styling will be removed from the epub stylesheet. It's perhaps better and easier(less probematic for vendor upload conversions) if you convert your tables to compressed jpeg images first and then add them as images to your scriv doc before conversion to epub. Plugin Run First load your epub into Sigil, set the h1 styling that you want in plugin prefs, then just run the plugin. I'm not really sure how useful this plugin will be to Scrivener epubbers. It does two main tasks. First, I use this plugin to more quickly reformat and properly finish-off the epub as described above. Second, this plugin can optionally transform all major headings formatted with p tags to h1 tags and will also create a better TOC. The real purpose of doing this is to allow scriv epubbers to use more Sigil plugins that depend on h1 headings for proper operation(like some of my other plugins). Changes: Spoiler:
Last edited by slowsmile; 08-07-2018 at 04:22 AM. |
11-01-2017, 09:41 PM | #2 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Update: The plugin has new functionality(v0.1.1):
* The new plugin prefs add_h1_tags option now allows the user to completely control heading 1 formatting. If set to true, heading p tags will be converted to h1 tags and the appropriate h1 styling will be added to the css. If set to false then the p tag to h1 tag transformation will be prevented. The default setting for this property is true. See release notes -- Adjusting Heading 1 Style -- for more details. Also be aware that if your version of this plugin has been updated then all previously added user formatting for the set_h1_style pref will be lost(set to default) and will have to be added again after the update. Last edited by slowsmile; 11-01-2017 at 11:11 PM. |
Advert | |
|
11-03-2017, 06:47 PM | #3 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Update: Added new functionality(v0.1.2):
* Now automatically reformats all ebook image dimensions as percentages of screen height/width. This will ensure correct display of smaller images across all epub ereaders and KF8 devices(added in v0.1.2). If you are uploading your epub to KDP, then you should also run the AddKindleMediaQueries plugin on your epub to ensure proper smaller image displays on all Kindle KF8 and KF7(mobi7) devices only. AddKindleMediaQueries will dual format all ebook images(for KDP uploads only) to ensure and normalize smaller ebook image displays(that are less than 100% screen width) across all Kindle devices. Last edited by slowsmile; 11-09-2017 at 07:39 PM. |
11-03-2017, 11:00 PM | #4 | |
Resident Curmudgeon
Posts: 73,661
Karma: 127838198
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
11-04-2017, 12:15 AM | #5 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
@JSWolf...Generally, displaying tables as gif or jpg images is the way most people do it in epubs. I've also done it in some of my generic epubs quite successfully. But there are certain rules that you must follow when you format tables as images. For instance Kindle image compression will make all image lines and fonts thinner. To avoid this problem of "stringy" or thin image fonts all you have to do is either use a thicker font like arial or just make the font bold. And I've never had a problem sizing fonts for image displays. This really shouldn't be a problem if you test it properly and adjust font size appropriately. And whenever I have created tables in ebooks I always usually use cell fonts that are slightly bigger than the body text anyway. This makes the table easier to read on smaller devices and also helps to reduce font "stringiness" issues.
Last edited by slowsmile; 11-04-2017 at 07:49 AM. |
Advert | |
|
08-07-2018, 04:06 AM | #6 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Update Plugin: Fixed a bug caused by an incorrect css id in the opf file(v0.1.3)
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[FileType Plugin] YVES Bible Plugin | ClashTheBunny | Plugins | 27 | 01-16-2023 01:25 AM |
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 |
New Plugin Type Idea: Library Plugin | cgranade | Plugins | 3 | 09-15-2010 12:11 PM |