blob: 6a97f809d96eff13cea5c21aeed3e5e9ede82a4e [file] [log] [blame]
Fred Drake3a0351c1998-04-04 07:23:21 +00001\section{Standard Module \module{formatter}}
Guido van Rossume47da0a1997-07-17 16:34:52 +00002\label{module-formatter}
Fred Drakee83b30d1996-10-08 21:53:33 +00003\stmodindex{formatter}
4
Fred Drakee83b30d1996-10-08 21:53:33 +00005
6This module supports two interface definitions, each with mulitple
7implementations. The \emph{formatter} interface is used by the
Fred Drake3b5da761998-03-12 15:33:05 +00008\class{HTMLParser} class of the \module{htmllib} module, and the
Fred Drakee83b30d1996-10-08 21:53:33 +00009\emph{writer} interface is required by the formatter interface.
Fred Drake858f7871998-04-04 06:25:27 +000010\withsubitem{(class in htmllib)}{\ttindex{HTMLParser}}
Fred Drakee83b30d1996-10-08 21:53:33 +000011
12Formatter objects transform an abstract flow of formatting events into
13specific output events on writer objects. Formatters manage several
14stack structures to allow various properties of a writer object to be
15changed and restored; writers need not be able to handle relative
16changes nor any sort of ``change back'' operation. Specific writer
17properties which may be controlled via formatter objects are
18horizontal alignment, font, and left margin indentations. A mechanism
19is provided which supports providing arbitrary, non-exclusive style
20settings to a writer as well. Additional interfaces facilitate
21formatting events which are not reversible, such as paragraph
22separation.
23
24Writer objects encapsulate device interfaces. Abstract devices, such
25as file formats, are supported as well as physical devices. The
26provided implementations all work with abstract devices. The
27interface makes available mechanisms for setting the properties which
28formatter objects manage and inserting data into the output.
29
30
31\subsection{The Formatter Interface}
32
33Interfaces to create formatters are dependent on the specific
34formatter class being instantiated. The interfaces described below
35are the required interfaces which all formatters must support once
36initialized.
37
38One data element is defined at the module level:
39
Fred Drake8fe533e1998-03-27 05:27:08 +000040
Fred Drakee83b30d1996-10-08 21:53:33 +000041\begin{datadesc}{AS_IS}
42Value which can be used in the font specification passed to the
43\code{push_font()} method described below, or as the new value to any
44other \code{push_\var{property}()} method. Pushing the \code{AS_IS}
45value allows the corresponding \code{pop_\var{property}()} method to
46be called without having to track whether the property was changed.
47\end{datadesc}
48
49The following attributes are defined for formatter instance objects:
50
Fred Drake8f925951996-10-09 16:13:22 +000051
Fred Drake8fe533e1998-03-27 05:27:08 +000052\begin{memberdesc}[formatter]{writer}
Fred Drakee83b30d1996-10-08 21:53:33 +000053The writer instance with which the formatter interacts.
Fred Drake8fe533e1998-03-27 05:27:08 +000054\end{memberdesc}
Fred Drakee83b30d1996-10-08 21:53:33 +000055
56
Fred Drake8fe533e1998-03-27 05:27:08 +000057\begin{methoddesc}[formatter]{end_paragraph}{blanklines}
Fred Drake3b5da761998-03-12 15:33:05 +000058Close any open paragraphs and insert at least \var{blanklines}
Fred Drakee83b30d1996-10-08 21:53:33 +000059before the next paragraph.
Fred Drake8fe533e1998-03-27 05:27:08 +000060\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +000061
Fred Drake8fe533e1998-03-27 05:27:08 +000062\begin{methoddesc}[formatter]{add_line_break}{}
Fred Drakee83b30d1996-10-08 21:53:33 +000063Add a hard line break if one does not already exist. This does not
64break the logical paragraph.
Fred Drake8fe533e1998-03-27 05:27:08 +000065\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +000066
Fred Drake8fe533e1998-03-27 05:27:08 +000067\begin{methoddesc}[formatter]{add_hor_rule}{*args, **kw}
Fred Drakee83b30d1996-10-08 21:53:33 +000068Insert a horizontal rule in the output. A hard break is inserted if
69there is data in the current paragraph, but the logical paragraph is
70not broken. The arguments and keywords are passed on to the writer's
Fred Drake3b5da761998-03-12 15:33:05 +000071\method{send_line_break()} method.
Fred Drake8fe533e1998-03-27 05:27:08 +000072\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +000073
Fred Drake8fe533e1998-03-27 05:27:08 +000074\begin{methoddesc}[formatter]{add_flowing_data}{data}
Fred Drakee83b30d1996-10-08 21:53:33 +000075Provide data which should be formatted with collapsed whitespaces.
76Whitespace from preceeding and successive calls to
Fred Drake3b5da761998-03-12 15:33:05 +000077\method{add_flowing_data()} is considered as well when the whitespace
Fred Drakee83b30d1996-10-08 21:53:33 +000078collapse is performed. The data which is passed to this method is
79expected to be word-wrapped by the output device. Note that any
80word-wrapping still must be performed by the writer object due to the
81need to rely on device and font information.
Fred Drake8fe533e1998-03-27 05:27:08 +000082\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +000083
Fred Drake8fe533e1998-03-27 05:27:08 +000084\begin{methoddesc}[formatter]{add_literal_data}{data}
Fred Drakee83b30d1996-10-08 21:53:33 +000085Provide data which should be passed to the writer unchanged.
86Whitespace, including newline and tab characters, are considered legal
Fred Drake3b5da761998-03-12 15:33:05 +000087in the value of \var{data}.
Fred Drake8fe533e1998-03-27 05:27:08 +000088\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +000089
Fred Drake8fe533e1998-03-27 05:27:08 +000090\begin{methoddesc}[formatter]{add_label_data}{format, counter}
Fred Drakee83b30d1996-10-08 21:53:33 +000091Insert a label which should be placed to the left of the current left
92margin. This should be used for constructing bulleted or numbered
Fred Drake3b5da761998-03-12 15:33:05 +000093lists. If the \var{format} value is a string, it is interpreted as a
94format specification for \var{counter}, which should be an integer.
Fred Drakee83b30d1996-10-08 21:53:33 +000095The result of this formatting becomes the value of the label; if
Fred Drake3b5da761998-03-12 15:33:05 +000096\var{format} is not a string it is used as the label value directly.
Fred Drakee83b30d1996-10-08 21:53:33 +000097The label value is passed as the only argument to the writer's
Fred Drake3b5da761998-03-12 15:33:05 +000098\method{send_label_data()} method. Interpretation of non-string label
Fred Drakee83b30d1996-10-08 21:53:33 +000099values is dependent on the associated writer.
100
101Format specifications are strings which, in combination with a counter
102value, are used to compute label values. Each character in the format
103string is copied to the label value, with some characters recognized
104to indicate a transform on the counter value. Specifically, the
Fred Drake3b5da761998-03-12 15:33:05 +0000105character \character{1} represents the counter value formatter as an
106arabic number, the characters \character{A} and \character{a}
107represent alphabetic representations of the counter value in upper and
108lower case, respectively, and \character{I} and \character{i}
109represent the counter value in Roman numerals, in upper and lower
110case. Note that the alphabetic and roman transforms require that the
111counter value be greater than zero.
Fred Drake8fe533e1998-03-27 05:27:08 +0000112\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000113
Fred Drake8fe533e1998-03-27 05:27:08 +0000114\begin{methoddesc}[formatter]{flush_softspace}{}
Fred Drakee83b30d1996-10-08 21:53:33 +0000115Send any pending whitespace buffered from a previous call to
Fred Drake3b5da761998-03-12 15:33:05 +0000116\method{add_flowing_data()} to the associated writer object. This
Fred Drakee83b30d1996-10-08 21:53:33 +0000117should be called before any direct manipulation of the writer object.
Fred Drake8fe533e1998-03-27 05:27:08 +0000118\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000119
Fred Drake8fe533e1998-03-27 05:27:08 +0000120\begin{methoddesc}[formatter]{push_alignment}{align}
Fred Drakee83b30d1996-10-08 21:53:33 +0000121Push a new alignment setting onto the alignment stack. This may be
Fred Drake3b5da761998-03-12 15:33:05 +0000122\constant{AS_IS} if no change is desired. If the alignment value is
123changed from the previous setting, the writer's \method{new_alignment()}
124method is called with the \var{align} value.
Fred Drake8fe533e1998-03-27 05:27:08 +0000125\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000126
Fred Drake8fe533e1998-03-27 05:27:08 +0000127\begin{methoddesc}[formatter]{pop_alignment}{}
Fred Drakee83b30d1996-10-08 21:53:33 +0000128Restore the previous alignment.
Fred Drake8fe533e1998-03-27 05:27:08 +0000129\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000130
Fred Drake8fe533e1998-03-27 05:27:08 +0000131\begin{methoddesc}[formatter]{push_font}{\code{(}size, italic, bold, teletype\code{)}}
Fred Drakee83b30d1996-10-08 21:53:33 +0000132Change some or all font properties of the writer object. Properties
Fred Drake3b5da761998-03-12 15:33:05 +0000133which are not set to \constant{AS_IS} are set to the values passed in
Fred Drakee83b30d1996-10-08 21:53:33 +0000134while others are maintained at their current settings. The writer's
Fred Drake3b5da761998-03-12 15:33:05 +0000135\method{new_font()} method is called with the fully resolved font
Fred Drakee83b30d1996-10-08 21:53:33 +0000136specification.
Fred Drake8fe533e1998-03-27 05:27:08 +0000137\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000138
Fred Drake8fe533e1998-03-27 05:27:08 +0000139\begin{methoddesc}[formatter]{pop_font}{}
Fred Drakee83b30d1996-10-08 21:53:33 +0000140Restore the previous font.
Fred Drake8fe533e1998-03-27 05:27:08 +0000141\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000142
Fred Drake8fe533e1998-03-27 05:27:08 +0000143\begin{methoddesc}[formatter]{push_margin}{margin}
Fred Drakee83b30d1996-10-08 21:53:33 +0000144Increase the number of left margin indentations by one, associating
Fred Drake3b5da761998-03-12 15:33:05 +0000145the logical tag \var{margin} with the new indentation. The initial
Fred Drakee83b30d1996-10-08 21:53:33 +0000146margin level is \code{0}. Changed values of the logical tag must be
Fred Drake3b5da761998-03-12 15:33:05 +0000147true values; false values other than \constant{AS_IS} are not
148sufficient to change the margin.
Fred Drake8fe533e1998-03-27 05:27:08 +0000149\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000150
Fred Drake8fe533e1998-03-27 05:27:08 +0000151\begin{methoddesc}[formatter]{pop_margin}{}
Fred Drakee83b30d1996-10-08 21:53:33 +0000152Restore the previous margin.
Fred Drake8fe533e1998-03-27 05:27:08 +0000153\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000154
Fred Drake8fe533e1998-03-27 05:27:08 +0000155\begin{methoddesc}[formatter]{push_style}{*styles}
Fred Drakee83b30d1996-10-08 21:53:33 +0000156Push any number of arbitrary style specifications. All styles are
157pushed onto the styles stack in order. A tuple representing the
Fred Drake3b5da761998-03-12 15:33:05 +0000158entire stack, including \constant{AS_IS} values, is passed to the
159writer's \method{new_styles()} method.
Fred Drake8fe533e1998-03-27 05:27:08 +0000160\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000161
Fred Drake8fe533e1998-03-27 05:27:08 +0000162\begin{methoddesc}[formatter]{pop_style}{\optional{n\code{ = 1}}}
Fred Drake3b5da761998-03-12 15:33:05 +0000163Pop the last \var{n} style specifications passed to
164\method{push_style()}. A tuple representing the revised stack,
165including \constant{AS_IS} values, is passed to the writer's
166\method{new_styles()} method.
Fred Drake8fe533e1998-03-27 05:27:08 +0000167\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000168
Fred Drake8fe533e1998-03-27 05:27:08 +0000169\begin{methoddesc}[formatter]{set_spacing}{spacing}
Fred Drakee83b30d1996-10-08 21:53:33 +0000170Set the spacing style for the writer.
Fred Drake8fe533e1998-03-27 05:27:08 +0000171\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000172
Fred Drake8fe533e1998-03-27 05:27:08 +0000173\begin{methoddesc}[formatter]{assert_line_data}{\optional{flag\code{ = 1}}}
Fred Drakee83b30d1996-10-08 21:53:33 +0000174Inform the formatter that data has been added to the current paragraph
175out-of-band. This should be used when the writer has been manipulated
Fred Drake3b5da761998-03-12 15:33:05 +0000176directly. The optional \var{flag} argument can be set to false if
Fred Drakee83b30d1996-10-08 21:53:33 +0000177the writer manipulations produced a hard line break at the end of the
178output.
Fred Drake8fe533e1998-03-27 05:27:08 +0000179\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000180
181
182\subsection{Formatter Implementations}
183
Fred Drake8f925951996-10-09 16:13:22 +0000184Two implementations of formatter objects are provided by this module.
185Most applications may use one of these classes without modification or
186subclassing.
187
Fred Drake3b5da761998-03-12 15:33:05 +0000188\begin{classdesc}{NullFormatter}{\optional{writer}}
189A formatter which does nothing. If \var{writer} is omitted, a
190\class{NullWriter} instance is created. No methods of the writer are
191called by \class{NullFormatter} instances. Implementations should
192inherit from this class if implementing a writer interface but don't
193need to inherit any implementation.
194\end{classdesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000195
Fred Drake3b5da761998-03-12 15:33:05 +0000196\begin{classdesc}{AbstractFormatter}{writer}
Fred Drakee83b30d1996-10-08 21:53:33 +0000197The standard formatter. This implementation has demonstrated wide
198applicability to many writers, and may be used directly in most
Fred Drake8f925951996-10-09 16:13:22 +0000199circumstances. It has been used to implement a full-featured
200world-wide web browser.
Fred Drake3b5da761998-03-12 15:33:05 +0000201\end{classdesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000202
203
204
205\subsection{The Writer Interface}
206
207Interfaces to create writers are dependent on the specific writer
208class being instantiated. The interfaces described below are the
209required interfaces which all writers must support once initialized.
Fred Drake3b5da761998-03-12 15:33:05 +0000210Note that while most applications can use the
211\class{AbstractFormatter} class as a formatter, the writer must
212typically be provided by the application.
Fred Drakee83b30d1996-10-08 21:53:33 +0000213
Fred Drake8f925951996-10-09 16:13:22 +0000214
Fred Drake8fe533e1998-03-27 05:27:08 +0000215\begin{methoddesc}[writer]{flush}{}
Fred Drake591bbb11996-12-31 20:51:42 +0000216Flush any buffered output or device control events.
Fred Drake8fe533e1998-03-27 05:27:08 +0000217\end{methoddesc}
Fred Drake591bbb11996-12-31 20:51:42 +0000218
Fred Drake8fe533e1998-03-27 05:27:08 +0000219\begin{methoddesc}[writer]{new_alignment}{align}
Fred Drake3b5da761998-03-12 15:33:05 +0000220Set the alignment style. The \var{align} value can be any object,
Fred Drakee83b30d1996-10-08 21:53:33 +0000221but by convention is a string or \code{None}, where \code{None}
222indicates that the writer's ``preferred'' alignment should be used.
Fred Drake3b5da761998-03-12 15:33:05 +0000223Conventional \var{align} values are \code{'left'}, \code{'center'},
Fred Drakee83b30d1996-10-08 21:53:33 +0000224\code{'right'}, and \code{'justify'}.
Fred Drake8fe533e1998-03-27 05:27:08 +0000225\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000226
Fred Drake8fe533e1998-03-27 05:27:08 +0000227\begin{methoddesc}[writer]{new_font}{font}
Fred Drake3b5da761998-03-12 15:33:05 +0000228Set the font style. The value of \var{font} will be \code{None},
Fred Drakee83b30d1996-10-08 21:53:33 +0000229indicating that the device's default font should be used, or a tuple
Fred Drake3b5da761998-03-12 15:33:05 +0000230of the form \code{(}\var{size}, \var{italic}, \var{bold},
231\var{teletype}\code{)}. Size will be a string indicating the size of
232font that should be used; specific strings and their interpretation
233must be defined by the application. The \var{italic}, \var{bold}, and
234\var{teletype} values are boolean indicators specifying which of those
235font attributes should be used.
Fred Drake8fe533e1998-03-27 05:27:08 +0000236\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000237
Fred Drake8fe533e1998-03-27 05:27:08 +0000238\begin{methoddesc}[writer]{new_margin}{margin, level}
Fred Drake3b5da761998-03-12 15:33:05 +0000239Set the margin level to the integer \var{level} and the logical tag
240to \var{margin}. Interpretation of the logical tag is at the
Fred Drakee83b30d1996-10-08 21:53:33 +0000241writer's discretion; the only restriction on the value of the logical
242tag is that it not be a false value for non-zero values of
Fred Drake3b5da761998-03-12 15:33:05 +0000243\var{level}.
Fred Drake8fe533e1998-03-27 05:27:08 +0000244\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000245
Fred Drake8fe533e1998-03-27 05:27:08 +0000246\begin{methoddesc}[writer]{new_spacing}{spacing}
Fred Drake3b5da761998-03-12 15:33:05 +0000247Set the spacing style to \var{spacing}.
Fred Drake8fe533e1998-03-27 05:27:08 +0000248\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000249
Fred Drake8fe533e1998-03-27 05:27:08 +0000250\begin{methoddesc}[writer]{new_styles}{styles}
Fred Drake3b5da761998-03-12 15:33:05 +0000251Set additional styles. The \var{styles} value is a tuple of
252arbitrary values; the value \constant{AS_IS} should be ignored. The
253\var{styles} tuple may be interpreted either as a set or as a stack
Fred Drakee83b30d1996-10-08 21:53:33 +0000254depending on the requirements of the application and writer
255implementation.
Fred Drake8fe533e1998-03-27 05:27:08 +0000256\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000257
Fred Drake8fe533e1998-03-27 05:27:08 +0000258\begin{methoddesc}[writer]{send_line_break}{}
Fred Drakee83b30d1996-10-08 21:53:33 +0000259Break the current line.
Fred Drake8fe533e1998-03-27 05:27:08 +0000260\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000261
Fred Drake8fe533e1998-03-27 05:27:08 +0000262\begin{methoddesc}[writer]{send_paragraph}{blankline}
Fred Drake3b5da761998-03-12 15:33:05 +0000263Produce a paragraph separation of at least \var{blankline} blank
264lines, or the equivelent. The \var{blankline} value will be an
Fred Drakee83b30d1996-10-08 21:53:33 +0000265integer.
Fred Drake8fe533e1998-03-27 05:27:08 +0000266\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000267
Fred Drake8fe533e1998-03-27 05:27:08 +0000268\begin{methoddesc}[writer]{send_hor_rule}{*args, **kw}
Fred Drakee83b30d1996-10-08 21:53:33 +0000269Display a horizontal rule on the output device. The arguments to this
270method are entirely application- and writer-specific, and should be
271interpreted with care. The method implementation may assume that a
Fred Drake3b5da761998-03-12 15:33:05 +0000272line break has already been issued via \method{send_line_break()}.
Fred Drake8fe533e1998-03-27 05:27:08 +0000273\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000274
Fred Drake8fe533e1998-03-27 05:27:08 +0000275\begin{methoddesc}[writer]{send_flowing_data}{data}
Fred Drakee83b30d1996-10-08 21:53:33 +0000276Output character data which may be word-wrapped and re-flowed as
277needed. Within any sequence of calls to this method, the writer may
278assume that spans of multiple whitespace characters have been
279collapsed to single space characters.
Fred Drake8fe533e1998-03-27 05:27:08 +0000280\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000281
Fred Drake8fe533e1998-03-27 05:27:08 +0000282\begin{methoddesc}[writer]{send_literal_data}{data}
Fred Drakee83b30d1996-10-08 21:53:33 +0000283Output character data which has already been formatted
284for display. Generally, this should be interpreted to mean that line
285breaks indicated by newline characters should be preserved and no new
286line breaks should be introduced. The data may contain embedded
287newline and tab characters, unlike data provided to the
Fred Drake3b5da761998-03-12 15:33:05 +0000288\method{send_formatted_data()} interface.
Fred Drake8fe533e1998-03-27 05:27:08 +0000289\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000290
Fred Drake8fe533e1998-03-27 05:27:08 +0000291\begin{methoddesc}[writer]{send_label_data}{data}
Fred Drake3b5da761998-03-12 15:33:05 +0000292Set \var{data} to the left of the current left margin, if possible.
293The value of \var{data} is not restricted; treatment of non-string
Fred Drakee83b30d1996-10-08 21:53:33 +0000294values is entirely application- and writer-dependent. This method
295will only be called at the beginning of a line.
Fred Drake8fe533e1998-03-27 05:27:08 +0000296\end{methoddesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000297
298
299\subsection{Writer Implementations}
300
Fred Drake8f925951996-10-09 16:13:22 +0000301Three implementations of the writer object interface are provided as
302examples by this module. Most applications will need to derive new
Fred Drake3b5da761998-03-12 15:33:05 +0000303writer classes from the \class{NullWriter} class.
Fred Drake8f925951996-10-09 16:13:22 +0000304
Fred Drake7bf5e081998-03-16 05:07:04 +0000305\begin{classdesc}{NullWriter}{}
Fred Drakee83b30d1996-10-08 21:53:33 +0000306A writer which only provides the interface definition; no actions are
307taken on any methods. This should be the base class for all writers
308which do not need to inherit any implementation methods.
Fred Drake7bf5e081998-03-16 05:07:04 +0000309\end{classdesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000310
Fred Drake7bf5e081998-03-16 05:07:04 +0000311\begin{classdesc}{AbstractWriter}{}
Fred Drakee83b30d1996-10-08 21:53:33 +0000312A writer which can be used in debugging formatters, but not much
Fred Drake5081b221998-01-15 05:49:00 +0000313else. Each method simply announces itself by printing its name and
Fred Drakee83b30d1996-10-08 21:53:33 +0000314arguments on standard output.
Fred Drake7bf5e081998-03-16 05:07:04 +0000315\end{classdesc}
Fred Drakee83b30d1996-10-08 21:53:33 +0000316
Fred Drakecce10901998-03-17 06:33:25 +0000317\begin{classdesc}{DumbWriter}{\optional{file\optional{, maxcol\code{ = 72}}}}
Fred Drakee83b30d1996-10-08 21:53:33 +0000318Simple writer class which writes output on the file object passed in
Fred Drake3b5da761998-03-12 15:33:05 +0000319as \var{file} or, if \var{file} is omitted, on standard output. The
Fred Drakee83b30d1996-10-08 21:53:33 +0000320output is simply word-wrapped to the number of columns specified by
Fred Drake3b5da761998-03-12 15:33:05 +0000321\var{maxcol}. This class is suitable for reflowing a sequence of
Fred Drakee83b30d1996-10-08 21:53:33 +0000322paragraphs.
Fred Drake7bf5e081998-03-16 05:07:04 +0000323\end{classdesc}