Pull requests

#27 Open
Repository
charlax
Branch
default
Repository
birkenfeld
Branch
default

Addition of MOBI builder

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update default
hg pull -r default https://bitbucket.org/charlax/sphinx
hg merge cb5f07aac311
hg commit -m 'Merged in charlax/sphinx (pull request #27)'
Author
  1. Charles-Axel Dein
Reviewers
Description

Hi,

I don't know much about Sphinx, but I build a rough builder for MOBI files. It is based on the epub one and uses Amazon's KindleGen tool.

You can find more information here: http://charlax.github.com/Python-Documentation-Kindle/

Please tell me if I can improve this first draft, and if you think this is usefule.

Best,

Chx

  • Learn about pull requests

Comments (12)

  1. Georg Brandl repo owner

    Hi,

    thanks for your work! It looks like except for the theme, there is no change in the epub output before conversion to Kindle? (The _content_template in your sphinx.builders.mobi doesn't seem to be used?)

    How different is the CSS from the epub one? And does CSS matter anyway: doesn't the Kindle do its own formatting?

    Thanks, Georg

    1. Charles-Axel Dein author

      I updated the pull request.

      Regarding the CSS, I kept it because of desktop Kindle application. I also removed the @font-face directives because kindlegen was generating warning about them.

      Best,

      Charles

  2. guibog

    Hi, I checked a bit how it works, and it relies heavily on kindlegen, an amazon developped tool weighting 21M, and it may not work if not under linux. If that's ok with you, I can try to fix the PR.

  3. Jon Waltman

    Thanks for working on this but I see some issues here (also applies to pull request #82):

    1) The Linux version of kindlegen doesn't recognize the -rebuild option

    $ ./kindlegen -rebuild
    
    *********************************************************
    * Amazon.com kindlegen(Linux) V2.7 build 1019-d6e4792   *
    * A command line e-book compiler                        *
    * Copyright Amazon.com 2012                             *
    *********************************************************
    
    Error(kindlegen):E30010: Unsupported argument  -rebuild
    

    2) The _contents_template hard codes the entries in the guide element. The EPUB builder normally uses the epub_guide config value to customize this. Is there a reason why this needs to be is different?

    3) Aside from removing the @font-face rules, is the CSS and the theme any different from the EPUB one?

    How is this different than the doing the following?

    $ sphinx-build -b epub . _build/epub
    $ kindlegen _build/epub/NAME.epub
    
  4. Roland Meister

    Hello, just a a few notes.

    The pull request was created before the epub builder had the epub_guide config value.

    I can remove the @font-face rules from the epub CSS file if it helps to avoid copy and paste. I am probably the only person who uses the rules...

    I also made a few experiments with kindlegen and ebook-convert (from calibre) but I could not come up with a clear default conversion. It depends on which mobi format you want to create (kindle format 8 or the old mobi format) and which reader you want to support. Unfortunately, I could not test with a real kindle, but only with the android app and some readers that use the old format.

    Roland

  5. Jon Waltman

    The pull request was created before the epub builder had the epub_guide config value.

    Okay, thanks.

    I can remove the @font-face rules from the epub CSS file if it helps to avoid copy and paste. I am probably the only person who uses the rules...

    Whatever you want to do. I don't think they caused any real problems asides from a few warnings. You could even make it configurable or something if you really wanted.

    I also made a few experiments with kindlegen and ebook-convert (from calibre) but I could not come up with a clear default conversion. It depends on which mobi format you want to create (kindle format 8 or the old mobi format) and which reader you want to support. Unfortunately, I could not test with a real kindle, but only with the android app and some readers that use the old format.

    Yea, I don't have a kindle either and couldn't really test the mobi files.