Dash是个好东西,查文档也很方便。虽然免费版总是要等一等,但是不妨碍它的易用性。
但是Dash的文档并不是太全,尤其是一些python框架。因此,手工添加Docset就很方便了。
假设你已经安装了easy_install、pip和virtualenvwrapper。
以flask为例:
1
git clone https:``//github.com/mitsuhiko/flask.git
2
cd flask/
3
mkvirutualenv env1
New python executable in env1/bin/python
Installing setuptools............done.
Installing pip...............done.
之后继续执行:
1
python setup.py install
2
pip install sphinx doc2dash
3
git submodule update --init
4
cd docs/
5
make html
输出:
sphinx-build -b html -d _build/doctrees . _build/html
Running Sphinx v1.1.3
loading pickled environment... not yet created
loading intersphinx inventory from http://docs.python.org/dev/objects.inv...
loading intersphinx inventory from http://werkzeug.pocoo.org/docs/objects.inv...
loading intersphinx inventory from http://wtforms.simplecodes.com/docs/0.5/objects.inv...
loading intersphinx inventory from http://www.sqlalchemy.org/docs/objects.inv...
loading intersphinx inventory from http://discorporate.us/projects/Blinker/docs/1.1/objects.inv...
building [html]: targets for 67 source files that are out of date
updating environment: 67 added, 0 changed, 0 removed
reading sources... [100%] views
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] views
writing additional files... genindex search
copying images... [100%] _static/yes.png
copying static files... done
dumping search index... done
dumping object inventory... done
build succeeded, 2 warnings.Build finished. The HTML pages are in _build/html.
然后执行:
1
doc2dash -n Flask -i _static/flask.png -a -d ~/Library/Application\ Support/Dash/DocSets/Flask _build/html/
这样就可以将文档成功加入到dash中。当然了,你也可以下载我编译的版本(Flask v0.10)直接双击导入Flask.docset.zip.
或者点击: http://pan.baidu.com/share/link?shareid=416887&uk=3221447612