-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Adjust some contents in write_docs_en.rst for Contribue Documentation #9147
Changes from 8 commits
c04000d
335d0e6
72ad688
f77f54f
21869e6
cacd49a
30fb277
e15fbe3
34927cd
f1a390a
e69cf08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,21 +2,20 @@ | |
Contribute Documentation | ||
######################## | ||
|
||
PaddlePaddle supports English documentation ``doc`` and Chinese documentation ``doc_cn``. | ||
Both are compiled by `cmake`_ and `sphinx`_ , the compiled documentations will be stored under ``doc`` and ``doc_cn`` directories. | ||
When using the PaddlePaddle.org to compile documentations, the compiled documentations will be stored under a consolidated directory: .ppo_workspace/content | ||
PaddlePaddle's documentation includes both Chinese and English versions. The documentation is built using the ``cmake`` command to drive the ``sphinx`` compiler. The PaddlePaddle.org tool helps us to implement this compilation process and provides better preview results. | ||
|
||
How to Build Documentations | ||
============ | ||
How to build Documentation | ||
=========================== | ||
|
||
We recommend using PaddlePaddle.org tool to build documentation | ||
PaddlePaddle's documentation is built in two ways: using the PaddlePaddle.org tool and not using the PaddlePaddle.org tool. Both methods have their own advantages. The former facilitates previewing, while the latter facilitates debugging by the developer. And we could chose to build the documentation with docker or without docker in each way. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets make this sentence: PaddlePaddle's documentation is built in two ways: using the PaddlePaddle.org tool and without using it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drop the And in the last sentence. The sentence will be: We could choose to build the documentation with Docker or without it in each of the above ways. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
We recommend using PaddlePaddle.org tool to build documentation. | ||
|
||
Use PaddlePaddle.org tool | ||
-------------- | ||
This is the recommended method to build documentation. It can compile documentation and preview the documentation in a web browser. | ||
With PaddlePaddle.org tool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With -> Using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
--------------------------- | ||
This is the recommended method to build documentation, because it can automatically compile the documentation and preview the documentation directly in the web page. Note that, in other ways, although you can preview the documentation, its style is inconsistent with the official website. While compiling with the PaddlePaddle.org tool produces a preview that is consistent with the official website documentation style. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. directly in the web page -> directly in a web page There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the last part of this paragraph should be as follows: Note that, although you can preview the documentation in other ways, its style may not be consistent with the official website. Compiling with the PaddlePaddle.org tool produces a preview that will be consistent with the official website documentation style. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
The tool uses Docker, please install it on your system. Please check Docker official website on how to install Docker. You may use the following commands to activate the tool | ||
The PaddlePaddle.org tool can be used with Docker and Docker needs to be installed first. Please refer to the `Docker's official website <https://docs.docker.com/>`_ on how to install Docker. After installing Docker, you may use the following command to activate the tool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drop the the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
.. code-block:: bash | ||
|
||
|
@@ -33,7 +32,7 @@ The tool uses Docker, please install it on your system. Please check Docker offi | |
docker run -it -p 8000:8000 -v `pwd`:/var/content paddlepaddle/paddlepaddle.org:latest | ||
|
||
Note: PaddlePaddle.org will read the content repos specified in the -v (volume) flag of the docker run command | ||
Use a web browser and navigate to http://localhost:8000, click the buttons to compile the documentation | ||
Use a web browser and navigate to http://localhost:8000, click the buttons to compile the documentation. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. navigate to http://localhost:8000, click the -> navigate to http://localhost:8000. Click the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
The compiled documentations will be stored in <paddlepaddle working directory>/.ppo_workspace/content | ||
|
||
|
||
|
@@ -58,19 +57,62 @@ If you don't wish to use Docker, you can also activate the tool through Django. | |
pip install -r requirements.txt | ||
python manage.py runserver | ||
|
||
Specify the PaddlePaddle working directory for the environment variable CONTENT_DIR so that the tool could find where the working directory is. | ||
|
||
Use a web browser and navigate to http://localhost:8000, click the buttons to compile the documentation | ||
The compiled documentations will be stored in <paddlepaddle working directory>/.ppo_workspace/content | ||
|
||
If you want to learn more on the PaddlePaddle.org, please `click here <https://github.com/PaddlePaddle/PaddlePaddle.org/blob/develop/README.md>`_ 。 | ||
Please `click here <https://github.com/PaddlePaddle/PaddlePaddle.org/blob/develop/README.md>`_ to get more informations about PaddlePaddle.org tool。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to get more informations about PaddlePaddle.org tool -> for more information about the PaddlePaddle.org tool There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
|
||
Without PaddlePaddle.org tool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The title should be Manually Building the Documentation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
------------------------------- | ||
|
||
Build PaddlePaddle's documentation with Docker,you need to install Docker first. Please refer to the `Docker's official website <https://docs.docker.com/>`_ on how to install Docker. After Docker is installed, you could use the scripts in the source directory to build the documentation. | ||
|
||
[TBD] | ||
|
||
If you do not wish to use Docker, you can also use the following command to directly build the PaddlePaddle documentation. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. command -> commands There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
.. code-block:: bash | ||
|
||
mkdir paddle | ||
cd paddle | ||
git clone https://github.com/PaddlePaddle/Paddle.git | ||
mkdir -p build | ||
cd build | ||
cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_GPU=OFF -DWITH_MKL=OFF -DWITH_DOC=ON | ||
|
||
# If you only need to build documents, use the following command | ||
make -j $processors gen_proto_py | ||
make -j $processors paddle_docs paddle_docs_cn | ||
|
||
# If you only need to build APIs, use the following command | ||
make -j $processors gen_proto_py framework_py_proto | ||
make -j $processors copy_paddle_pybind | ||
make -j $processors paddle_api_docs | ||
|
||
$processors indicates that as many processes as the CPU cores are started to compile in parallel. It should be set according to the number of CPU cores of your machine. | ||
|
||
After the compilation is complete, enter the ``doc/v2`` directory. If you chose to build documents, it will generate ``cn/html/`` and ``en/html`` subdirectories under this directory. If you chose to build APIs,it will generate``api/en/html`` subdirectory. Please enter these directories respectively and execute the following command: | ||
|
||
.. code-block:: bash | ||
|
||
python -m SimpleHTTPServer 8088 | ||
|
||
Use a web browser and navigate to http://localhost:8000, you could see the compiled Chinese/English documents page and the English APIs page. The following figure is an example of the built English documents home page. Note that due to the sphinx's original theme used in the example, the style of the page is not consistent with the official website, but this does not affect the developer's debugging. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
How to write Documentations | ||
============ | ||
.. image:: src/doc_en.png | ||
:align: center | ||
:scale: 60 % | ||
|
||
PaddlePaddle uses `sphinx`_ to compile documentations,Please check sphinx official website for more detail. | ||
How to write Documentation | ||
=========================== | ||
|
||
PaddlePaddle uses `sphinx`_ to compile documentation,Please check sphinx official website for more detail. | ||
|
||
How to update www.paddlepaddle.org | ||
============================ | ||
=================================== | ||
|
||
Please create PRs and submit them to github, please check `Contribute Code <http://www.paddlepaddle.org/docs/develop/documentation/en/howto/dev/contribute_to_paddle_en.html>`_ 。 | ||
PaddlePaddle develop branch will update the documentation once the PR is merged. User may check latest `Chinese Docs <http://www.paddlepaddle.org/docs/develop/documentation/zh/getstarted/index_cn.html>`_ and | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
35行:之后再用网页连到http://localhost:8000 (后面加个空格,这样会显示成网址效果)
同60行。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done