LoginSignup
3
3

More than 5 years have passed since last update.

blockdiag.comのドキュメントをKindle形式に変換してみた

Posted at

ブロック図生成ツール blockdiag — blockdiag 1.0 documentationのドキュメントはreStructuredTextで書かれているようなので、Kindleのmobiファイルにしたいなーと思い、試行錯誤してやってみました。
作成したmobiファイルは https://www.dropbox.com/sh/6o7428r17ldokhz/k_v7FI3H5b/blockdiag%20-%20Takeshi%20KOMIYA.mobi にあります。

epubファイルを生成

ブロック図生成ツール blockdiag — blockdiag 1.0 documentationのドキュメントのソースは https://bitbucket.org/tk0miya/blockdiag.com にありました。この中の sources/ja/Makefile にepubというターゲットがあります。

変換はOSX上でHomebrewで入れたPython 2.7.5で行いました。本当はvirtualenvとかで環境を作ったほうがいいのかもしれませんが、とりあえず普通にsphinxをインストールしました。手順はうろ覚えなので抜けがあるかもしれません。

まず、homebrew と pip で sphinx-blockdiag Install — JAWSUG-Okinawa 2nd study NOTE を参考に以下のコマンドでsphinxをインストールしました。

$ pip install sphinxcontrib-blockdiag sphinxcontrib-seqdiag \
sphinxcontrib-nwdiag sphinxjp.themes.s6 sphinxjp.themecore \
sphinxjp.themes.sphinxjp sphinxcontrib-googleanalytics cloud_sptheme

これだけだとepub変換時でエラーになったので、(4日目) Sphinx の文書を翻訳してみよう (sphinx-gettext-helper) - Hack like a rolling stoneを参考に以下も実行。

$ pip install sphinx-gettext-helper

以下のコマンドでepubファイルを生成します。

$ hg clone http://bitbucket.org/tk0miya/blockdiag.com
$ cd blockdiag.com/sources/ja
$ make epub SPHINXBUILD=/usr/local/bin/sphinx-build GETTEXTHELPER=/usr/local/bin/sphinx-gettext-helper

これで ../../_build/ja/epub/blockdiag.epub に生成されました。

epubファイルをKindle用のmobiファイルに変換

calibre - E-book managementを使ってepubファイルをKindle用のmobiファイルに変換しました。いつもお世話になっています。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3