# eric4.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.

### Global Attributes

_event
_signal

### 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

object

### Class Attributes

None

### Class Methods

None

### Methods

ModuleDocument | Constructor
__checkDeprecated | Private method to check, if the object to be documented contains a deprecated flag.
__formatCrossReferenceEntry | Private method to format a cross reference entry.
__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.
__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.
__genGlobalsListSection | Private method to generate the section listing all global attributes of the module.
__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.
__genSeeListSection | Private method to generate the "see also" list section of a description.
__getShortDescription | Private method to determine the short description of an object.
__processInlineTags | Private method to process inline tags.
description | Public method used to get the description of the module.
genDocument | Public method to generate the source code documentation.
getQtHelpKeywords | Public method to retrieve the parts for the QtHelp keywords section.
isEmpty | Public method to determine, if the module contains any classes or functions.
name | Public method used to get the module name.
shortDescription | Public method used to get the short description of the module.

### Static Methods

None

#### ModuleDocument (Constructor)

ModuleDocument(module, colors, stylesheet = None)

Constructor

module
  the information of the parsed Python file
colors
  dictionary specifying the various colors for the output (dictionary of strings)
stylesheet
  the style to be used for the generated pages (string)

#### 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.__formatCrossReferenceEntry

__formatCrossReferenceEntry(entry)

Private method to format a cross reference entry.

This cross reference entry looks like "package.module#member label".

entry
  the entry to be formatted (string)

Returns:
  formatted entry (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.__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.__genGlobalsListSection

__genGlobalsListSection(class_ = None)

Private method to generate the section listing all global attributes of the module.

class_
  reference to a class object (Class)

Returns:
  The globals list section. (string)

#### ModuleDocument.__genListSection

__genListSection(names, dict, kwSuffix = "")

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.
kwSuffix
  suffix to be used for the QtHelp keywords (string)

Returns:
  The list section. (string)

#### ModuleDocument.__genMethodSection

__genMethodSection(obj, className, filter)

Private method to generate the method details section.

obj
  reference to the object being formatted
className
  name of the class containing the method (string)
filter
  filter value designating the method types

Returns:
  method list and method details section (tuple of two string)

#### ModuleDocument.__genMethodsListSection

__genMethodsListSection(names, dict, className, clsName, includeInit=True)

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

names
  names to appear in the list (list of strings)
dict
  dictionary containing all relevant information
className
  class name containing the names
clsName
  visible class name containing the names
includeInit
  flag indicating to include the __init__ method (boolean)

Returns:
  methods 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 as 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.__genSeeListSection

__genSeeListSection(_list, template)

Private method to generate the "see also" list section of a description.

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

Returns:
  The list section. (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.__processInlineTags

__processInlineTags(desc)

Private method to process inline tags.

desc
  One line of the description (string)

Returns:
  processed line with inline tags expanded (string)

#### ModuleDocument.description

description()

Public method used to get the description of the module.

Returns:
  The description of the module. (string)

#### ModuleDocument.genDocument

genDocument()

Public method to generate the source code documentation.

Returns:
  The source code documentation. (string)

#### ModuleDocument.getQtHelpKeywords

getQtHelpKeywords()

Public method to retrieve the parts for the QtHelp keywords section.

Returns:
  list of tuples containing the name (string) and the ref (string). The ref is without the filename part.

#### ModuleDocument.isEmpty

isEmpty()

Public 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()

Public method used to get the module name.

Returns:
  The name of the module. (string)

#### ModuleDocument.shortDescription

shortDescription()

Public 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

### Class Attributes

None

### Class Methods

None

### Methods

None

### Static Methods

None

Up