#NEWLINE# def docroutine( self , object , name , mod = None , funcs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , classes = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , methods = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , cl = None ) : #NEWLINE# #INDENT# 'Produce HTML documentation for a function or method object.' #NEWLINE# anchor = ( ( ( ( cl and cl . __name__ ) or '' ) + '-' ) + name ) #NEWLINE# note = '' #NEWLINE# title = ( '<a name="%s"><strong>%s</strong></a>' % ( self . escape ( anchor ) , self . escape ( name ) ) ) #NEWLINE# if inspect . ismethod ( object ) : #NEWLINE# #INDENT# args = inspect . getfullargspec ( object ) #NEWLINE# argspec = inspect . formatargspec ( args . args [ 1 : ] , args . varargs , args . varkw , args . defaults , annotations = args . annotations , formatvalue = decl . formatvalue ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if inspect . isfunction ( object ) : #NEWLINE# #INDENT# args = inspect . getfullargspec ( object ) #NEWLINE# argspec = inspect . formatargspec ( args . args , args . varargs , args . varkw , args . defaults , annotations = args . annotations , formatvalue = self . formatvalue ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# argspec = '(...)' #NEWLINE# #UNINDENT# #UNINDENT# if isinstance ( object , tuple ) : #NEWLINE# #INDENT# argspec = ( object [ 0 ] or argspec ) #NEWLINE# docstring = ( object [ 1 ] or '' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# docstring = pydoc . getdoc ( object ) #NEWLINE# #UNINDENT# decl = ( ( title + argspec ) + ( note and self . grey ( ( '<font face="helvetica, arial">%s</font>' % note ) ) ) ) #NEWLINE# doc = self . markup ( docstring , self . preformat , funcs , classes , methods ) #NEWLINE# doc = ( doc and ( '<dd><tt>%s</tt></dd>' % doc ) ) #NEWLINE# return ( '<dl><dt>%s</dt>%s</dl>\n' % ( decl , doc ) )