From 86626a74780176a991064ce6ea7ac5d4bd683775 Mon Sep 17 00:00:00 2001 From: weixing02 <564445201@qq.com> Date: Wed, 28 Mar 2018 15:22:43 +0800 Subject: [PATCH] Add English version --- doc/v2/dev/write_docs_cn.rst | 6 ++++++ doc/v2/dev/write_docs_en.rst | 24 ++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/doc/v2/dev/write_docs_cn.rst b/doc/v2/dev/write_docs_cn.rst index f18dd86b517..83d065d3bb4 100644 --- a/doc/v2/dev/write_docs_cn.rst +++ b/doc/v2/dev/write_docs_cn.rst @@ -19,6 +19,9 @@ PaddlePaddle.org工具可以配合Docker使用,需要在系统里先安装好D .. code-block:: bash + mkdir paddlepaddle # Create paddlepaddle working directory + cd paddlepaddle + # Clone the content repositories git clone https://github.com/PaddlePaddle/Paddle.git git clone https://github.com/PaddlePaddle/book.git @@ -36,6 +39,9 @@ PaddlePaddle.org工具可以配合Docker使用,需要在系统里先安装好D .. code-block:: bash + mkdir paddlepaddle # Create paddlepaddle working directory + cd paddlepaddle + # Clone the content repositories and PaddlePaddle.org git clone https://github.com/PaddlePaddle/Paddle.git git clone https://github.com/PaddlePaddle/book.git diff --git a/doc/v2/dev/write_docs_en.rst b/doc/v2/dev/write_docs_en.rst index 15ff0d34ad6..8bc43be6de3 100644 --- a/doc/v2/dev/write_docs_en.rst +++ b/doc/v2/dev/write_docs_en.rst @@ -68,9 +68,29 @@ Please `click here `_ on how to install Docker. After Docker is installed, you could use the scripts in the source directory to build the documentation. +Build PaddlePaddle's documentation with Docker,you need to install Docker first. Please refer to `Docker's official website `_ on how to install Docker. This method is quite similar to ` Build From Sources `_ , by constructing, from source code, a docker image that can be used to build PaddlePaddle documentation. Enter the Docker container and use the script ``build.sh`` in the source directory to build the PaddlePaddle documentation. The specific steps are as follows: -[TBD] +.. code-block:: bash + + git clone https://github.com/PaddlePaddle/Paddle.git + cd Paddle + + # Construct a docker image from source code + docker build -t paddle:dev . + docker run -it -v $PWD:/paddle -e "WITH_GPU=OFF" -e "WITH_TESTING=OFF" -e "WITH_DOC=ON" paddle:dev /bin/bash + + # Use build.sh to build PaddlePaddle documentation + bash -x /paddle/paddle/scripts/docker/build.sh + +Note: The above commands maps the current directory (source root directory) to the :code:`/paddle` directory in the container. + +After compiling, you could enter the ``paddle/build/doc/v2`` directory, where three subdirectories ``cn/html/``, ``en/html`` and ``api/en/html`` are generated. Please enter these directories respectively and execute the following commands: + +.. 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. If you do not wish to use Docker, you can also use the following commands to directly build the PaddlePaddle documentation. -- GitLab