tweeeetyのぶろぐ的めも

アウトプットが少なかったダメな自分をアウトプット<br>\(^o^)/

macにsphinxをインストールしてみる

はじめに

なんとなくsphinx使ってみたかったのでいれてみます。っていうメモ

Command Line Tools for Xcodeのインストール

xcodeのインストールや途中で聞かれるappleIDの取得などは省きます
ブラウザからhttps://developer.apple.com/downloads/index.actionにアクセス
アップルIDが聞かれます

Downloads for Apple DevelopersにアクセスできたらCommand Line Tools for Xcodeをダウンロード

ダブルクリックしてから流れにまかせてインストールします

参考→http://docwiki.embarcadero.com/RADStudio/XE4/ja/Mac_%E3%81%A7%E3%81%AE_Xcode_%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89_%E3%83%A9%E3%82%A4%E3%83%B3_%E3%83%84%E3%83%BC%E3%83%AB%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB

easy_install(Pythonパッケージインストール用)のインストール

コマンドラインからeasy_installをダウンロード、インストールします

mac:~ hoge$ curl -O https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11837 100 11837 0 0 6740 0 0:00:01 0:00:01 --:--:-- 8129


mac:~ hoge$ sudo python ez_setup.py
Password:
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-1.1.6.tar.gz
Extracting in /tmp/tmprVE8fp
Now working in /tmp/tmprVE8fp/setuptools-1.1.6

...省略...

copying build/lib/setuptools/version.py -> build/bdist.macosx-10.7-intel/egg/setuptools
byte-compiling build/bdist.macosx-10.7-intel/egg/_markerlib/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/_markerlib/markers.py to markers.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/easy_install.py to easy_install.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/pkg_resources.py to pkg_resources.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/setuptools/__init__.py to __init__.pyc

...省略...

Installing easy_install script to /usr/local/bin
Installing easy_install-2.7 script to /usr/local/bin

Installed /Library/Python/2.7/site-packages/setuptools-1.1.6-py2.7.egg
Processing dependencies for setuptools==1.1.6
Finished processing dependencies for setuptools==1.1.6

sphinx、Pillowのインストール

次にsphinxとpillowをインストール

mac:~ hoge$ sudo easy_install sphinx Pillow
Password:
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-1.1.6.tar.gz
Extracting in /tmp/tmprVE8fp
Now working in /tmp/tmprVE8fp/setuptools-1.1.6

...省略...

Adding Pillow 2.2.1 to easy-install.pth file
Installing pildriver.py script to /usr/local/bin
Installing pilfile.py script to /usr/local/bin
Installing pilconvert.py script to /usr/local/bin
Installing pilfont.py script to /usr/local/bin
Installing pilprint.py script to /usr/local/bin

Installed /Library/Python/2.7/site-packages/Pillow-2.2.1-py2.7-macosx-10.7-intel.egg
Processing dependencies for Pillow
Finished processing dependencies for Pillow

sphinxの確認

hashテーブルを再構築。locateのアレみたいな感じですかね

mac:~ hoge$ hash -r

参考→http://d.hatena.ne.jp/snaka72/20100704/where_is_rehash_command_in_bash

確認

mac:~ hoge$ sphinx-build -h
Sphinx v1.2b3
Usage: /usr/local/bin/sphinx-build [options] sourcedir outdir [filenames...]

General options
^^^^^^^^^^^^^^^

  • b builder to use; default is html
  • a write all files; default is to only write new and changed files
  • E don't use a saved environment, always read all files
  • d path for the cached environment and doctree files

(default: outdir/.doctrees)

  • j build in parallel with N processes where possible

Build configuration options
^^^^^^^^^^^^^^^^^^^^^^^^^^^

  • c path where configuration file (conf.py) is located

(default: same as sourcedir)

  • C use no config file at all, only -D options
  • D override a setting in configuration file
  • t define tag: include "only" blocks with
  • A pass a value into the templates, for HTML builder
  • n nit-picky mode, warn about all missing references

Console output options
^^^^^^^^^^^^^^^^^^^^^^

  • v increase verbosity (can be repeated)
  • q no output on stdout, just warnings on stderr
  • Q no output at all, not even warnings
  • w write warnings (and errors) to given file
  • W turn warnings into errors
  • T show full traceback on exception
  • N do not emit colored output
  • P run Pdb on exception

Filename arguments
^^^^^^^^^^^^^^^^^^
* without -a and without filenames, write new and changed files.
* with -a, write all files.
* with filenames, write these.

Standard options
^^^^^^^^^^^^^^^^

  • h, --help show this help and exit
    • version show version information and exit


For more information, see http://sphinx-doc.org/.

実際に使ってみた感じはまた別の機会に。。。