提交 e0290591 编写于 作者: M Megvii Engine Team

feat(advanced): add gen_html script

GitOrigin-RevId: c1c8a206dbd9e42e978ddb4e48fc70cda498a4ec
上级 e49a3e0d
build
gen_cpp_docs/xml
source/autogen
source/autogen_zh
source/cpp_api
source/locale
*.pyc
......
......@@ -48,7 +48,7 @@
API docstring also contains examples written by [doctest](https://docs.python.org/3/library/doctest.html). Run the tests by
```
gen_python_docs/gendoc.sh ~/.local/lib/python3.6/site-packages
gen_python_docs/gene_html.sh ~/.local/lib/python3.6/site-packages
sphinx-build -b doctest source build/doctest
```
......
......@@ -3,14 +3,10 @@
cd $(dirname $0)
rm -rf ../build/html
AUTOGEN=../source/autogen
AUTOGEN=../source/api
rm -rf $AUTOGEN
if [ -z "$1" ]; then
ROOT_PATH=~/.local/lib/python3.6/site-packages
else
ROOT_PATH=$1
fi
ROOT_PATH=$1
#if [ ! -f "$ROOT_PATH/megengine/example.py" ]; then
#ln -s $PWD/example/example.py $ROOT_PATH/megengine/
......@@ -44,6 +40,14 @@ rm $AUTOGEN/megengine.data.dataset.vision.rst
# to avoid warning for unreferenced file
rm -f $AUTOGEN/modules.rst
cd ..
#
#if [[ -d source/api ]]
#then
# rm -rf source/api
#fi
#mkdir source/api
#cp source/api_zh/* source/api/
#rm -rf source/api_zh
# sphinx-build -b doctest source build/doctest
sphinx-build source build/html
cd ..
sphinx-build source build/html
\ No newline at end of file
......@@ -3,14 +3,10 @@
cd $(dirname $0)
rm -rf ../build/html
AUTOGEN=../source/autogen
AUTOGEN=../source/api_zh
rm -rf $AUTOGEN
if [ -z "$1" ]; then
ROOT_PATH=~/.local/lib/python3.6/site-packages
else
ROOT_PATH=$1
fi
ROOT_PATH=$1
#if [ ! -f "$ROOT_PATH/megengine/example.py" ]; then
#ln -s $PWD/example/example.py $ROOT_PATH/megengine/
......@@ -45,4 +41,4 @@ rm $AUTOGEN/megengine.data.dataset.vision.rst
rm -f $AUTOGEN/modules.rst
cd ..
sphinx-build -D language="zh_CN" source build/html/zh_CN
sphinx-build -D language="zh_CN" source build/html
\ No newline at end of file
#!/bin/bash
if [ ! -n "$1" ]
then
./gen_python_docs/gendoc.sh ~/.local/lib/python3.6/site-packages
else
./gen_python_docs/gendoc.sh $1
fi
if [[ ! -f .tmp ]]
then
mkdir .tmp
fi
cp -r build/html/api/* .tmp/
if [ ! -n "$1" ]
then
./gen_python_docs/gendoc_zh.sh ~/.local/lib/python3.6/site-packages
else
./gen_python_docs/gendoc_zh.sh $1
fi
rm -rf build/html/api
mkdir build/html/api
cp .tmp/* build/html/api
rm -rf .tmp
\ No newline at end of file
......@@ -8,17 +8,17 @@ API Reference
.. toctree::
:maxdepth: 2
autogen/megengine.core
autogen/megengine.functional
autogen/megengine.module
autogen/megengine.module.qat
autogen/megengine.module.quantized
autogen/megengine.module.pytorch
autogen/megengine.optimizer
autogen/megengine.data
autogen/megengine.jit
autogen/megengine.quantization
autogen/megengine.distributed
autogen/megengine.random
autogen/megengine.utils
autogen/megengine.hub
api/megengine.core
api/megengine.functional
api/megengine.module
api/megengine.module.qat
api/megengine.module.quantized
api/megengine.module.pytorch
api/megengine.optimizer
api/megengine.data
api/megengine.jit
api/megengine.quantization
api/megengine.distributed
api/megengine.random
api/megengine.utils
api/megengine.hub
\ No newline at end of file
.. _api_zh:
API 文档
=============
.. _example_reference:
.. toctree::
:maxdepth: 2
api_zh/megengine.core
api_zh/megengine.functional
api_zh/megengine.module
api_zh/megengine.module.qat
api_zh/megengine.module.quantized
api_zh/megengine.module.pytorch
api_zh/megengine.optimizer
api_zh/megengine.data
api_zh/megengine.jit
api_zh/megengine.quantization
api_zh/megengine.distributed
api_zh/megengine.random
api_zh/megengine.utils
api_zh/megengine.hub
......@@ -46,8 +46,7 @@ locale_dirs = ['locale/']
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
gettext_compact = False
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
......
......@@ -74,6 +74,7 @@ MegEngine 的上述特点使其成为了最适合工业级研发的框架之一
首页 <self>
基础学习 <basic/index>
进阶学习 <advanced/index>
api_zh
api
.. footer::
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册