Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 12:13 PM   #16
archz2
Connoisseur
archz2 has a spectacular aura aboutarchz2 has a spectacular aura aboutarchz2 has a spectacular aura aboutarchz2 has a spectacular aura aboutarchz2 has a spectacular aura aboutarchz2 has a spectacular aura aboutarchz2 has a spectacular aura aboutarchz2 has a spectacular aura aboutarchz2 has a spectacular aura aboutarchz2 has a spectacular aura aboutarchz2 has a spectacular aura about
 
Posts: 84
Karma: 4102
Join Date: Jun 2018
Device: Kindle Paperwhite (10th gen) - 6", OnePlus 9RT - MoonReader Pro
Quote:
Originally Posted by DNSB View Post
Babysitting this morning and since they are napping, took 30 minutes to take a look at your .docx file.
  1. Downloaded the .docx file and opened in LibreOffice to cleanup some issues.
  2. Imported the docx file into calibre and converted to ePub (I have calibre set to allow extremely large files so only 3 output files.
  3. Opened the ePub with Sigil and ran epubcheck and epubveri. Way to many non-existent ID error, etc.
  4. Combined the HTML files into 1 file and used search and replace to add a Sigil split marker (<hr class="sigil_split_marker" />) before each h1.
  5. Split the file at the markers. This gave me 69 files.
  6. Removed all the IDs associated with the h1-h4 tags.
  7. Generated a new ToC which automatically put a sigil toc id for 2nd, etc. headers in a chapter.
  8. The ToC included h1-h4 and was rather large but functional.
  9. Regenerated the ToC using only h1. Generated a HTML ToC from that to replace the existing one.
  10. Regenerated the ToC using the h1-h4 headers. Generated a NCX file for ePub2 users (habit)
  11. Used calibre to convert the ePub to azw3. Close to 350MB due to the collection of images which ended up as a mix of png, jpeg and svg. Copied it to a Kindle PW4 and the ToC seems to work.
  12. Uploaded the azw3 to Google Drive. See link below.
  13. Need to hurry now since someone is starting their wakeup grumbling.

BOSS - python-docx.azw3

Let me know how it works for your Kindle.

Amazing! Thank you so much @DNSB!

I have multiple questions so I understand this process and in future can do this on my own.

1) How did you combine HTML files into a single file?

2) How to add a Sigil split marker (<hr class="sigil_split_marker" />) before each h1?

3)Split the file at the markers has to be done in Sigil only? What's the way?

4) How to remove all the IDs associated with the h1-h4 tags?

5) You generated a new ToC with Sigil or Calibre?

6) "Generated a new ToC which automatically put a sigil toc id for 2nd, etc. headers in a chapter." What does this mean?

7) You said, "Regenerated the ToC using the h1-h4 headers. Generated a NCX file for ePub2 users (habit)"
Is this the ultimate way to generate ToC or this generation is multi-layered, like one has to do this ToC generation multiple times so that the next process is cleaning up the previous ToC generation?
archz2 is offline   Reply With Quote
Old Yesterday, 12:52 PM   #17
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 54,065
Karma: 182150335
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
  1. In Sigil, you select the files to merge and then Merge from the right click menu or ctrl-M using the keyboard.
  2. I did a search and replace for '<h1' and replaced with '<hr class="sigil_split_marker" /> <h1'
  3. The option is under Sigil's Edit Menu Split At Markers or F6 on the keyboard
  4. I simply removed all the ids. Find id=".*?" and replace with nothing using Regex mode. If there had been an index or footnotes, it would have been more complex.
  5. The new Toc was generated in Sigil. I generally use Sigil for most of my ePub edits and drop into calibre's editor for those items it handles better (finding duplicate CSS for instance).
  6. A ToC entry can either point to a html file or an id within a html file. For the first header in a html file, Sigil just creates a ToC entry, for subsequent headers below the first one in a file, an id is generated. i.e.
    Code:
      <h1 class="block_">$10 Million, 10 Years, Zero Excuses</h1>
      <h3 class="calibre6" id="sigil_toc_id_1">
    The number is incremented for each subsequent generated ID within the ePub.
  7. I generated a ToC from the h1 headers and used that to generate the simplified HTML ToC (the one you see inline in the ebook). I then generated a full ToC from the h1 to h4 headers which is the one you see when you open the ToC. I originally generated the ePub as an ePub3 but generated an ePub2 version since I was not happy with calibre's ePub3 conversion. As a habit when working with ePub3, I also generate the NCX file used by ePub2 for it's navigation document just for backwards compatibility. This is not normally required since most documents do not have a very complex ToC.

This was pretty much a quick and dirty edit just to get a compliant ePub for the KF8/azw3 conversion.
DNSB is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
epub to mobi, italics don't display on kindle akita328 Conversion 6 09-05-2019 03:57 PM
Kindle Previewer: error converting from epub with specific CSS and `display: none` arthurattwell Kindle Formats 3 08-10-2016 08:42 AM
Help with Apple error - ERROR ITMS-9000: ".epub: wrong namespace in filename.epub fil muzammil ePub 1 11-30-2012 05:25 AM
Character display error in epub with the German version of Pocketbook 301 Galina PocketBook 5 02-28-2010 07:07 AM


All times are GMT -4. The time now is 06:40 AM.


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