sphinx生成cakephp文档

cakephp的文档是用一个叫sphinx程序生成的 这个程序是python写的,所以我们要用sphinx本机必须先装python。

编译过程在Ubuntu下进行,默认Ubuntu已经安装了python, 命令行下依次执行

sudo apt-get install python-setuptools
sudo apt-get install easy_install
easy_install sphinx
easy_install sphinxcontrib-phpdomain

最后把cakephp的官方文档下载到本地.

git --clone https://github.com/cakephp/docs.git
#根目录执行
cd docs 
make html 
#或者使用下面的命令,只编译en目录,就是英文的HTML文档,
make html-en

编译完成后最终根目录下多出个build目录,打开html/en/index.html。

页面和官网一模一样!http://book.cakephp.org/2.0/en/index.html

 

执行make实际运行的是Makefile文件,在windows下是make.bat批处理, 不过遗憾的是cakephp官方人员并没有提供bat文件。

关于这个问题,我壮着胆子还专门发邮件问了cakephp的作者Mark Story,没想到过了两天给我回信了,内容贴给大家看:

Unfortunately I've never tried to build the docs under windows. There is some support from sphinx (the tool we use to build the docs) for windows. But the additional customizations we've done to make it easy to build all the languages etc were never ported to windows as most people working on the docs don't use windows.

-Mark

On 2013-07-04, at 12:09 AM, Finley Fei Ma
wrote:

> Hi, Mark,
> I am a CakePHP fan also a PHP developer from China, recently I am studying the CakePHP doc, I meet a problem, I don’t know how to build the document under the Windows operating system, there is a Makefile,  looks like it only can run under Linux. So must I install  a Linux operating system?
>  
> Regards,
> Finley
posted @ 2013-08-15 16:31  飞凡123  阅读(462)  评论(1编辑  收藏  举报