View Single Post
Old 08-09-2009, 12:30 AM   #1
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 867
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
By request: How I made my ePub bible

Well, I recieved a PM from a member asking if I would provide details as to how I made my ePub version of the KJV Bible, so I decided to post the answer here for all to see.

First, I started with the HTML version of TedPark's bible, and stripped all the navigational links that had been built into it. I was left with a single HTML file that included all of the books of the bible.
I then went through and changed/made sure all of the BOOK headings were Heading 2, or <h2>. I put <span clas="(...)"> tags around the various portions of the Book titles to control font size.
Each chapter heading was wrapped with <h3 class="PageBreak"> tags, EXCEPT for chapter one of each book, which had <h3 class="noPageBreak"> tags instead. Now obviously this was done to insert page breaks at the appropriate places in the HTML. The first chapter of each book was not page breaked so that it would display on the same page as the book title.
Once all that was done, I put the appropriate styles in the <style></style> portion of the document to control all of the above 'settings'.

Once the HTML file was ready, I imported it into Calibre 0.5.14.
In Calibre, I used the default font size, and checked the option to remove spacing between paragraphs. For the structure, I left everything at their defaults. I made sure that the "Do not split on page break was left UNCHECKED.
When it came to the TOC, I set both the "Number of links to add to table of contents" and "Chapter Threshold" both to 99 - I don't know whether this was neccessary or not, but it seemed to work.
For the level 1 TOC Xpath expression I used
Code:
//h2
And for the level 2 TOC I used
Code:
//h3
I then hit the convert button, and went and had a drink or three.

This gave me a nicely formatted ePub bible, however, I wasn't finished yet...
Now it was time to tweak it for speed so that it would be fully usable on the PRS-505.
To do this, I opened up the file from within 7-zip, and edited the toc.ncx file found within. I then searched for <content src="..." #...> elements, and deleted everything from the # up to -- but excluding -- the closing bracket (>). More details about this here.

Once those deletions were made, I simply saved the toc.ncx file from within the .epub file and loaded the .epub onto my PRS-505.

Download the "CompleteA_revised(v3.0).htm.bz2" from the original bible thread to see how I made the HTML file. Explode the .epub file (change it's extension to .zip if needed) to see how the ePub is made up.

The only software used was Notepad++ (to edit all the files), Calibre (to create a nice ePub) and 7-zip (to manipulate the created ePub).

Note: I made heavy use of the Find/Replace box in notepad++, and regular expressions, to make the bulk changes.
sherman is online now   Reply With Quote