- section.appendChild(paraElement('Parameters:'))
- params = Element('itemizedlist')
- if func.accepts:
- for name, param, default in zip(max_args, func.accepts, defaults):
- params.appendChild(paramElement(name, param))
- else:
- listitem = Element('listitem')
- listitem.appendChild(paraElement('None'))
- params.appendChild(listitem)
- section.appendChild(params)
+ # with python3 it looks like an element can't be sfa_created
+ # outside of a document
+ section = dom.createElement('section')
+ section.setAttribute('id', func.name)
+ section.appendChild(simpleElement('title', func.name))
+
+ prototype = "%s (%s)" % (method, ", ".join(max_args))
+ para = paraElement('Prototype:')
+ para.appendChild(blockquoteElement(prototype))
+ section.appendChild(para)
+
+ para = paraElement('Description:')
+ para.appendChild(blockquoteElement(func.__doc__))
+ section.appendChild(para)
+
+ para = paraElement('Allowed Roles:')
+ para.appendChild(blockquoteElement(", ".join(func.roles)))
+ section.appendChild(para)
+
+ section.appendChild(paraElement('Parameters:'))
+ params = Element('itemizedlist')
+ if func.accepts:
+ for name, param, default in zip(max_args, func.accepts, defaults):
+ params.appendChild(paramElement(name, param))
+ else:
+ listitem = Element('listitem')
+ listitem.appendChild(paraElement('None'))
+ params.appendChild(listitem)
+ section.appendChild(params)