Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
5b1c0b3b
提交
5b1c0b3b
authored
5月 26, 2014
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add a --cache option to docgen to make it not disable the doctree cache.
This helps immensly when writing or editing documenation by massively speeding up documentation rebuilds (as in 2-3s versus 60-90s before).
上级
c01948b6
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
12 行增加
和
5 行删除
+12
-5
docgen.py
doc/scripts/docgen.py
+12
-5
没有找到文件。
doc/scripts/docgen.py
浏览文件 @
5b1c0b3b
...
@@ -65,10 +65,11 @@ if __name__ == '__main__':
...
@@ -65,10 +65,11 @@ if __name__ == '__main__':
options
.
update
(
dict
([
x
,
y
or
True
]
for
x
,
y
in
options
.
update
(
dict
([
x
,
y
or
True
]
for
x
,
y
in
getopt
.
getopt
(
sys
.
argv
[
1
:],
getopt
.
getopt
(
sys
.
argv
[
1
:],
'o:'
,
'o:'
,
[
'epydoc'
,
'rst'
,
'help'
,
'nopdf'
])[
0
]))
[
'epydoc'
,
'rst'
,
'help'
,
'nopdf'
,
'cache'
])[
0
]))
if
options
[
'--help'
]:
if
options
[
'--help'
]:
print
'Usage:
%
s [OPTIONS]'
%
sys
.
argv
[
0
]
print
'Usage:
%
s [OPTIONS]'
%
sys
.
argv
[
0
]
print
' -o <dir>: output the html files in the specified dir'
print
' -o <dir>: output the html files in the specified dir'
print
' --cache: use the doctree cache'
print
' --rst: only compile the doc (requires sphinx)'
print
' --rst: only compile the doc (requires sphinx)'
print
' --nopdf: do not produce a PDF file from the doc, only HTML'
print
' --nopdf: do not produce a PDF file from the doc, only HTML'
print
' --epydoc: only compile the api documentation'
,
print
' --epydoc: only compile the api documentation'
,
...
@@ -114,16 +115,22 @@ if __name__ == '__main__':
...
@@ -114,16 +115,22 @@ if __name__ == '__main__':
if
options
[
'--all'
]
or
options
[
'--rst'
]:
if
options
[
'--all'
]
or
options
[
'--rst'
]:
mkdir
(
"doc"
)
mkdir
(
"doc"
)
import
sphinx
sys
.
path
[
0
:
0
]
=
[
os
.
path
.
join
(
throot
,
'doc'
)]
sys
.
path
[
0
:
0
]
=
[
os
.
path
.
join
(
throot
,
'doc'
)]
sphinx
.
main
([
''
,
'-E'
,
os
.
path
.
join
(
throot
,
'doc'
),
'.'
])
def
call_sphinx
(
builder
,
workdir
,
extraopts
=
None
):
import
sphinx
if
extraopts
is
None
:
extraopts
=
[]
if
not
options
[
'--cache'
]:
extraopts
.
append
(
'-E'
)
sphinx
.
main
([
''
,
'-b'
,
builder
]
+
extraopts
+
[
os
.
path
.
join
(
throot
,
'doc'
),
workdir
])
call_sphinx
(
'html'
,
'.'
)
if
not
options
[
'--nopdf'
]:
if
not
options
[
'--nopdf'
]:
# Generate latex file in a temp directory
# Generate latex file in a temp directory
import
tempfile
import
tempfile
workdir
=
tempfile
.
mkdtemp
()
workdir
=
tempfile
.
mkdtemp
()
sphinx
.
main
([
''
,
'-E'
,
'-b'
,
'latex'
,
call_sphinx
(
'latex'
,
workdir
)
os
.
path
.
join
(
throot
,
'doc'
),
workdir
])
# Compile to PDF
# Compile to PDF
os
.
chdir
(
workdir
)
os
.
chdir
(
workdir
)
os
.
system
(
'make'
)
os
.
system
(
'make'
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论