Generating your Docset to Dash

  • 1302
  • 0

摘要:Generating your Docset to Dash

Dash是个好东西,查文档也很方便。虽然免费版总是要等一等,但是不妨碍它的易用性。

但是Dash的文档并不是太全,尤其是一些python框架。因此,手工添加Docset就很方便了。

假设你已经安装了easy_install、pip和virtualenvwrapper。

以flask为例:

git clone https://github.com/mitsuhiko/flask.git
cd flask/
mkvirutualenv env1

New python executable in env1/bin/python

Installing setuptools............done.

Installing pip...............done.

之后继续执行:

python setup.py install
pip install sphinx doc2dash
git submodule update --init
cd docs/
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.

然后执行:

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

 

 

------------------------------

文章的授權使用CC BY-ND2.5協議。凡是標示“轉載”的文章,均來源於網絡並儘可能標註作者。如果有侵犯您的權益,請及時聯繫刪除或者署名、授權。


Gtalk/Email: cmd4shell  [at]  gmail.com