[Epydoc-commits] SF.net SVN: epydoc: [1636] trunk/epydoc/src/epydoc/docwriter/html.py
Brought to you by:
edloper
|
From: <ed...@us...> - 2007-09-24 17:53:48
|
Revision: 1636
http://epydoc.svn.sourceforge.net/epydoc/?rev=1636&view=rev
Author: edloper
Date: 2007-09-24 10:53:47 -0700 (Mon, 24 Sep 2007)
Log Message:
-----------
- In the import list, show the name of the imported variable, and use
a tooltip to show what value it stands for.
Modified Paths:
--------------
trunk/epydoc/src/epydoc/docwriter/html.py
Modified: trunk/epydoc/src/epydoc/docwriter/html.py
===================================================================
--- trunk/epydoc/src/epydoc/docwriter/html.py 2007-09-24 17:44:39 UTC (rev 1635)
+++ trunk/epydoc/src/epydoc/docwriter/html.py 2007-09-24 17:53:47 UTC (rev 1636)
@@ -2692,10 +2692,14 @@
def _import(self, var_doc, context):
if var_doc.imported_from not in (None, UNKNOWN):
- return self.href(var_doc.imported_from, context=context)
+ return self.href(var_doc.imported_from,
+ var_doc.name, context=context,
+ tooltip='%s' % var_doc.imported_from)
elif (var_doc.value not in (None, UNKNOWN) and not
isinstance(var_doc.value, GenericValueDoc)):
- return self.href(var_doc.value, context=context)
+ return self.href(var_doc.value,
+ var_doc.name, context=context,
+ tooltip='%s' % var_doc.value.canonical_name)
else:
return plaintext_to_html(var_doc.name)
@@ -3223,7 +3227,8 @@
return None
# [xx] add code to automatically do <code> wrapping or the like?
- def href(self, target, label=None, css_class=None, context=None):
+ def href(self, target, label=None, css_class=None, context=None,
+ tooltip=None):
"""
Return the HTML code for an HREF link to the given target
(which can be a C{VariableDoc}, a C{ValueDoc}, or a
@@ -3263,7 +3268,9 @@
# Get the url for the target.
url = self.url(target)
- if url is None: return label
+ if url is None:
+ if tooltip: return '<span title="%s">%s</span>' % (tooltip, label)
+ else: return label
# Construct a string for the class attribute.
if css_class is None:
@@ -3278,8 +3285,13 @@
not self._val_is_public(target))):
onclick = ' onclick="show_private();"'
- return '<a href="%s"%s%s>%s</a>' % (url, css, onclick, label)
+ if tooltip:
+ tooltip = ' title="%s"' % tooltip
+ else:
+ tooltip = ''
+ return '<a href="%s"%s%s%s>%s</a>' % (url, css, onclick, tooltip, label)
+
def _attr_to_html(self, attr, api_doc, indent):
if api_doc in (None, UNKNOWN):
return ''
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|