Sphinx、少し変わったかな?と何年ぶりかに入れてみる
$ cd Downloads/ $ mkdir Sphinx $ cd Sphinx/ $ wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py $ sudo python ez_setup.py $ sudo easy_install sphinx
Babel-1.3、snowballstemmer-1.2.0、docutils-0.12、Pygments-2.0rc1、Jinja2-2.7.3、six-1.8.0、pytz-2014.7などが依存関係でインストールされた。
プロジェクトを作ってみる。
$ sphinx-quickstart
ここは日本語化されてないのね。
プロジェクト名、バージョン番号、著者名は必須。
> Project name: testpjt > Author name(s): kinneko > Project version: 0.1 > Project release [0.1]: > Project language [en]: ja > Do you want to use the epub builder (y/n) [n]: y > Create Windows command file? (y/n) [y]: n
設定ファイルであるconf.pyと必要なファイルツリーが作られる。
$ find ./ ./ .//Makefile .//_build .//_static .//_templates .//conf.py .//index.rst
indexには構成情報しか書かないのかな?
$ cat index.rst .. testpjt documentation master file, created by sphinx-quickstart on Tue Oct 21 14:02:46 2014. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Welcome to testpjt's documentation! =================================== Contents: .. toctree:: :maxdepth: 2 Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search`
hajimeniとkorekaraを追記してみる。
$ vi index.rst .. toctree:: :maxdepth: 2 hajimeni korekara
$ vi hajimeni.rst ========================= はじめに ========================= 対象とする利用者 13歳以上。
$ vi korekara.rst ========================= これから ========================= 今後の開発予定 まだ未定。
ビルドしてみる。
$ make epub /Users/kinneko/Downloads/Sphinx/hajimeni.rst:6: WARNING: Title underline too short. /Users/kinneko/Downloads/Sphinx/korekara.rst:6: WARNING: Title underline too short.
警告は出たけど、なんかファイルはできた。
_build/epub/testpjt.epubがそれ。
作成過程のファイルも残っている。
Sigilで見る。
うへー。HTMLそのままの不細工な感じのドキュメントになっているな。
これはレイアウトテンプレートとかないとムリだ。
このへんは、昔から変わってないのね...
ほしいのは、これじゃない。