Commit ba91ca7f authored by Amos Latteier's avatar Amos Latteier

More fiddling to make API docs prettier.

parent 095b36dd
......@@ -104,8 +104,15 @@ class APIHelpTopic(HelpTopic.HelpTopic):
dict={}
execfile(file, dict)
self.doc=dict.get('__doc__','')
self.apis=[]
for v in dict.values():
if type(v)==types.ClassType:
self.apis.append(APIDoc(v))
# try to get title from first non-blank line
# of module docstring
if not self.title:
# get title from first non-blank line of docstring
lines=string.split(self.doc,'\n')
while 1:
line=string.strip(lines[0])
......@@ -115,10 +122,9 @@ class APIHelpTopic(HelpTopic.HelpTopic):
lines.pop(0)
if not lines:
break
self.apis=[]
for v in dict.values():
if type(v)==types.ClassType:
self.apis.append(APIDoc(v))
# otherwise get title from first class name
if not self.title:
self.title=self.apis[0].name
index_html=HTMLFile('APIHelpView', globals())
......
<dtml-var standard_html_header>
<h1>API Documentation</h1>
<dtml-if "_.len(apis) > 1">
<dl><dd>
<h2 class="api">
<dtml-in apis>
......@@ -9,10 +11,12 @@
</dtml-in>
</h2>
</dd></dl>
</dtml-if>
<dtml-if doc>
<dtml-var doc fmt="structured-text">
<hr noshade>
</dtml-if>
<dtml-in apis>
<dtml-var view>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment