Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
970f985d
提交
970f985d
authored
10月 09, 2008
作者:
Olivier Breuleux
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
options for scripts/docgen
上级
03971aa6
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
29 行增加
和
14 行删除
+29
-14
epydoc.conf
doc/api/epydoc.conf
+0
-3
ext.py
doc/ext.py
+4
-0
docgen.py
scripts/docgen.py
+25
-11
没有找到文件。
doc/api/epydoc.conf
浏览文件 @
970f985d
...
@@ -13,9 +13,6 @@ modules: theano
...
@@ -13,9 +13,6 @@ modules: theano
# of: html, text, latex, dvi, ps, pdf.
# of: html, text, latex, dvi, ps, pdf.
output
:
html
output
:
html
# The path to the output directory. May be relative or absolute.
target
:
html
/
api
/
# An integer indicating how verbose epydoc should be. The default
# An integer indicating how verbose epydoc should be. The default
# value is 0; negative values will supress warnings and errors;
# value is 0; negative values will supress warnings and errors;
# positive values will give more verbose output.
# positive values will give more verbose output.
...
...
doc/ext.py
浏览文件 @
970f985d
import
sys
import
re
import
re
import
os
import
os
from
docutils
import
nodes
,
utils
from
docutils
import
nodes
,
utils
...
@@ -59,9 +60,12 @@ def create_api_role(name, problematic):
...
@@ -59,9 +60,12 @@ def create_api_role(name, problematic):
def
setup
(
app
):
def
setup
(
app
):
try
:
xlink
.
set_api_file
(
'api'
,
os
.
path
.
join
(
app
.
outdir
,
'api'
,
'api-objects.txt'
))
xlink
.
set_api_file
(
'api'
,
os
.
path
.
join
(
app
.
outdir
,
'api'
,
'api-objects.txt'
))
xlink
.
set_api_root
(
'api'
,
os
.
path
.
join
(
app
.
outdir
,
'api'
,
''
))
xlink
.
set_api_root
(
'api'
,
os
.
path
.
join
(
app
.
outdir
,
'api'
,
''
))
#xlink.create_api_role('api', True)
#xlink.create_api_role('api', True)
create_api_role
(
'api'
,
True
)
create_api_role
(
'api'
,
True
)
except
IOError
:
print
>>
sys
.
stderr
,
'WARNING: Could not find api file! API links will not work.'
app
.
add_role
(
"wiki"
,
role_fn
)
app
.
add_role
(
"wiki"
,
role_fn
)
scripts/docgen.py
浏览文件 @
970f985d
...
@@ -54,11 +54,25 @@ docintrospecter.register_introspecter(
...
@@ -54,11 +54,25 @@ docintrospecter.register_introspecter(
priority
=-
1
)
priority
=-
1
)
import
getopt
from
collections
import
defaultdict
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
throot
=
"/"
.
join
(
sys
.
path
[
0
]
.
split
(
"/"
)[:
-
1
])
throot
=
"/"
.
join
(
sys
.
path
[
0
]
.
split
(
"/"
)[:
-
1
])
options
=
defaultdict
(
bool
)
options
.
update
(
dict
([
x
,
y
or
True
]
for
x
,
y
in
getopt
.
getopt
(
sys
.
argv
[
1
:],
'o:'
,
[
'epydoc'
,
'rst'
,
'help'
])[
0
]))
if
options
[
'--help'
]:
print
'Usage:
%
s [OPTIONS]'
%
sys
.
argv
[
0
]
print
' -o <dir>: output the html files in the specified dir'
print
' --rst: only compile the doc (requires sphinx)'
print
' --epydoc: only compile the api documentation (requires epydoc)'
print
' --help: this help'
sys
.
exit
(
0
)
options
[
'--all'
]
=
not
(
bool
(
options
[
'--epydoc'
])
^
bool
(
options
[
'--rst'
]))
import
gen_oplist
import
gen_oplist
print
'Generating oplist...'
print
'Generating oplist...'
gen_oplist
.
print_file
(
open
(
'
%
s/doc/doc/oplist.txt'
%
throot
,
'w'
))
gen_oplist
.
print_file
(
open
(
'
%
s/doc/doc/oplist.txt'
%
throot
,
'w'
))
...
@@ -69,28 +83,28 @@ if __name__ == '__main__':
...
@@ -69,28 +83,28 @@ if __name__ == '__main__':
gen_typelist
.
print_file
(
open
(
'
%
s/doc/doc/typelist.txt'
%
throot
,
'w'
))
gen_typelist
.
print_file
(
open
(
'
%
s/doc/doc/typelist.txt'
%
throot
,
'w'
))
print
'typelist done!'
print
'typelist done!'
os
.
chdir
(
throot
)
def
mkdir
(
path
):
def
mkdir
(
path
):
try
:
try
:
os
.
mkdir
(
path
)
os
.
mkdir
(
path
)
except
OSError
:
except
OSError
:
pass
pass
mkdir
(
"html"
)
outdir
=
options
[
'-o'
]
or
(
throot
+
'/html'
)
mkdir
(
"html/doc"
)
mkdir
(
outdir
)
mkdir
(
"html/api"
)
os
.
chdir
(
outdir
)
mkdir
(
"doc"
)
mkdir
(
"api"
)
if
len
(
sys
.
argv
)
==
1
or
sys
.
argv
[
1
]
!=
'rst'
:
if
options
[
'--all'
]
or
options
[
'--epydoc'
]
:
from
epydoc.cli
import
cli
from
epydoc.cli
import
cli
sys
.
path
[
0
:
0
]
=
os
.
path
.
realpath
(
'.'
)
sys
.
path
[
0
:
0
]
=
throot
sys
.
argv
[:]
=
[
''
,
'--config'
,
'
doc/api/epydoc.conf'
,
'-o'
,
'html/
api'
]
sys
.
argv
[:]
=
[
''
,
'--config'
,
'
%
s/doc/api/epydoc.conf'
%
throot
,
'-o'
,
'
api'
]
cli
()
cli
()
# os.system("epydoc --config doc/api/epydoc.conf -o html/api")
# os.system("epydoc --config doc/api/epydoc.conf -o html/api")
if
len
(
sys
.
argv
)
==
1
or
sys
.
argv
[
1
]
!=
'epydoc'
:
if
options
[
'--all'
]
or
options
[
'--rst'
]
:
import
sphinx
import
sphinx
sys
.
path
[
0
:
0
]
=
[
os
.
path
.
realpath
(
'doc'
)]
sys
.
path
[
0
:
0
]
=
[
os
.
path
.
join
(
throot
,
'doc'
)]
sphinx
.
main
([
''
,
'-E'
,
'doc'
,
'html
'
])
sphinx
.
main
([
''
,
'-E'
,
os
.
path
.
join
(
throot
,
'doc'
),
'.
'
])
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论