The PythonDoc Infoset (In Progress)

October 2003 | Fredrik Lundh

Outline:

<module>
  <subject lineno= name= >
    <info>
      <tag> contents </tag>
      ...
    </info>
    <subject lineno= name= >
      ...
    </subject>
  </subject>
  ...
</module>

The Module Element

The toplevel module element contains an info element, followed by a number of subject elements. The info element is optional.

The Subject Elements: function, variable, class, method, attribute

The subject element contains name and lineno attributes, and an optional info subelement.

class subject elements can also contain one or more subject subelements, for attributes and methods.

The Info Element

The info element contains tag elements for the parent subject.

The Tag Elements: name, description, def, return, …

Tag elements are stored as subelements to the info element.

Tag elements may contain plain text, or XHTML tags.

The Inline Tag Elements: link, linkplain

Inline link elements are stored as XHTML anchor elements, where the href attribute refers to the subject element, and the class attribute is set to link (or linkplain).

Example:

Call this {@link #class.name Method}.

maps to

 
Call this <a href='#class.name-method' class='link'>Method</a>.

For links to items outside the current module, the href attribute is set to “link:” followed by the original link (e.g. “link:Tkinter.Tk”).

 

A Django site. rendered by a django application. hosted by webfaction.