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

modify readme and use script to get mge root

GitOrigin-RevId: bdf1e57aac03153ae13e0096c7cd520b35baca5d
上级 dff01de9
......@@ -18,16 +18,25 @@
```bash
pip3 install megengine -f https://megengine.org.cn/whl/mge.html
```
2. Get MegEngine installation path ``MGE_ROOT``.
2. Run [gen_python_docs/gendoc.sh](gen_python_docs/gendoc.sh) to generate HTML files.
The script accepts the previous python `site-packages` directory as the argument.
Default value is `~/.local/lib/python3.6/site-packages`.
Note that the RST files generated from python docstring are put under `source/autogen`.
```bash
./gen_python_docs/gene_html.sh ~/.local/lib/python3.6/site-packages
MGE_ROOT=`python3 -c "import os; \
import megengine; \
print(os.path.dirname(megengine.__file__))"`
echo "MegEngine installed at" $MGE_ROOT
```
3. Start local sphinx service by:
3. Run [gen_python_docs/gendoc.sh](gen_python_docs/gendoc.sh) to generate HTML files.
The script accepts the MegEngine installation path as the argument.
```bash
./gen_python_docs/gene_html.sh $MGE_ROOT
```
Note that the RST files generated from python docstring are put under `source/autogen`.
4. Start local sphinx service by:
```bash
sphinx-serve -b build -p 8000
```
......
......@@ -14,10 +14,7 @@ ROOT_PATH=$1
export SPHINX_APIDOC_OPTIONS="members,undoc-members,show-inheritance"
for i in megengine
do
sphinx-apidoc -t templates -M -o $AUTOGEN $(realpath $ROOT_PATH)/$i
done
sphinx-apidoc -t templates -M -o $AUTOGEN $(realpath $ROOT_PATH)
tail -n +4 $AUTOGEN/megengine.data.transform.rst >> $AUTOGEN/megengine.data.rst
rm $AUTOGEN/megengine.data.transform.rst
......@@ -50,4 +47,4 @@ rm -f $AUTOGEN/modules.rst
#rm -rf source/api_zh
# sphinx-build -b doctest source build/doctest
cd ..
sphinx-build source build/html
\ No newline at end of file
sphinx-build source build/html
......@@ -14,10 +14,7 @@ ROOT_PATH=$1
export SPHINX_APIDOC_OPTIONS="members,undoc-members,show-inheritance"
for i in megengine
do
sphinx-apidoc -t templates -M -o $AUTOGEN $(realpath $ROOT_PATH)/$i
done
sphinx-apidoc -t templates -M -o $AUTOGEN $(realpath $ROOT_PATH)
tail -n +4 $AUTOGEN/megengine.data.transform.rst >> $AUTOGEN/megengine.data.rst
rm $AUTOGEN/megengine.data.transform.rst
......@@ -41,4 +38,5 @@ rm $AUTOGEN/megengine.data.dataset.vision.rst
rm -f $AUTOGEN/modules.rst
cd ..
sphinx-build -D language="zh_CN" source build/html
\ No newline at end of file
sphinx-build -D language="zh_CN" source build/html
......@@ -3,7 +3,7 @@
if [ ! -n "$1" ]
then
./gen_python_docs/gendoc.sh ~/.local/lib/python3.6/site-packages
./gen_python_docs/gendoc.sh ~/.local/lib/python3.6/site-packages/megengine
else
./gen_python_docs/gendoc.sh $1
fi
......@@ -16,11 +16,11 @@ fi
cp -r build/html/api/* .tmp/
if [ ! -n "$1" ]
then
./gen_python_docs/gendoc_zh.sh ~/.local/lib/python3.6/site-packages
./gen_python_docs/gendoc_zh.sh ~/.local/lib/python3.6/site-packages/megengine
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
rm -rf .tmp
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册