View Single Post
Old 01-30-2017, 11:40 PM   #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: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
[Plugin] GoogleZipImport

Import Google Doc HTML documents into Sigil as epubs.

Requirements
Input: Google Doc HTML file saved as 'Web Page(html, zipped)'
MIT(OSI) Licence
Output: Epub 2
Minimum Sigil requirement: v0.9.0 or higher
Python Requirements: Python 3.4+ (Bundled or External)
OS Requirements: Windows/OSX/Linux
** Tested on Windows 7, 8 & 10 only **
** Tested on OSX, Linux32 & Linux64 **

Current Version: "0.2.2"

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

Description
The purpose of this input plugin is to help Google Doc users more easily convert their Google html documents directly to epub. This plugin should give a full conversion and also acts to quickly set up an ideal start point for important Sigil finishing-off tasks like final re-styling, toc change, adding embedded fonts etc.

This plugin converts your document to epub 2 format and should also be useful for non-techies as well, since it should also produce an uploadable basic epub, with no frills, after conversion.

Features
As well as converting an html doc to epub, this plugin will also do the following additional tasks:

* Thoroughly cleans out and reformats the html file.
* Fixes common mixed encoding problems.
* Initially removes the doc TOC(if present) and removes all page links and bookmarks.
* Creates a stylesheet that preserves all layout and formatting after conversion to epub.
* Adds an ebook cover image to the epub.
* Imports all html ebook images as inline images.
* Uses special formatting to help preserve smaller image sizes across all reading devices.
* Creates a Level 1 doc TOC(in Git Markdown style) and a Nav TOC(device TOC).
* Adds the necessary metadata to the epub.
* Preserves all internet links.
* Trims the stylesheet - removes all redundant or unneeded style properties.
* Formats all epub text as default serif throughout.
* Adds the Go To guides for toc, cover and begin read(set to 'Chapter 1' or default).
* Converts all "in", "cm", "mm", pc" and "pt" values to relative "em" values in the CSS.
* Adds globals and presets to the CSS to guard against common Look Inside issues for KDP uploads.
* Cannot render tables or complex lists.

This plugin effectively converts and prepares your html doc(as you have styled it as a Google Doc) for upload as a basic epub with no frills.

Plugin Run
Download and Save your Google Document as 'Web Page(html, zipped)' and extract your html document and 'images' folder(if applicable) to your desktop. Now run the plugin in Sigil to convert your html doc to epub.

Metadata
The Edit eBook Details dialog window collects all necessary epub metadata.

Styling Info
The plugin interface is quite simple to use and there is only one style rule:

Most Important Rule: Make sure that you only use 'Heading 1'(h1) paragraph style for all the main headings and chapter headings that you want to see in the generated epub TOC. In the plugin, h1 style is used as a marker for selecting and generating the TOC links and is also used for XML structure creation within the epub.

Don't put decorative images above your ebook title or chapter headings. After conversion to epub, any images above your book title or chapter headings will not show. You can add in these decorative images using Sigil after you have converted to epub.

The auto-generated epub TOC links will be formatted in the following way: AllCaps, 11pt, bold font, blue with no underline. On mouse over the formatting changes to: dark orange with underline. Internet links will also be displayed in the same way without bold or AllCaps. This styling will work for epub vendors like iBooks and Nook. For Kindle, the toc formatting will display, as it is, in the following way: AllCaps, 11pt, bold font, blue with underline. Internet links will not have bold or AllCaps. Kindle does not support link hover capability.

This plugin is similar to my other plugin -- OpenDocHTMLImport -- but is more limited in its ability to manipulate html styles and in-tag styling because of the differences in how Google converts a Google Doc to HTML. Nevertheless this plugin should give you an uploadable basic epub or it will help to give you a quick start point to complete any personal finishing-off tasks in Sigil before upload.

Change Log

Spoiler:

v0.2.2
-- Fixed a uuid problem affecting the uuids generated in the content.opf and toc.ncx metadata, which was causing uuid errors during Epubcheck.
v0.2.1
-- Fixed superscript and subscript issues
v0.2.0
-- Fixed a problem with line-height
v0.1.9
-- Now automatically removes the html doc TOC if present
v0.1.8
-- Added MIT SW Licence
v0.1.7
-- Fixed a bug with the anchor tag
-- The long and shorthand values of 'padding' and 'margin' will both now automatically be converted from their absolute to relative 'em' values in the css. The em values will also have better precision.
-- Changed Book Browser file names to lower case
-- Other minor plugin changes to improve checks, protection and cleanup on exit.
v0.1.6:
-- Added warning message for "images" folder not found.
v0.1.5:
-- Initial release
Attached Thumbnails
Click image for larger version

Name:	Edit_eBook_Details.JPG
Views:	580
Size:	33.0 KB
ID:	163062  
Attached Files
File Type: zip GoogleZipImport_v022.zip (981.2 KB, 982 views)

Last edited by slowsmile; 12-09-2018 at 06:45 PM.
slowsmile is offline   Reply With Quote