ablog

不器用で落着きのない技術者のメモ

Sphinx はじめました

ブログに書けないことは sphinx + git で管理しようかなと思ってから1年以上が経過していた。。。

インストール

% which python
/usr/bin/python
% mkdir /cygdrive/d/docs/sphinx
% cd /cygdrive/d/docs/sphinx
% wget http://peak.telecommunity.com/dist/ez_setup.py
% python ./ez_setup.py
% easy_install sphinx

プロジェクトを作成する

% sphinx-quickstart
> Root path for the documentation [.]:
> Separate source and build directories (y/N) [n]:
> Name prefix for templates and static dir [_]:
> Project name: Sample
> Author name(s): yoheia
> Project version: 0.1
> Project release [0.1]:
> Source file suffix [.rst]:
> Name of your master document (without suffix) [index]:
> Do you want to use the epub builder (y/N) [n]: y
> autodoc: automatically insert docstrings from modules (y/N) [n]: y
> doctest: automatically test code snippets in doctest blocks (y/N) [n]: y
> intersphinx: link between Sphinx documentation of different projects (y/N) [n]: y
> todo: write "todo" entries that can be shown or hidden on build (y/N) [n]: y
> coverage: checks for documentation coverage (y/N) [n]: y
> pngmath: include math, rendered as PNG images (y/N) [n]: y
> mathjax: include math, rendered in the browser by MathJax (y/N) [n]: y
> ifconfig: conditional inclusion of content based on config values (y/N) [n]:
> viewcode: include links to the source code of documented Python objects (y/N) [n]:
> Create Makefile? (Y/n) [y]:
> Create Windows command file? (Y/n) [y]:

...

ページ構成を作る

% make html
% cd _build/html                                                                                          
% ls
_sources  _static  genindex.html  index.html  objects.inv  search.html  searchindex.js