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

None

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.
genParamDescriptionListSection Private method to generate the list section of a description.
genRbModulesClassesListSection Private method to generate the classes list section of a Ruby module.
genRbModulesClassesSection Private method to generate the Ruby module classes details section.
genRbModulesListSection Private method to generate the section listing all modules of the file (Ruby only).
genRbModulesSection Private method to generate the document section with details about Ruby modules.
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, css=0)

Constructor

module
The information of the parsed Python file.
css
flag indicating a css style sheet should be used (boolean)

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.

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

ModuleDocument.genMethodSection

genMethodSection(obj, className)

Private method to generate the method details section.

obj
Reference to the object being formatted.
className
Name of the class containing the method. (string)
Returns:
The method list and method details section. (tuple of two string)

ModuleDocument.genMethodsListSection

genMethodsListSection(names, dict, className, clsName)

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

names
The names to appear in the list. (list of strings)
dict
A dictionary containing all relevant information.
className
The class name containing the names.
clsName
The visible class name containing the names.
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.genParamDescriptionListSection

genParamDescriptionListSection(_list, template)

Private method to generate the list section of a description.

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

ModuleDocument.genRbModulesClassesListSection

genRbModulesClassesListSection(names, dict, moduleName)

Private method to generate the classes list section of a Ruby module.

names
The names to appear in the list. (list of strings)
dict
A dictionary containing all relevant information.
moduleName
Name of the Ruby module containing the classes. (string)
Returns:
The list section. (string)

ModuleDocument.genRbModulesClassesSection

genRbModulesClassesSection(obj, modName)

Private method to generate the Ruby module classes details section.

obj
Reference to the object being formatted.
modName
Name of the Ruby module containing the classes. (string)
Returns:
The classes list and classes details section. (tuple of two string)

ModuleDocument.genRbModulesListSection

genRbModulesListSection()

Private method to generate the section listing all modules of the file (Ruby only).

Returns:
The modules list section. (string)

ModuleDocument.genRbModulesSection

genRbModulesSection()

Private method to generate the document section with details about Ruby modules.

Returns:
The Ruby modules details section. (string)

ModuleDocument.getShortDescription

getShortDescription(desc)

Private method to determine the short description of an object.

The short description is just the first sentence (i.e. up to a '.' or 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