Sphinxの注意
automodule で docstring などを読み込むプログラム
hogehoge.pyは、以下を満たす必要がある。ライブラリとして読み込めること
ファイル名に
-は使えないことファイル名、パッケージ名は数字で始められないこと
サブディレクトリに連番を入れて自動ソートさせる場合は、
page010などから始めること引数なしで実行しても正常終了すること
以下のコマンドで確認する。
python -m hogehoge python -c "import hogehoge"
サブディレクトリ
subdirにあるプログラムを automodule で読み込む場合は、package にしたほうがよい。空の
__init__.pyをhogehoge.pyディレクトリ(source\subdir)に置くconf.pyで、conf.pyディレクトリをライブラリパスに入れる
current_dir = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(0, current_dir)
hogehoge.pyが同じディレクトリのライブラリを呼ぶ場合、conf.pyでライブラリパスを指定する必要がある。sys.path.insert(0, os.path.join(current_dir, 'sbdir'))