Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
34a9c58e
Commit
34a9c58e
authored
Jun 14, 2000
by
Amos Latteier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Beautified API docs and added support for Zope constructors in API docs.
parent
42ad3194
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
34 deletions
+36
-34
lib/python/HelpSys/APIHelpTopic.py
lib/python/HelpSys/APIHelpTopic.py
+10
-1
lib/python/HelpSys/APIView.dtml
lib/python/HelpSys/APIView.dtml
+13
-4
lib/python/HelpSys/methodView.dtml
lib/python/HelpSys/methodView.dtml
+11
-17
lib/python/HelpSys/topic_header.dtml
lib/python/HelpSys/topic_header.dtml
+2
-12
No files found.
lib/python/HelpSys/APIHelpTopic.py
View file @
34a9c58e
...
...
@@ -156,18 +156,24 @@ class APIDoc(Persistent):
self
.
name
=
klass
.
__name__
self
.
doc
=
trim_doc_string
(
klass
.
__doc__
)
# inheritence information
if
hasattr
(
klass
,
'__extends__'
):
self
.
extends
=
[]
for
base
in
klass
.
__extends__
:
names
=
string
.
split
(
base
,
'.'
)
url
=
"%s/Help/%s.py#%s"
%
(
names
[
0
],
names
[
1
],
names
[
2
])
self
.
extends
.
append
((
names
[
2
],
url
))
# constructor information
if
hasattr
(
klass
,
'__constructor__'
):
self
.
constructor
=
MethodDoc
(
klass
.
__constructor__
)
# Get info on methods and attributes, ignore special items
self
.
attributes
=
[]
self
.
methods
=
[]
for
k
,
v
in
klass
.
__dict__
.
items
():
if
k
not
in
(
'__extends__'
,
'__doc__'
):
if
k
not
in
(
'__extends__'
,
'__doc__'
,
'__constructor__'
):
if
type
(
v
)
==
types
.
FunctionType
:
self
.
methods
.
append
(
MethodDoc
(
v
))
else
:
...
...
@@ -213,6 +219,9 @@ class MethodDoc(Persistent):
kwargs
=
None
def
__init__
(
self
,
func
):
if
hasattr
(
func
,
'im_func'
):
func
=
func
.
im_func
self
.
name
=
func
.
__name__
self
.
doc
=
trim_doc_string
(
func
.
__doc__
)
...
...
lib/python/HelpSys/APIView.dtml
View file @
34a9c58e
...
...
@@ -12,11 +12,22 @@
</h2>
<dl>
<dd
class="api_doc"
>
<dd>
<dtml-var doc fmt="structured-text">
</dd>
</dl>
<dtml-if constructor>
<hr noshade>
<h3>Constructor</h3>
<dtml-with constructor>
<dtml-var view>
</dtml-with>
</dtml-if>
<hr noshade>
<h3>Methods</h3>
<dd>
<dtml-in attributes>
<dtml-var view>
</dtml-in>
...
...
@@ -24,5 +35,3 @@
<dtml-in methods>
<dtml-var view>
</dtml-in>
</dd>
</dl>
\ No newline at end of file
lib/python/HelpSys/methodView.dtml
View file @
34a9c58e
<a name="&dtml-name;"></a>
<h2 class="method"><dtml-var name>
(
<dtml-in required>
<dtml-var sequence-item>
<dtml-if sequence-end>
<dtml-if optional> , </dtml-if>
<dtml-else> ,
</dtml-if>
</dtml-in>
<dtml-in optional>
<dtml-var sequence-key> = <dtml-var sequence-item>
<dtml-unless sequence-end>,</dtml-unless>
</dtml-in>
<dtml-if varargs>, *<dtml-var varargs> </dtml-if>
<dtml-if kwargs>, **<dtml-var kwargs> </dtml-if>
):
<h2 class="method"><dtml-var name>(<dtml-in required><dtml-var sequence-item><dtml-if sequence-end>
<dtml-if optional>, </dtml-if>
<dtml-else>,
</dtml-if>
</dtml-in>
<dtml-in optional>
<dtml-var sequence-key>=<dtml-var sequence-item><dtml-unless sequence-end>, </dtml-unless>
</dtml-in>
<dtml-if varargs>, *<dtml-var varargs></dtml-if>
<dtml-if kwargs>, **<dtml-var kwargs></dtml-if>):
</h2>
<dl><dd
class="method_doc"
>
<dl><dd>
<dtml-var doc fmt="structured-text">
</dd></dl>
lib/python/HelpSys/topic_header.dtml
View file @
34a9c58e
...
...
@@ -18,25 +18,15 @@ padding: 10pt;
}
.api
{
font-size
:
1
6
pt
;
font-size
:
1
4
pt
;
font-family
:
"Courier New"
,
Courier
,
monospace
;
}
.attribute
,
.method
{
font-size
:
1
4
pt
;
font-size
:
1
2
pt
;
font-family
:
"Courier New"
,
Courier
,
monospace
;
}
.method_doc
{
background
:
#FFFFDD
;
padding
:
12pt
;
}
.api_doc
{
background
:
#FFFFDD
;
padding
:
12pt
;
}
</style>
</head>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment