Forum: ebooks.stackexchange.com
Tags: <mobi><html><conversion>
Title: How can I convert an HTML site into an ebook?
Question: I'd like to create a  .mobi  file from a website like the  Python Tutorial , to read on my Kindle.  Is it possible to do it on Ubuntu?

Answers:
sents: text: Of course you can.
text: The easiest method is save the whole site into a folder (e.g. mirror it with some command line tool like wget - it is available on Windows too - or Httrack ) zip
text: the folder send the zip to your device via Amazon e-mail solution.
text: Here's the official Amazon page documenting this feature.
text: If it's not what you want, you can use Calibre to convert HTML to various ebook formats, here is the official documentation .
text: And even more, you can download the official Kindlegen Linux CLI tool from Amazon and hand tailor the downloaded HTML with your favourite editor then convert it.
text: (And you can download the official Python docs in EPUB format which Amazon happily convert for you (the mailing method), and every other conversion option I had mentioned above will work with the EPUB too.)
answer_details: author: ebooks.stackexchange.com/users/15/Zsolt Botykai
score: 51
sents: text: I prefer Calibre solution.
text: Debian Calibre package come with ebook-convert utility.
text: Grab HTML files from site by:
text: $ wget
text: -r
text: -np
text: -nc
text: -k -c http://...
text: /...
text: /..
text: Locate your main HTML file (usually book.html or index.html ) and convert to MOBI: $ cd dir-with-index$ ebook-convert index.html book.mobi$ ebook-convert index.html book.fb2
text: $ ebook-convert index.html book.epub
answer_details: author: ebooks.stackexchange.com/users/1137/gavenkoa
score: 25
sents: text: I had the exact same problem for a long time.
text: You can produce good results with Calibre, but I found the process was a bit involved.
text: Instead I created a way to do this much more easily.
text: It's a browser extension called EpubPress ( https://epub.press ).
text: All you do is: Open the webpages you want to save in different tabs.
text: Open EpubPress Select all the pages you want in your ebook Download
text: The content from the pages gets extracted and stitched together into an ebook.
text: Hope that helps!
answer_details: author: ebooks.stackexchange.com/users/6564/Harold
score: 12
sents: text: One thought is the Sigil e-book-building software.
text: It's available for Linux
text: and I believe it would do what you need although there is some manual manipulation involved.
answer_details: author: ebooks.stackexchange.com/users/56/Padawan Learner
score: 5
sents: text: I went nuts figuring this out.
text: Developed mile long Xpath strings and what not.
text: Then it turned out to be ridiculously simple.
text: I am ignoring op systems in this answer...
text: (a) for the conversion to epub use Calibre.
text: It imports as a zip file.
text: No need to make a zip file beforehand.
text: Then you convert the zip to ebook in Calibre.
text: (b) spider the web site:
text: Cyotek WebCopy or HTTrack Website Copier will do just fine.
text: 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.)
text: (c) Take the site map or index or whatever page that does the best listing of what's in the web.
text: Copy it, naming it "Table Of Contents".
text: Edit it and change title to Table Of Contents.
text: Change (or make one if there is none) the first header to h1>Table Of Contents.
text: If needed, make your additions to the links in this file.
text: ( I am assuming this file is the parent to all links.
text: 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.
text: Just change its html title and header and see what happens.)
text: (d) to set up calibre, go to "preferences" ==
text: >
text: Common Options.
text: Untick everything in the "Heuristic processing" and "Structure detection" pages.
text: On the "Table Of Contents" page tick "Force use of auto generated Table Of Contents and Do not add detected chapters.
text: ToC Level thingies should be blank also.
text: That is it.
text: (d) Click "add book" button in Calibre and select your "Table Of Contents" file.
text: Calibre will create the book in zip format.
text: Then select your book and click "convert books".
text: You have your ebook!
text: (e) if you want to make changes in your ToC after making the epub, it is easier with Sigil.
text: Load your book in Sigil.
text: go to tools==>Table Of Contents==>
text: Edit Table Of Contents.
text: Table Of Contents editor probably has what it takes to make the changes.
text: the tutorial site is very well organized.
text: so here is another way to go about it.
text: You need to download the web contents with an app like httrack.
text: You can download httrack from https://apps.ubuntu.com/cat/applications/precise/webhttrack/
text: The best way to go may be to use Calibre to create an epub,and then convert it to mobi again with calibreYou can download Calibre for Ubuntu from https://calibre-ebook.com/download_linux or https://apps.ubuntu.com/cat/applications/lucid/calibre/ The tutorial @ https://docs.python.org/3/tutorial/index.html is already well organized
text: so it is doable.
text: Here is one way of going about it... after you download it set up Calibreclick preferences -> common options select structure detectionin
text: Detect Chapters at xpath expression blankpaste: //
text: [((name()='h1' or name()='h2' or name()='h3') and re:test(., '
text: \s ((chapter|book|section|part)\s+)|((prolog|prologue|epilogue)(\s+|$))', 'i')) or @class = 'chapter'] select Table of Contentscheck Force use of auto-generatyed table of Contentsfor ToC level 1 select h1 with magic wandfor ToC level 2 select h2 with magic wandfor ToC level 3 select h2 with magic wand
text: That's it for Calibre setup
text: Now you can click the add books buttongo to your download folder
text: go all the way in to the tutorial folderand select index.htmlcalibre 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 ToCto clean up
text: the ToCyou can click edit book -> select table of contents and editthen you can convert to mobi sorry about the bold.
text: I could not get rid of it.
answer_details: author: ebooks.stackexchange.com/users/10059/guest
score: 2
sents: text: Another option is https://dotepub.com , which does not require the installation of any additional programs, works across all platforms and is free.
answer_details: author: ebooks.stackexchange.com/users/2780/user26732
score: 0

Summary of the answers:
You can do this. Try Sigil or dotepub.com.
It is perfectly possible to build an e-book from an HTML site, but you may also want to try Sigil or dotepub.com