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 03-23-2018, 10:23 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: 445
Karma: 787388
Join Date: May 2013
Location: Philippines
Device: Android S5
[Plugin] HTML2Epub - converts various html doctypes to full epub format

Cleans and converts html docs derived from MS Word, ODT(Writer), Google Doc or AbiWord to full epub format.


Requirements
Plugin Type: Input
MIT Licence(OSI)
Minimum Sigil requirement: v0.9.3 or higher
Python Requirements: Python 3.4+ (Bundled or External)
OS Requirements: Windows/OSX/Linux
Tested on Windows 7, 8 & 10 only
Current Version: "0.1.5"

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

Description
This input plugin will import and convert various html doctypes to full epub format in Sigil. The main purpose of this plugin is to help users more easily and rapidly convert their html documents directly to standard epub format.

This plugin effectively converts and transforms your html doc(as you have styled it in html) into a reflowable epub without any frills.

Users should only use html docs derived from the following doctypes with this plugin: Word doc, Word docx(both saved as Web Page HTML Filtered), ODF Writer(LO or OO only), Google Doc(as html, zipped) and AbiWord.

Features
This plugin does the following tasks:

* Thoroughly cleans out the html file and ensures epub 2 html compliance as well.
* Creates a stylesheet that preserves all layout and styling after conversion to epub.
* Trims the stylesheet and removes any unneeded or redundant style properties.
* Transforms and ports all in-line styling to the stylesheet.
* Preserves all internal links, external links and valid bookmarks.
* Removes all unused bookmarks.
* Splits the html file into xhtml files at heading boundaries according to the heading style selected by the user(see User Options).
* Adds an ebook cover image to the epub.
* Imports html ebook images with all height/width values as a % of current screen width.
* Creates both a standard Level 1 TOC file and a Nav TOC(device TOC).
* Adds the necessary basic metadata to the epub.
* Formats all epub text as default serif throughout.
* Converts all absolute values to relative "em" values in the css.
* Adds globals and presets to the css to help guard against common Look Inside issues for KDP uploads.
* Tables and embedded fonts are not supported.

Edit eBook Metadata(via dialog)
This dialog collects the basic ebook metadata that is required for an ebook.

User Options(via dialog)
This options dialog sets the main heading style used -- either h1 or h2 -- for all chapters or main headings in your ebook. The selected heading style will be used to split the html file into separate epub xhtml files and will be also be used to automatically create the epub TOC file and Nav TOC.

Plugin Run
For LO and OO html doctypes, ensure that both the html doc and all associated images are put into a separate dedicated folder. For all other html doctypes, just ensure that the html doc + images folder are both in the same directory on your computer. Then just run the plugin.

After running this plugin it would also be advisable to run the cssRemoveUnusedSelectors plugin to remove any empty or unused styles in the CSS.

Caveat
For best results you should ensure that you style all your headings, reading text and spacing using paragraph styles in your word-processor doc before conversion to html. Users should also minimally ensure that they at least use either h1 or h2 heading style for all chapter headings and main headings in their html docs.

There's no need to create a doc toc in your html doc because an epub TOC file will automatically be created by the plugin.

Tables and embedded fonts are not supported by this plugin.

Try and avoid using fake smallcaps in your doc - using nested font styles will cause errors.

Don't put decorative images above your ebook title or chapter headings. You can, instead, just add in your decorative images in Sigil using Insert > File after you have converted your html doc to epub.

This plugin converter does have it's limitations and isn't meant to compete with other well known converters like Calibre. But this plugin should still be quite useful for some because it's so easy to use and it should give you an epub that usually always passes Epubcheck. After conversion, users should have a good start point -- with a clean, basic epub where they can manually add in any final finishing touches in Sigil before ebook upload.

Changes:

Spoiler:

v0.1.5
-- Fixed a uuid problem affecting the uuids generated in the content.opf and toc.ncx metadata, which was causing uuid errors during Epubcheck.
v0.1.4
-- Fixed problems with image folder name generation for both Word and AbiWord html docs.
v0.1.3
-- Added a delay between dialog calls due to sensitivity issues causing the second dialog to inconveniently disappear.
v0.1.2
-- Fixed a minor problem with anchor tags that contain no attributes. These are now removed by the plugin.
v0.1.1
-- Changed text in the User Options dialog to be less confusing
v.0.1.0
-- Initial release
Attached Thumbnails
Click image for larger version

Name:	Metadata_Dialog.JPG
Views:	438
Size:	32.2 KB
ID:	163007   Click image for larger version

Name:	User_Options_dialog.JPG
Views:	355
Size:	22.6 KB
ID:	163072  
Attached Files
File Type: zip HTML2Epub_v015.zip (1.06 MB, 335 views)

Last edited by slowsmile; 03-21-2019 at 11:39 PM.
slowsmile is offline   Reply With Quote
Old 03-24-2018, 12:04 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: 445
Karma: 787388
Join Date: May 2013
Location: Philippines
Device: Android S5
Quick Update: I've changed the wording in the User Options dialog. I've made it less techie and more plain english, so that there's no confusion or difficulty in understanding what's needed.(v0.1.1)

Last edited by slowsmile; 03-24-2018 at 03:03 AM.
slowsmile is offline   Reply With Quote
Advert
Old 03-24-2018, 05:10 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: 445
Karma: 787388
Join Date: May 2013
Location: Philippines
Device: Android S5
Update: Fixed a minor problem caused by anchor tags that contain no attributes. These are now automatically removed by the plugin.(v0.1.2)

Last edited by slowsmile; 03-24-2018 at 08:36 AM.
slowsmile is offline   Reply With Quote
Old 03-24-2018, 02:22 PM   #4
patrik
Evangelist
patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.
 
Posts: 421
Karma: 185023
Join Date: Jan 2010
Location: Sweden
Device: Kobo Aura HD, Pocketbook InkPad 3
Would this plugin be a good choice for html->epub with the html coming from kindleunpacking a mobi/kf7? (If not, what would be the best option?)
patrik is offline   Reply With Quote
Old 03-24-2018, 04:39 PM   #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: 445
Karma: 787388
Join Date: May 2013
Location: Philippines
Device: Android S5
@patrik..I'm afraid that this plugin would probably give errors from html via KindleUnpack because my plugin always converts html --> epub. Here are some of the other reasons why it would fail:

* The plugin looks for the html doctype in the metadata part of the html(in the meta tags) to identify valid doctypes that can be used with this plugin.

* The html styling layout -- in between the html <style></style> tags -- will be unique depending on what particular html doctype you are using.

I'm not really sure what you are trying to do because whenever you use DiapDealer's KindleImport plugin -- which also uses KindleUnpack -- then this will always give you an epub from a mobi. So why the need to convert from html --> epub?

Last edited by slowsmile; 03-24-2018 at 04:49 PM.
slowsmile is offline   Reply With Quote
Advert
Old 03-25-2018, 04:18 AM   #6
patrik
Evangelist
patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.patrik can program the VCR without an owner's manual.
 
Posts: 421
Karma: 185023
Join Date: Jan 2010
Location: Sweden
Device: Kobo Aura HD, Pocketbook InkPad 3
Ok, thanks. (And yes, KindleImport does what I wanted to do in this case. I had it downloaded but not installed in Sigil for whatever reason thus it was out of mind. Thanks!)
patrik is offline   Reply With Quote
Old 03-26-2018, 03:52 AM   #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: 445
Karma: 787388
Join Date: May 2013
Location: Philippines
Device: Android S5
Update: Added a delay between dialog calls due to sensitivity issues causing the second dialog to inconveniently disappear.(v0.1.3)
slowsmile is offline   Reply With Quote
Old 03-26-2018, 05:00 AM   #8
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: 445
Karma: 787388
Join Date: May 2013
Location: Philippines
Device: Android S5
Update: Fixed problems with image folder name generation for both Word and AbiWord html docs. (v.0.1.4)

Last edited by slowsmile; 03-26-2018 at 05:13 AM.
slowsmile is offline   Reply With Quote
Old 12-09-2018, 06:25 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: 445
Karma: 787388
Join Date: May 2013
Location: Philippines
Device: Android S5
Update: The following bug has been fixed in v0.1.5:

* Fixed a uuid problem affecting the uuids generated in the content.opf and toc.ncx metadata, which was causing uuid errors during Epubcheck.
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
[GUI Plugin] DjVuMaker - converts Postscript books to Djvu TheWizard Plugins 6 03-10-2019 07:35 AM
[Plugin] OpenDocHTMLImport - Full ODF HTML(Writer) conversion to epub slowsmile Plugins 94 10-01-2017 11:59 AM
Previously converted html no longer converts. chrisanthropic Conversion 5 12-31-2011 09:15 PM
No Images When HTML Converts to Mobi -Why? Akua Conversion 4 11-22-2011 01:52 AM
HTML converts to ZIP? Deejub44 Calibre 2 01-24-2009 08:57 PM


All times are GMT -4. The time now is 03:19 AM.


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