Sphinxとepub

phinxは1.0からepubに対応されるとのことで、release前に、epubの生成を試してみました。
使った文章はWikipediaでたまたま秀逸な記事に上がっていた「源 義経」。Creative Commonsライセンスだから再配布しても大丈夫だよね…。

そのままではformatが違うので、手で直しました。本気でやるなら自動変換できるだろうけど。で、生成したepubは以下のURLに。

http://dl.dropbox.com/u/218108/files/epubtest.epub

epubの生成は普通に make epub。1.0より前のはmakeのtargetにepubがないので注意。しかし、kindleiPadも持っていないため、 epubreader というfirefoxプラグインを使って出来栄えを確かめました。
こんな感じで、それなりにきちんとしたものが出来上がったようです。

なお、conf.pyには、以下のような設定があります。

# -- Options for Epub output -----                                                        

# Bibliographic Dublin Core info.                                                         
epub_title = u'epubテスト'
epub_author = u'Wikipediaからの引用' 
epub_publisher=u'wikipedia'
epub_copyright = u'誰か'
# The language of the text. It defaults to the language option
# or en if the language is not set.
epub_language = 'ja'
# The scheme of the identifier. Typical schemes are ISBN or URL.
#epub_scheme = ''
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#epub_identifier = ''
# A unique identification for the text.
#epub_uid = ''
# The depth of the table of contents in toc.ncx.
#epub_tocdepth = 3

最初はepub_title=''としか書いてないので、UTF-8なタイトルを付けたい場合は、 epub_title=u'UTF-8なタイトル'というように、uをつけましょう。(ちょっとはまりました)