Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 04-10-2018, 11:15 PM   #16
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
@wlashack...Your best bet would be to open your html doc in Sigil and work on it there. Before you do this you must ensure that you set Edit > Preferences > General Settings > Mend XHTML Source Code On: to Open and save. Then just load your Google HTML doc into Sigil. If you get any load errors then just allow Sigil to fix these errors. I would then run the CustomCleanerPlus plugin on it which should at least help to clean up your html and make it more easily readable. After that in Sigil you should be able to manually split the html into separate xhtml files, add metadata, add simple lists and reformat your epub how you like in html.

I would also agree with what Tex2002ans says -- Google html is almost garbage. Almost. The html styles section is just one big blob(no line-breaks and the html isn't much better). Their use of meaningless c2, c45, c103 style names(probably using Tidy) is also unimpressive. There are way too many kix list declarations in html styles(in fact more kix declarations than all the rest of the html style declarations combined). I delete all these unnecessary kix declarations in my plugins because I didn't want an over-bloated stylesheet after conversion. I've written two plugins that can convert Google html to epub(GoogleZipImport and HTML2Epub) and I think its fair enough to sum up and say that Google's html conversion is just a lazy mess. Another notable feature of their html conversion is that they don't even put a proper google identifier in the html meta tags. I can perhaps completely understand why they do this -- after all, who would want their name or monicker attached to such a poor, crappy conversion to html? And their conversion to epub is also an equally weak and lazy effort.

Last edited by slowsmile; 04-11-2018 at 12:01 AM.
slowsmile is offline   Reply With Quote
Old 04-11-2018, 12:25 AM   #17
wlashack
Member
wlashack began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Mar 2018
Device: none
Quote:
Originally Posted by Tex2002ans View Post
... mostly because the code generated from that Google Doc is horrifying. There is a giant block of hundreds of CSS classes all smushed together into a single line, and who knows what is in there:
Side Note: The CSS alone is about 6 times larger than your actual text... talk about a bloated mess!
Fortunately if you open Google Docs .epug file in calibre and push "Convert Books" button, you get the standard structure - HTML document + stylesheet.css where all styles are written one-by-one in an "intelligent" way.

Quote:
Originally Posted by Tex2002ans View Post
I'm assuming what's causing the odd page breaks is the page-break-after:avoid floating around in there.
Thanks, I will try to remove these definitions.
wlashack is offline   Reply With Quote
Old 04-11-2018, 12:35 AM   #18
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
@wlashack...I think that I've found a quicker way to resolve your problem.

Try this:

You will need Kindle Previewer 3, Diap's KindleImport plugin and Sigil.

* Open Kindle Previewer 3(KP3).

* Open KP3 and drag and drop your Google html doc into KP3 and allow it to convert to mobi.

* Save the mobi onto your desktop from KP3 by choosing File > Export

* After conversion and saving to mobi open Sigil and and choose Plugins > Input > KindleImport which will automatically convert the mobi file to a viable epub in Sigil.

From my own testing using the above method with your html doc, this gives a pretty good conversion to epub format.

I was also very surprised when I tried using the html doc in KP3 and it worked(it never worked before). This discovery was a fluke by the way.

Last edited by slowsmile; 04-11-2018 at 01:25 AM.
slowsmile is offline   Reply With Quote
Old 04-11-2018, 01:23 AM   #19
wlashack
Member
wlashack began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Mar 2018
Device: none
Quote:
Originally Posted by slowsmile View Post
@wlashack...I think that I've found a quicker way to resolve your problem.
Hi, thanks, I give it a try. But I already found another easy way:
  1. Download Google Document as .epub
  2. Open in calibre and click "Convert book" button + Save
  3. Open in Sigil and Find/Replace remove "page-break: avoid" tags from css.

It is quick, simple and works (finally!).

It needs some additional polish with margin tags settings but it is one-click action because of Sigil's "Saved Serches" function.

Last edited by wlashack; 04-11-2018 at 01:33 AM.
wlashack is offline   Reply With Quote
Old 04-11-2018, 03:13 AM   #20
patrik
Guru
patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.
 
Posts: 653
Karma: 4568205
Join Date: Jan 2010
Location: Sweden
Device: Kobo Forma
When I played around trying to get a google doc to an epub some time ago, I ended up saving it as a docx, and importing it into Sigil with the excellent plugin DOCXimport.

That was the easiest and cleanest way I found.
patrik is offline   Reply With Quote
Old 04-11-2018, 03:27 AM   #21
wlashack
Member
wlashack began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Mar 2018
Device: none
Quote:
Originally Posted by patrik View Post
When I played around trying to get a google doc to an epub some time ago, I ended up saving it as a docx, and importing it into Sigil with the excellent plugin DOCXimport.

That was the easiest and cleanest way I found.
I gave it a try now and yes - it is easy and clean code. BUT in the matter of bullets and numebered lists it does not keep the structure unfortunately.
wlashack is offline   Reply With Quote
Old 04-11-2018, 04:55 AM   #22
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,553
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by wlashack View Post
I gave it a try now and yes - it is easy and clean code. BUT in the matter of bullets and numebered lists it does not keep the structure unfortunately.
Try converting the DOCX with Calibre. Or importing into calibre's editor (File->Import...)

BR

Last edited by BetterRed; 04-11-2018 at 04:59 AM. Reason: added editor import suggestion
BetterRed is online now   Reply With Quote
Old 04-11-2018, 11:36 AM   #23
wlashack
Member
wlashack began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Mar 2018
Device: none
Quote:
Originally Posted by BetterRed View Post
Try converting the DOCX with Calibre. Or importing into calibre's editor (File->Import...)
BR
No, it does not give good results.
wlashack is offline   Reply With Quote
Old 04-11-2018, 11:49 AM   #24
wlashack
Member
wlashack began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Mar 2018
Device: none
I think it is time to sum up the topic:
First - thanks all for the tips/hints/advice. It helped a lot and led to a solution.

The best method to convert Google Doc to EPUB I found is:
  1. Download Google Document as .epub
  2. Open it in calibre and click "Convert book" button + Save
  3. Open in Sigil and Find/Change remove "page-break: avoid" tags from css.
  4. Make some other Find/Change operations if needed ("Saved Searches" function may be very useful here).

This method is quick, easy and produces fine results with relatively nice code.

THANKS TO ALL FOR HELP AND COOPERATION.
wlashack is offline   Reply With Quote
Old 04-11-2018, 01:03 PM   #25
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by wlashack View Post
I think it is time to sum up the topic:
First - thanks all for the tips/hints/advice. It helped a lot and led to a solution.


Quote:
Originally Posted by wlashack View Post
The best method to convert Google Doc to EPUB I found is:
  1. Download Google Document as .epub
  2. Open it in calibre and click "Convert book" button + Save
  3. Open in Sigil and Find/Change remove "page-break: avoid" tags from css.
  4. Make some other Find/Change operations if needed ("Saved Searches" function may be very useful here).
Just to note, this is just a better method for your specific document.* NOT as a general Google Docs -> EPUB.

I also noticed there was some page-break-inside + page-break-after which you may also want to remove. Those were what was probably causing Moon+ issues, because it looked like each list item had that.

Quote:
Originally Posted by wlashack View Post
Quote:
Originally Posted by BetterRed View Post
Try converting the DOCX with Calibre. Or importing into calibre's editor (File->Import...)
No, it does not give good results.
I just tested it, the Google Docs DOCX -> Calibre -> EPUB was ~ the same as the Google Docs EPUB -> Calibre -> EPUB.

... Still miles ahead of the code straight from the Google Docs EPUB.
Tex2002ans is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-T1 Google Docs, anyone? idle Sony Reader 0 03-24-2012 07:20 PM
How to Get Google Docs on Pocket Edge/Docs to Go SherriK enTourage eDGe 4 10-07-2011 02:26 PM
Google Docs and PE ftrooper93 enTourage Archive 7 05-24-2011 02:44 PM
Google Docs junkyardwillie Apple Devices 5 07-22-2010 05:25 PM
Google Docs omro Apple Devices 2 05-19-2010 02:54 PM


All times are GMT -4. The time now is 08:01 AM.


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