Package epydoc :: Package markup :: Class DocstringLinker
[hide private]
[frames] | no frames]

ClassType DocstringLinker

source code

Known Subclasses:

A translator for crossreference links into and out of a ParsedDocstring. DocstringLinker is used by ParsedDocstring to convert these crossreference links into appropriate output formats. For example, DocstringLinker.to_html expects a DocstringLinker that converts crossreference links to HTML.

Instance Methods [hide private]
string
translate_identifier_xref(self, identifier, label=None)
Translate a crossreference link to a Python identifier to the appropriate output format.
source code
string
translate_indexterm(self, indexterm)
Translate an index term to the appropriate output format.
source code
 
url_for(self, identifier)
Given an identifier, return a URL pointing at that identifier.
source code
Method Details [hide private]

translate_identifier_xref(self, identifier, label=None)

source code 

Translate a crossreference link to a Python identifier to the appropriate output format. The output will typically include a reference or pointer to the crossreference target.

Parameters:
  • identifier (string) - The name of the Python identifier that should be linked to.
  • label (string or None) - The label that should be used for the identifier, if it's different from the name of the identifier. This should be expressed in the target markup language -- e.g. for latex, "_"s should be escaped.
Returns: string
The translated crossreference link.

translate_indexterm(self, indexterm)

source code 

Translate an index term to the appropriate output format. The output will typically include a crossreference anchor.

Parameters:
Returns: string
The translated index term.

url_for(self, identifier)

source code 

Given an identifier, return a URL pointing at that identifier. This is used to create hyperlinks in dotgraphs. This method is *optional* -- i.e., it may raise NotImplementedError