Table of Contents

Module: __init__ ../HappyDoc-r2_1/happydoclib/docstring/__init__.py

Python docstring converter plugins.

How does an author write documentation so that it will be marked up and look fancy? This is a perennial question for Python users, and seems to have introduced a roadblock into the development of more robust and useful documentation tools. HappyDoc stands firmly on the fence and does not attempt to resolve the issue.

By separating the docstring converter and formatter classes from the docset classes, HappyDoc allows a user to create their own converter and formatter to interpret comments in any way they see fit.

The docstring converter plugins are responsible for translating text from the input markup syntax to the output format. This translation is formatter independent, so that the same HTML conversion might be used by mutliple HTML formatters. It is, however, format dependent, so that HTML output should not be used by a plain text formatter.

The default for the HTMLTableFormatter (the default formatter for HappyDoc) is to treat __doc__ strings as StructuredTextNG. This is the "Next Generation" version of the original StructuredText markup syntax. See also the StructuredText package for a description of the rules for using StructuredText.

Don't like StructuredText? Write your own docstring converter that uses something different and drop it into place. Refer to the happydocstring.py module for the base class and APIs required of a docstring converter. If a defacto (or otherwise) standard structured markup for Python __doc__ strings emerges, HappyDoc will be updated to use that format by default.

Imported modules   
import happydoclib
import re
import sys
import traceback
Functions   
DocStringLoader
getConverterFactory
getConverterFactoryForFile
  DocStringLoader 
DocStringLoader ()

  getConverterFactory 
getConverterFactory ( formatType )

Returns the factory for a docstring converter for formatType text.

Parameters:

formatType
A string representing the name of the input text type. If this string does not match a registered docstring converter input format, a ValueError exception will be raised.
Exceptions   
ValueError( 'Unrecognized docstring format type "%s"' % formatType )
  getConverterFactoryForFile 
getConverterFactoryForFile ( filename )

Returns the factory for a docstring converter for an external file.

Parameters:

filename
The name of the external file to be examined.
Classes   

DocStringLoaderSingleton

Load pluggable docstring converters.


Table of Contents

This document was automatically generated on Sat Aug 24 16:57:29 2002 by HappyDoc version 2.1