bell notificationshomepageloginedit profileclubsdmBox

10% popularity   0 Reactions

I went nuts figuring this out. Developed mile long Xpath strings and what not. Then it turned out to be ridiculously simple. I am ignoring op systems in this answer...

(a) for the conversion to epub use Calibre. It imports as a zip file. No need to make a zip file beforehand. Then you convert the zip to ebook in Calibre.

(b) spider the web site: Cyotek WebCopy or HTTrack Website Copier will do just fine. This will create a browsable mirror of the web site on your local device.
(if the web has an index page or site map listing the pages, your job is easy.)

(c) Take the site map or index or whatever page that does the best listing of what's in the web. Copy it, naming it "Table Of Contents". Edit it and change title to Table Of Contents. Change (or make one if there is none) the first header to h1>Table Of Contents. If needed, make your additions to the links in this file. ( I am assuming this file is the parent to all links. If other files refer back to this file, see if you can just use the original parent file without changing its file name as the "Table Of Contents" file. Just change its html title and header and see what happens.)

(d) to set up calibre, go to "preferences" ==> Common Options. Untick everything in the "Heuristic processing" and "Structure detection" pages. On the "Table Of Contents" page tick "Force use of auto generated Table Of Contents and Do not add detected chapters. ToC Level thingies should be blank also. That is it.

(d) Click "add book" button in Calibre and select your "Table Of Contents" file. Calibre will create the book in zip format. Then select your book and click "convert books". You have your ebook!

(e) if you want to make changes in your ToC after making the epub, it is easier with Sigil. Load your book in Sigil. go to tools==>Table Of Contents==> Edit Table Of Contents. Table Of Contents editor probably has what it takes to make the changes.

the tutorial site is very well organized. so here is another way to go about it.

You need to download the web contents with an app like httrack.
You can download httrack from apps.ubuntu.com/cat/applications/precise/webhttrack/
The best way to go may be to use Calibre to create an epub,
and then convert it to mobi again with calibre
You can download Calibre for Ubuntu from calibre-ebook.com/download_linux or apps.ubuntu.com/cat/applications/lucid/calibre/
The tutorial @ docs.python.org/3/tutorial/index.html is already well organized so it is doable.

Here is one way of going about it...

after you download it set up Calibre
click preferences -> common options

select structure detection
in Detect Chapters at xpath expression blank
paste: //[((name()='h1' or name()='h2' or name()='h3') and re:test(., 's((chapter|book|section|part)s+)|((prolog|prologue|epilogue)(s+|$))', 'i')) or @class = 'chapter']

select Table of Contents
check Force use of auto-generatyed table of Contents
for ToC level 1 select h1 with magic wand
for ToC level 2 select h2 with magic wand
for ToC level 3 select h2 with magic wand

That's it for Calibre setup

Now you can click the add books button
go to your download folder
go all the way in to the tutorial folder
and select index.html
calibre will create a book in zip format

select the book and click convert books button

you will end up with an epub with an acceptable ToC
to clean up the ToC
you can click edit book -> select table of contents and edit
then you can convert to mobi

sorry about the bold. I could not get rid of it.


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (0)

Login to follow story

More posts by @Kevin

0 Comments

Sorted by latest first Latest Oldest Best

 

Back to top