eric3.DocumentationTools.ModuleDocumentor

Module implementing the builtin documentation generator.

The different parts of the module document are assembled from the parsed Python file. The appearance is determined by several templates defined within this module.

Classes

ModuleDocument Class implementing the builtin documentation generator.
TagError Exception class raised, if an invalid documentation tag was found.

Functions

None

ModuleDocument

Class implementing the builtin documentation generator.

Derived from

Methods

ModuleDocument Constructor
checkDeprecated Private method to check, if the object to be documented contains a deprecated flag.
description Method used to get the description of the module.
formatDescription Private method to format the contents of the documentation string.
genClassListSection Private method to generate the section listing all classes of the module.
genClassesSection Private method to generate the document section with details about classes.
genDescriptionListSection Private method to generate the list section of a description.
genDocument Method to generate the source code documentation.
genFunctionListSection Private method to generate the section listing all functions of the module.
genFunctionsSection Private method to generate the document section with details about functions.
genListSection Private method to generate a list section of the document.
genMethodSection Private method to generate the method details section.
genMethodsListSection Private method to generate the methods list section of a class.
genModuleSection Private method to generate the body of the document.
genParagraphs Private method to assemble the descriptive paragraphs of a docstring.
getShortDescription Private method to determine the short description of an object.
isEmpty Method to determine, if the module contains any classes or functions.
name Method used to get the module name.
shortDescription Method used to get the short description of the module.

ModuleDocument (Constructor)

ModuleDocument(module)

Constructor

module
The information of the parsed Python file.

ModuleDocument.checkDeprecated

checkDeprecated(descr)

Private method to check, if the object to be documented contains a deprecated flag.

desc
The documentation string. (string)
Returns:
Flag indicating the deprecation status. (boolean)

ModuleDocument.description

description()

Method used to get the description of the module.

Returns:
The description of the module. (string)

ModuleDocument.formatDescription

formatDescription(descr)

Private method to format the contents of the documentation string.

descr
The contents of the documentation string. (string)
Returns:
The formated contents of the documentation string. (string)
Raises TagError:
A tag doesn't have the correct number of arguments.

ModuleDocument.genClassListSection

genClassListSection()

Private method to generate the section listing all classes of the module.

Returns:
The classes list section. (string)

ModuleDocument.genClassesSection

genClassesSection()

Private method to generate the document section with details about classes.

Returns:
The classes details section. (string)

ModuleDocument.genDescriptionListSection

genDescriptionListSection(dictionary, template)

Private method to generate the list section of a description.

dictionary
Dictionary containing the info for the list section.
template
The template to be used for the list. (string)
Returns:
The list section. (string)

ModuleDocument.genDocument

genDocument()

Method to generate the source code documentation.

Returns:
The source code documentation. (string)

ModuleDocument.genFunctionListSection

genFunctionListSection()

Private method to generate the section listing all functions of the module.

Returns:
The functions list section. (string)

ModuleDocument.genFunctionsSection

genFunctionsSection()

Private method to generate the document section with details about functions.

Returns:
The functions details section. (string)

ModuleDocument.genListSection

genListSection(names, dict, className='')

Private method to generate a list section of the document.

className
The class name containing the names.
dict
A dictionary containing all relevant information.
names
The names to appear in the list. (list of strings)
Returns:
The list section. (string)

ModuleDocument.genMethodSection

genMethodSection(className)

Private method to generate the method details section.

classname
Name of the class containing the method. (string)
Returns:
The method details section. (string)

ModuleDocument.genMethodsListSection

genMethodsListSection(names, dict, className='')

Private method to generate the methods list section of a class.

className
The class name containing the names.
dict
A dictionary containing all relevant information.
names
The names to appear in the list. (list of strings)
Returns:
The list section. (string)

ModuleDocument.genModuleSection

genModuleSection()

Private method to generate the body of the document.

Returns:
The body of the document. (string)

ModuleDocument.genParagraphs

genParagraphs(lines)

Private method to assemble the descriptive paragraphs of a docstring. A paragraph is made up of a number of consecutive lines without an intermediate empty line. Empty lines are treated a paragraph delimiter.

lines
A list of individual lines. (list of strings)
Returns:
Ready formatted paragraphs. (string)

ModuleDocument.getShortDescription

getShortDescription(desc)

Private method to determine the short description of an object. The short description is just the first non empty line of the documentation string.

desc
The documentation string. (string)
Returns:
The short description. (string)

ModuleDocument.isEmpty

isEmpty()

Method to determine, if the module contains any classes or functions.

Returns:
Flag indicating an empty module (i.e. __init__.py without any contents)

ModuleDocument.name

name()

Method used to get the module name.

Returns:
The name of the module. (string)

ModuleDocument.shortDescription

shortDescription()

Method used to get the short description of the module. The short description is just the first line of the modules description.

Returns:
The short description of the module. (string)

Up

TagError

Exception class raised, if an invalid documentation tag was found.

Derived from

Exception

Methods

TagError Constructor

TagError (Constructor)

TagError(args=None)

Constructor

args
The arguments.

Up