Package zope :: Package configuration :: Module docutils
[show private | hide private]
[frames | no frames]

Module zope.configuration.docutils

Helper Utility to wrap a text to a set width of characters

$Id: docutils.py,v 1.2 2005/06/24 16:52:27 nyergler Exp $
Function Summary
  makeDocStructures(context)
Creates two structures that provide a friendly format for documentation.
  wrap(text, width, indent)
Makes sure that we keep a line length of a certain width.

Variable Summary
SRE_Pattern para_sep = \n{2,}
SRE_Pattern whitespace = [ \t\n\r]+

Function Details

makeDocStructures(context)

Creates two structures that provide a friendly format for documentation.

'namespaces' is a dictionary that maps namespaces to a directives dictionary with the key being the name of the directive and the value is a tuple: (schema, handler, info).

'subdirs' maps a (namespace, name) pair to a list of subdirectives that have the form (namespace, name, schema, info).

wrap(text, width=78, indent=0)

Makes sure that we keep a line length of a certain width.

Examples:
>>> print wrap('foo bar')[:-2]
foo bar

>>> print wrap('foo bar', indent=2)[:-2]
foo bar

>>> print wrap('foo bar, more foo bar', 10)[:-2]
foo bar,
more foo
bar

>>> print wrap('foo bar, more foo bar', 10, 2)[:-2]
foo bar,
  more foo
  bar

Variable Details

para_sep

Type:
SRE_Pattern
Value:
\n{2,}                                                                 

whitespace

Type:
SRE_Pattern
Value:
[ \t\n\r]+                                                             

Generated by Epydoc 2.1 on Fri Jun 24 12:01:19 2005 http://epydoc.sf.net