================================================================ only / 条件分岐 ================================================================ .. rst:directive:: .. only:: <式> <式> が true のときだけ、ディレクティブの内容をインクルードする。 .. note:: <式>: タグ and ( タグ or タグ ) - 定義タグ - ビルダーのフォーマットのタグ (html, latex, text) - コマンドラインの -t オプションで指定したもの - conf.py で定義されたもの - 未定義タグは false で評価される。 ---------------------------------------------------------------- sample ---------------------------------------------------------------- source:: .. only:: html and draft comment. Makefile への記述例:: draft: $(SPHINXBUILD) -t draft -b html $(ALLSPHINXOPTS) $(BUILDDIR-DRAFT) @echo @echo "Build draft finished. The HTML pages are in $(BUILDDIR-DRAFT)." コマンド実行例:: make draft output: .. only:: html and draft comment. .. note:: - make draft だと "comment." が表示される。 - make html だと "comment." が表示されない。 ---------------------------------------------------------------- 参考リンク ---------------------------------------------------------------- http://sphinx-users.jp/doc10/markup/misc.html#directive-only