Fix some outdated contents in Contribute Documentations

shanyi15-patch-2
weixing02 7 years ago
parent 6c06841ba0
commit e1b2408011

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

@ -79,20 +79,40 @@ PaddlePaddle的文档构建有三种方式。
直接构建
--------
如果提示正确,可以执行以下命令编译生成文档,即
直接构建可以分为两种方式分别是构建文档和构建API。
.. code-block:: bash
- 构建文档
cd TO_YOUR_PADDLE_CLONE_PATH
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_GPU=OFF -DWITH_MKL=OFF -DWITH_DOC=ON
make gen_proto_py
make paddle_docs paddle_docs_cn
如果只需要构建文档,可以执行以下命令编译生成文档,即:
编译完成之后,会在当前目录生成两个子目录\: doc(英文文档目录)和 doc_cn(中文文档目录)。
打开浏览器访问对应目录下的index.html即可访问本地文档。
.. code-block:: bash
make -j $processors gen_proto_py
make -j $processors paddle_docs paddle_docs_cn
- 构建API
如果只需要构建API则可以执行以下命令编译生成文档
.. code-block:: bash
make -j $processors gen_proto_py framework_py_proto
make -j $processors copy_paddle_pybind
make -j $processors paddle_api_docs
其中$processors代表启动多少个进程来进行编译一般取值为14或8。
编译完成后从当前目录进入doc/v2目录该目录下生成了三个子目录可以分别进入目录cn/html/、en/html、api/en/html中执行以下命令
.. code-block:: bash
python -m SimpleHTTPServer 8088
在浏览器中输入http://localhost:8088就可以看到编译生成的中/英文的文档页面和英文的API页面,下图为生成的英文文档页面示例。
.. image:: doc_en.png
:align: center
:scale: 60 %
如何书写文档
============

@ -63,6 +63,44 @@ The compiled documentations will be stored in <paddlepaddle working directory>/.
If you want to learn more on the PaddlePaddle.org, please `click here <https://github.com/PaddlePaddle/PaddlePaddle.org/blob/develop/README.md>`_
build documentations directly
----------------------------
There's two ways to build documentations directly: build documents and build APIs
- build documents
If you only need to build documents, you can execute the following command to set up:
.. code-block:: bash
make -j $processors gen_proto_py
make -j $processors paddle_docs paddle_docs_cn
- build APIs
If you only need to build APIs, you can execute the following command to set up:
.. code-block:: bash
make -j $processors gen_proto_py framework_py_proto
make -j $processors copy_paddle_pybind
make -j $processors paddle_api_docs
$processors represents how many processes are started for compilation. Generally, it can be set to 1, 4, or 8.
After the compilation is complete, enter the doc/v2 directory. Three subdirectories are generated under this directory. You can enter the directories cn/html/, en/html, and api/en/html respectively and execute the following commands:
.. code-block:: bash
python -m SimpleHTTPServer 8088
Enter http://localhost:8088 in the browser to see the compiled Chinese/English documents page and the English APIs page. The following picture shows an example of a generated English document page.
.. image:: doc_en.png
:align: center
:scale: 60 %
How to write Documentations
============

Loading…
Cancel
Save