Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
Docs
提交
ce2e678f
D
Docs
项目概览
MegEngine 天元
/
Docs
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ce2e678f
编写于
6月 16, 2020
作者:
M
Megvii Engine Team
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify readme and use script to get mge root
GitOrigin-RevId: bdf1e57aac03153ae13e0096c7cd520b35baca5d
上级
dff01de9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
19 deletion
+23
-19
README.md
README.md
+15
-6
gen_python_docs/gendoc.sh
gen_python_docs/gendoc.sh
+2
-5
gen_python_docs/gendoc_zh.sh
gen_python_docs/gendoc_zh.sh
+3
-5
gen_python_docs/gene_html.sh
gen_python_docs/gene_html.sh
+3
-3
未找到文件。
README.md
浏览文件 @
ce2e678f
...
...
@@ -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
```
...
...
gen_python_docs/gendoc.sh
浏览文件 @
ce2e678f
...
...
@@ -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
gen_python_docs/gendoc_zh.sh
浏览文件 @
ce2e678f
...
...
@@ -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
gen_python_docs/gene_html.sh
浏览文件 @
ce2e678f
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录