Answers.Body: <p>You could also use Pandoc in conjunction with the kindlegen command-line tool.</p>
  
  <p>Converting your HTML files to Markdown files is not necessary but if done will allow (easier) conversion to other formats should the need arise later on.</p>
  
  <p>The table of contents can be automatically generated using Pandoc. Pandoc can export to the <code>epub</code> format which in turn can be converted to <code>mobi</code> using the kindlegen tool. It's possible to write a bash script to automate the process.</p>
  
  <p>Sample command using Pandoc to export to <code>epub</code>:</p>
  
  <pre><code>pandoc -o myBook.epub myBook.md --toc \
  --epub-cover-image=cover.jpg \
  --epub-stylesheet=myStylesheet.css \
  --number-sections
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-26T22:47:14.917Z
Answers.LastActivityDate: 2017-06-26T22:47:14.917Z
Answers.UserDisplayName: Khalid Hussain
Answers.Body: <p>There are many ways to skin a cat. Calibre is one such way, but not the only way. </p>
  
  <p><a href="https://ebooks.stackexchange.com/questions/7054/is-there-any-software-available-to-directly-write-in-mobi-format/7055#7055">is there any software available to directly write in mobi format?</a></p>
  
  <p>Some things to thing about: </p>
  
  <ol>
  <li><p>Would it not be easier to produce an epub file and convert it to mobi using Kindle Previewer?  </p></li>
  <li><p>Sigil is other software for creating  epub -- which might let you export to mobi or export to mobi and then use Kindle Previewer to export to mobi. You can import html files or create html files in sigil itself. </p></li>
  <li><p>If you are using a lot of images, it might be easier to use Adobe Indesign and export to epub. </p></li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-19T18:10:34.727Z
Answers.Text: I'm guessing that those other programs can't upload the final file to the kindle like Calibre can?  So with them I'd either email the resulting mobi file to my kindle email address and have to wait for the sync, or use Calibre to upload the file.  The formatting will be simple; an img tag for the image of the stretch and p tags, along with an h1 or h2 tag for the page title.
Answers.UserDisplayName: lumpynose
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-19T07:20:24.520Z
Answers.LastActivityDate: 2017-03-19T07:20:24.520Z
Answers.LastEditDate: 2017-04-13T13:00:05.480Z
Answers.UserDisplayName: idiotprogrammer
Answers.Body: <p>The Scriba software is an option, I think.
  <a href="http://scriba.software.informer.com/3.5/" rel="nofollow noreferrer">http://scriba.software.informer.com/3.5/</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-24T15:24:05.017Z
Answers.LastActivityDate: 2017-03-24T15:24:05.017Z
Answers.UserDisplayName: migusanc
Answers.Body: <p>If you are already accustomed to Calibre, you could give a try to its full fledged <a href="https://manual.calibre-ebook.com/edit.html" rel="nofollow noreferrer">ebook editor</a>, that handles both <code>epub</code> and <code>azw</code> formats.<br>
  Having the source HTML files, it should be an easy task to import them in the editor and create the ebook, complete with a proper table of contents.</p>
  
  <p><a href="https://i.sstatic.net/TqC7G.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TqC7G.png" alt="enter image description here"></a></p>
  
  <p>Some other related questions:   </p>
  
  <ul>
  <li><a href="https://ebooks.stackexchange.com/q/294/136">How to build an epub starting from a bunch of HTML files?</a>   </li>
  <li><a href="https://ebooks.stackexchange.com/q/132/136">Are there any WYSIWYG editors for EPUB books?</a></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-19T18:13:06.163Z
Answers.Text: Yes, it is straightforward with Calibre.  With my question I was trying to make sure there wasn't anything better I didn't know about.
Answers.UserDisplayName: lumpynose
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-19T12:46:26.730Z
Answers.LastActivityDate: 2017-03-19T12:46:26.730Z
Answers.LastEditDate: 2017-04-13T13:00:05.480Z
Answers.UserDisplayName: Sekhemty
Answers.Body: <p>There is a new Firefox extension that does exactly that: create custom ebooks from favorite blogs and websites.</p>
  
  <p><a href="https://addons.mozilla.org/en-US/firefox/addon/epub-read-the-web-offline/" rel="nofollow noreferrer">https://addons.mozilla.org/en-US/firefox/addon/epub-read-the-web-offline/</a></p>
  
  <p>From the Firefox's extensions web page:</p>
  
  <blockquote>
    <p>EpubPress bundles webpages into an offline book that you can read on any of your devices.</p>
    
    <p>Benefits:
    -Downloads webpages for offline reading.
    -Removes ads and banners from webpages for a cleaner reading experience.
    -Compatible with all your mobile devices (Kindles, Nooks, iPhone, iPad, Android, etc.).
    -Email delivery, allowing you to push content directly to your device.</p>
    
    <p>All the amazing content of the internet, available on devices that were made for reading!</p>
    
    <p>How to use:
    1.Open all your articles in separate tabs.
    2.Order them the way you want them to appear in the book.
    3.Click 'EpubPress' in your menu bar.
    4.Select your articles.
    5.Download and enjoy!</p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-27T01:30:39.480Z
Answers.LastActivityDate: 2017-05-27T01:30:39.480Z
Answers.UserDisplayName: LobaLuna
Answers.Body: <p>Kotobee Author is another Ebook publishing software that you can look into. <a href="https://www.kotobee.com/en/products/author" rel="nofollow noreferrer">https://www.kotobee.com/en/products/author</a> </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-28T10:44:57.470Z
Answers.Text: Apparently this software produces epub files. So is it really an answer to the question asked?
Answers.UserDisplayName: babou
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-27T06:24:48.473Z
Answers.LastActivityDate: 2017-10-27T06:24:48.473Z
Answers.UserDisplayName: Dhanesh R
Body: <p>I will be writing software that allows me to select stretching exercises, put them in order, and then create an ebook, one per page, and then use it on my kindle.  I was hoping that my software could produce the final ebook, e.g., mobi, but that seems unlikely (I can't find the spec for the file format).</p>
  
  <p>So my next idea is to produce a set of HTML files, a table of contents file, and manually use Calibre to convert it to mobi/azw and upload it to my kindle.</p>
  
  <p>I did the HTML part once years ago by creating the HTML files by hand so it should work.  But I was wondering if there is a better way?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-19T07:13:45.187Z
Comments.Text: This might be a duplicate of this question http://ebooks.stackexchange.com/questions/7054/is-there-any-software-available-to-directly-write-in-mobi-format/7055#7055
Comments.UserDisplayName: idiotprogrammer
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-28T10:46:50.527Z
Comments.Text: @idiotprogrammer I do not think so. The question you refer to is much more focussed. Its answers should be a subset of the answers for this one, though the answers actually given did not respect the focus. I prefer this question which is more practical to solve problems.
Comments.UserDisplayName: babou
Tags: <kindle><mobi><html><creation><azw>
Title: How can I create an ebook from existing HTML files?
UserDisplayName: lumpynose
ThreadText: # How can I create an ebook from existing HTML files?
  
  (Asked by: username_0 on 2017-03-18)
  
  I will be writing software that allows me to select stretching exercises, put them in order, and then create an ebook, one per page, and then use it on my kindle. I was hoping that my software could produce the final ebook, e.g., mobi, but that seems unlikely (I can't find the spec for the file format).
  
  So my next idea is to produce a set of HTML files, a table of contents file, and manually use Calibre to convert it to mobi/azw and upload it to my kindle.
  
  I did the HTML part once years ago by creating the HTML files by hand so it should work. But I was wondering if there is a better way?
  
  **Tags:** kindle, mobi, html, creation, azw
  
  > **Comments:**
  > **username_1**: This might be a duplicate of this question http://ebooks.stackexchange.com/questions/7054/is-there-any-software-available-to-directly-write-in-mobi-format/7055#7055  
  > **username_2**: @username_1 I do not think so. The question you refer to is much more focussed. Its answers should be a subset of the answers for this one, though the answers actually given did not respect the focus. I prefer this question which is more practical to solve problems.  
  
  ---
  
  ## 6 answers
  
  ### Answer by username_3 on 2017-06-26. Score: 2
  
  You could also use Pandoc in conjunction with the kindlegen command-line tool.
  Converting your HTML files to Markdown files is not necessary but if done will allow (easier) conversion to other formats should the need arise later on.
  The table of contents can be automatically generated using Pandoc. Pandoc can export to the epub format which in turn can be converted to mobi using the kindlegen tool. It's possible to write a bash script to automate the process.
  Sample command using Pandoc to export to epub:
  pandoc -o myBook.epub myBook.md --toc \
  --epub-cover-image=cover.jpg \
  --epub-stylesheet=myStylesheet.css \
  --number-sections
  
  
  ---
  
  ### Answer by username_1 on 2017-03-19. Score: 1
  
  There are many ways to skin a cat. Calibre is one such way, but not the only way.
  
  [is there any software available to directly write in mobi format?](https://ebooks.stackexchange.com/questions/7054/is-there-any-software-available-to-directly-write-in-mobi-format/7055#7055)
  
  Some things to thing about:
  
  1. Would it not be easier to produce an epub file and convert it to mobi using Kindle Previewer?
  2. Sigil is other software for creating epub -- which might let you export to mobi or export to mobi and then use Kindle Previewer to export to mobi. You can import html files or create html files in sigil itself.
  3. If you are using a lot of images, it might be easier to use Adobe Indesign and export to epub.
  
  > **Comments:**
  > **username_0**: I'm guessing that those other programs can't upload the final file to the kindle like Calibre can?  So with them I'd either email the resulting mobi file to my kindle email address and have to wait for the sync, or use Calibre to upload the file.  The formatting will be simple; an img tag for the image of the stretch and p tags, along with an h1 or h2 tag for the page title.  
  
  ---
  
  ### Answer by username_4 on 2017-03-24. Score: 0
  
  The Scriba software is an option, I think.
  <http://scriba.software.informer.com/3.5/>
  
  
  ---
  
  ### Answer by username_5 on 2017-03-19. Score: 0
  
  If you are already accustomed to Calibre, you could give a try to its full fledged [ebook editor](https://manual.calibre-ebook.com/edit.html), that handles both `epub` and `azw` formats.  
  Having the source HTML files, it should be an easy task to import them in the editor and create the ebook, complete with a proper table of contents.
  
  [![enter image description here](https://i.sstatic.net/TqC7G.png)](https://i.sstatic.net/TqC7G.png)
  
  Some other related questions:
  
  * [How to build an epub starting from a bunch of HTML files?](https://ebooks.stackexchange.com/q/294/136)
  * [Are there any WYSIWYG editors for EPUB books?](https://ebooks.stackexchange.com/q/132/136)
  
  > **Comments:**
  > **username_0**: Yes, it is straightforward with Calibre.  With my question I was trying to make sure there wasn't anything better I didn't know about.  
  
  ---
  
  ### Answer by username_6 on 2017-05-27. Score: 0
  
  There is a new Firefox extension that does exactly that: create custom ebooks from favorite blogs and websites.
  
  <https://addons.mozilla.org/en-US/firefox/addon/epub-read-the-web-offline/>
  
  From the Firefox's extensions web page:
  
  > EpubPress bundles webpages into an offline book that you can read on any of your devices.
  >
  > Benefits:
  > -Downloads webpages for offline reading.
  > -Removes ads and banners from webpages for a cleaner reading experience.
  > -Compatible with all your mobile devices (Kindles, Nooks, iPhone, iPad, Android, etc.).
  > -Email delivery, allowing you to push content directly to your device.
  >
  > All the amazing content of the internet, available on devices that were made for reading!
  >
  > How to use:
  > 1.Open all your articles in separate tabs.
  > 2.Order them the way you want them to appear in the book.
  > 3.Click 'EpubPress' in your menu bar.
  > 4.Select your articles.
  > 5.Download and enjoy!
  
  
  ---
  
  ### Answer by username_7 on 2017-10-27. Score: -1
  
  Kotobee Author is another Ebook publishing software that you can look into. <https://www.kotobee.com/en/products/author>
  
  > **Comments:**
  > **username_2**: Apparently this software produces epub files. So is it really an answer to the question asked?  
  
  ---
  
  