Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some outdated contents in Contribute Documentations #9016

Merged
merged 10 commits into from
Mar 14, 2018

Conversation

weixing02
Copy link
Collaborator

resolve #8993

weixing02 added 2 commits March 13, 2018 11:26
Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以先改中文文档,等确定后再改英文文档。

@@ -79,20 +79,40 @@ PaddlePaddle的文档构建有三种方式。
直接构建
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

考虑下:如何将直接构建和使用Docker构建合并,即整体分为两种:使用paddlepaddle.org工具,不使用paddlepaddle.org工具。每个里面分(使用docker和不使用docker)。
两种各有优点,前者方便预览,后者方便开发者进行调试。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,这样从逻辑上更为合理些,谢谢!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -79,20 +79,40 @@ PaddlePaddle的文档构建有三种方式。
直接构建
--------

如果提示正确,可以执行以下命令编译生成文档,即
直接构建可以分为两种方式,分别是构建文档和构建API。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


编译完成之后,会在当前目录生成两个子目录\: doc(英文文档目录)和 doc_cn(中文文档目录)。
打开浏览器访问对应目录下的index.html即可访问本地文档。
.. code-block:: bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git clone https://github.com/PaddlePaddle/Paddle.git
cd TO_YOUR_PADDLE_CLONE_PATH
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_GPU=OFF -DWITH_MKL=OFF -DWITH_DOC=ON

等类似这些命令都要有,对用户来说,需要从第一步开始。
类似paddlepaddle.org工具那样,写出完整的命令。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

make -j $processors copy_paddle_pybind
make -j $processors paddle_api_docs

其中$processors代表启动多少个进程来进行编译,一般取值为1,4或8。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其中$processors代表启动和 CPU 核一样多的进程来并行编译。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_GPU=OFF -DWITH_MKL=OFF -DWITH_DOC=ON
make gen_proto_py
make paddle_docs paddle_docs_cn
如果只需要构建文档,可以执行以下命令编译生成文档,即:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

84-86行,93-95行可以不用写。具体区分在命令中写出来即可。类似http://www.paddlepaddle.org/docs/develop/documentation/zh/build_and_install/build_from_source_cn.html#build-step 在命令中区分了两种方法。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

谢谢!但在命令中使用注释区分会不会不够明显呢

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 因为除了命令稍有不同外,其他的描述都是类似的。
  • 对应到使用paddlepaddle.org工具时,也只是里面选的按钮不同,其他并无区别。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


其中$processors代表启动多少个进程来进行编译,一般取值为1,4或8。

编译完成后,从当前目录进入doc/v2目录,该目录下生成了三个子目录,可以分别进入目录cn/html/、en/html、api/en/html中,执行以下命令,即:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要说明,构建文档会生成cn/htmlen/html目录,构建api会生成api/en/html

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


.. image:: doc_en.png
:align: center
:scale: 60 %
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要放英文页面首页。并说明这是采用sphinx主题生成的,因此和官网的风格不一样,但方便开发者调试。语言请重新组织。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


.. image:: doc_en.png
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

图片请新建一个src目录,统一放在src目录下。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done



使用PaddlePaddle.org工具
--------------
----------------------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

15行需要超过14行,才不会报warning,下同。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

cd paddlepaddle

# Clone the content repositories
git clone https://github.com/PaddlePaddle/Paddle.git
cd TO_YOUR_PADDLE_CLONE_PATH
cd paddle/scripts/tools/build_docs
sh build_docs.sh

编译完成之后,会在当前目录生成两个子目录\: doc(英文文档目录)和 doc_cn(中文文档目录)。
打开浏览器访问对应目录下的index.html即可访问本地文档。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker这段的描述和命令都不对,可以等下一个PR来进行修改。类似docker run -it -p 8000:8000 -v pwd:/var/content paddlepaddle/paddlepaddle.org:latest的命令。这里可以先把这段删了,改成TBD。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

make paddle_docs paddle_docs_cn
# Clone the content repositories
git clone https://github.com/PaddlePaddle/Paddle.git
cd TO_YOUR_PADDLE_CLONE_PATH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

88-93行:

mkdir paddle
cd paddle
git clone https://github.com/PaddlePaddle/Paddle.git
mkdir -p build

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug改成Release

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

make -j $processors copy_paddle_pybind
make -j $processors paddle_api_docs

其中$processors代表启动和CPU核一样多的进程来并行编译,一般取值为1,4或8,可以根据本机的CPU核数设置相应的值。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“一般取值为1,4或8”去掉。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

这个是目前推荐的使用方法。除了可以自动编译文档,也可以直接在网页预览文档。

文件工具是使用Docker,需要在系统里先安装好Docker工具包。Docker安装请参考Docker的官网。安装好Docker之后及可用以下命令启动工具
PaddlePaddle.org工具可以配合Docker使用,需要在系统里先安装好Docker工具包。Docker安装请参考Docker的官网。安装好Docker之后即可用以下命令启动工具
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请参考Docker的官网,官网链接可参考68行。

@@ -8,14 +8,14 @@ PaddlePaddle的文档包括英文文档 ``doc`` 和中文文档 ``doc_cn`` 两
如何构建文档
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

第5-6行改为:PaddlePaddle的文档包括中英文两个部分。文档都是通过 cmake_ 驱动 sphinx_ 编译生成,也可以利用paddlepaddle.org工具来编译和预览文档。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -8,14 +8,14 @@ PaddlePaddle的文档包括英文文档 ``doc`` 和中文文档 ``doc_cn`` 两
如何构建文档
============

PaddlePaddle的文档构建有三种方式
PaddlePaddle的文档构建有两种方式
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为后面两种方式的介绍比较长,因此在11行先对这两种方式说明一下各自的优点。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done



使用PaddlePaddle.org工具
--------------
----------------------
这个是目前推荐的使用方法。除了可以自动编译文档,也可以直接在网页预览文档。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接在网页预览文档。(描述不准确,后面那个方式也能预览文档,这儿是预览样式和官网效果一样,语言请重新组织)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


.. image:: src/doc_en.png
:align: center
:scale: 60 %

如何书写文档
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

129行的提交方式参见 贡献文档 <http://www.paddlepaddle.org/docs/develop/documentation/en/howto/dev/contribute_to_paddle_en.html>_
改成:如何贡献代码,并使用正确链接。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以对应修改英文文档。

@@ -102,7 +110,7 @@ PaddlePaddle文档使用 `sphinx`_ 自动生成,用户可以参考sphinx教程
如何更新www.paddlepaddle.org
============================

更新的文档以PR的形式提交到github中,提交方式参见 `贡献文档 <http://www.paddlepaddle.org/docs/develop/documentation/en/howto/dev/contribute_to_paddle_en.html>`_ 。
更新的文档以PR的形式提交到github中,提交方式参见 `如何贡献文档 <http://www.paddlepaddle.org/docs/develop/documentation/zh/dev/write_docs_cn.html>`_ 。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

提交方式应该是参加如何贡献代码,并对应修改链接。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@luotao1 luotao1 merged commit 7276366 into PaddlePaddle:develop Mar 14, 2018
@weixing02 weixing02 deleted the doc branch March 14, 2018 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix some outdated contents in Contribute Documentation
2 participants