#NEWLINE# def transformDescdef( lines , doc , firstLine , **kwargs ) : #NEWLINE# #INDENT# vals = parseDefBlock ( lines , 'descdef' ) #NEWLINE# if ( ( 'partial' in firstLine ) or ( 'New values' in vals ) ) : #NEWLINE# #INDENT# requiredKeys = [ 'Name' , 'For' ] #NEWLINE# ret = [ "<table class='def descdef partial' data-dfn-for='{0}'>" . format ( vals . get ( 'For' , '' ) ) ] #NEWLINE# #UNINDENT# if ( 'mq' in kwargs ) : #NEWLINE# #INDENT# requiredKeys = [ 'Name' , 'For' , 'Value' ] #NEWLINE# ret = [ "<table class='def descdef mq' data-dfn-for='{0}'>" . format ( vals . get ( 'For' , '' ) ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# requiredKeys = [ 'Name' , 'For' , 'Value' , 'Initial' ] #NEWLINE# ret = [ "<table class='def descdef' data-dfn-for='{0}'>" . format ( vals . get ( 'For' , '' ) ) ] #NEWLINE# #UNINDENT# for key in requiredKeys : #NEWLINE# #INDENT# if ( key == 'For' ) : #NEWLINE# #INDENT# ret . append ( '<tr><th>{0}:<td><a at-rule>{1}</a>' . format ( key , vals . get ( key , '' ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key == 'Value' ) : #NEWLINE# #INDENT# ret . append ( "<tr><th>{0}:<td class='prod'>{1}" . format ( key , vals . get ( key , '' ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key in vals ) : #NEWLINE# #INDENT# ret . append ( '<tr><th>{0}:<td>{1}' . format ( key , vals . get ( key , '' ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# die ( "The descdef for '{0}' is missing a '{1}' line." , vals . get ( 'Name' , '???' ) , key ) #NEWLINE# continue #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# for key in ( vals . viewkeys ( ) - requiredKeys ) : #NEWLINE# #INDENT# ret . append ( '<tr><th>{0}:<td>{1}' . format ( key , vals [ key ] ) ) #NEWLINE# #UNINDENT# ret . append ( '</table>' ) #NEWLINE# return ret