Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
fd3e360c
提交
fd3e360c
authored
9月 23, 2008
作者:
bergstrj@lgcm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added apirst2html script, simplified html generation scripts
上级
8af8f24c
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
63 行增加
和
6 行删除
+63
-6
apirst2html.py
doc/apirst2html.py
+41
-0
gen_op_list.py
gen_op_list.py
+8
-0
local.build_html.sh
local.build_html.sh
+14
-6
没有找到文件。
doc/apirst2html.py
0 → 100755
浏览文件 @
fd3e360c
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
"""An HTML writer supporting link to external documentation.
This module is a frontend for the Docutils_ HTML writer. It allows a document
to reference objects documented in the API documentation generated by
extraction tools such as Doxygen_ or Epydoc_.
.. _Docutils: http://docutils.sourceforge.net/
.. _Doxygen: http://www.doxygen.org/
.. _Epydoc: http://epydoc.sourceforge.net/
"""
# $Id: apirst2html.py 1531 2007-02-18 23:07:25Z dvarrazzo $
__version__
=
"$Revision: 1531 $"
[
11
:
-
2
]
__author__
=
"Daniele Varrazzo"
__copyright__
=
"Copyright (C) 2007 by Daniele Varrazzo"
__docformat__
=
'reStructuredText en'
try
:
import
locale
locale
.
setlocale
(
locale
.
LC_ALL
,
''
)
except
:
pass
# We have to do some path magic to prevent Python from getting
# confused about the difference between the ``epydoc.py`` script, and the
# real ``epydoc`` package. So remove ``sys.path[0]``, which contains the
# directory of the script.
import
sys
,
os
.
path
script_path
=
os
.
path
.
abspath
(
sys
.
path
[
0
])
sys
.
path
=
[
p
for
p
in
sys
.
path
if
os
.
path
.
abspath
(
p
)
!=
script_path
]
import
epydoc.docwriter.xlink
as
xlink
from
docutils.core
import
publish_cmdline
,
default_description
description
=
(
'Generates (X)HTML documents with API documentation links. '
+
default_description
)
publish_cmdline
(
reader
=
xlink
.
ApiLinkReader
(),
writer_name
=
'html'
,
description
=
description
)
gen_op_list.py
浏览文件 @
fd3e360c
...
@@ -16,5 +16,13 @@ for module in [tensor]:
...
@@ -16,5 +16,13 @@ for module in [tensor]:
if
isOp
(
symbol
):
if
isOp
(
symbol
):
print
""
print
""
print
"- `
%
s.
%
s`"
%
(
module
.
__name__
,
symbol_name
)
print
"- `
%
s.
%
s`"
%
(
module
.
__name__
,
symbol_name
)
docstring
=
getattr
(
symbol
,
'__doc__'
,
""
)
if
not
docstring
:
print
'No documentation'
elif
len
(
docstring
)
<
50
:
print
docstring
else
:
print
docstring
[:
40
],
"..."
local.build_html.sh
100644 → 100755
浏览文件 @
fd3e360c
#!/bin/bash
#!/bin/bash
mkdir
-p
html/api
APIRST2HTML
=
doc/apirst2html.py
EPYDOC_ARGS
=
'--external-api=api --external-api-file=api:html/api/api-objects.txt --external-api-root=api:../api/'
mkdir
-p
html/api
mkdir
-p
html/doc
if
[
"
$1
"
!=
" rst"
]
;
then
epydoc
--config
local.epydoc
epydoc
--config
local.epydoc
fi
cd
doc
if
[
"
$1
"
!=
" epydoc"
]
;
then
sh build_html.sh
for
RST
in
graph oplist
;
do
cd
../
$APIRST2HTML
$EPYDOC_ARGS
doc/
$RST
.txt html/doc/
$RST
.html
rm
-Rf
html/doc
done
mv
doc/html html/doc
fi
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论