rest25/library/formatter.rst => rest262/library/formatter.rst
164
165.. method:: formatter.push_style(*styles)
166
167   Push any number of arbitrary style specifications.  All styles are pushed onto
168   the styles stack in order.  A tuple representing the entire stack, including
169   :const:`AS_IS` values, is passed to the writer's :meth:`new_styles` method.
170
171
n172-.. method:: formatter.pop_style([n\ ``= 1``])
n172+.. method:: formatter.pop_style([n=1])
173
174   Pop the last *n* style specifications passed to :meth:`push_style`.  A tuple
175   representing the revised stack, including :const:`AS_IS` values, is passed to
176   the writer's :meth:`new_styles` method.
177
178
179.. method:: formatter.set_spacing(spacing)
180
181   Set the spacing style for the writer.
182
183
n184-.. method:: formatter.assert_line_data([flag\ ``= 1``])
n184+.. method:: formatter.assert_line_data([flag=1])
185
n186-   Inform the formatter that data has been added to the current paragraph out-of-
n186+   Inform the formatter that data has been added to the current paragraph
187-   band.  This should be used when the writer has been manipulated directly.  The
187+   out-of-band.  This should be used when the writer has been manipulated
188-   optional *flag* argument can be set to false if the writer manipulations
188+   directly.  The optional *flag* argument can be set to false if the writer
189-   produced a hard line break at the end of the output.
189+   manipulations produced a hard line break at the end of the output.
190
191
192.. _formatter-impls:
193
194Formatter Implementations
195-------------------------
196
197Two implementations of formatter objects are provided by this module. Most
237   is a string or ``None``, where ``None`` indicates that the writer's "preferred"
238   alignment should be used. Conventional *align* values are ``'left'``,
239   ``'center'``, ``'right'``, and ``'justify'``.
240
241
242.. method:: writer.new_font(font)
243
244   Set the font style.  The value of *font* will be ``None``, indicating that the
n245-   device's default font should be used, or a tuple of the form ``(``*size*,
n245+   device's default font should be used, or a tuple of the form ``(size,
246-   *italic**bold**teletype*``)``.  Size will be a string indicating the size of
246+   italic, bold, teletype)``.  Size will be a string indicating the size of
247   font that should be used; specific strings and their interpretation must be
248   defined by the application.  The *italic*, *bold*, and *teletype* values are
249   Boolean values specifying which of those font attributes should be used.
250
251
252.. method:: writer.new_margin(margin, level)
253
254   Set the margin level to the integer *level* and the logical tag to *margin*.
336
337.. class:: AbstractWriter()
338
339   A writer which can be used in debugging formatters, but not much else.  Each
340   method simply announces itself by printing its name and arguments on standard
341   output.
342
343
t344-.. class:: DumbWriter([file[, maxcol\ ``= 72``]])
t344+.. class:: DumbWriter([file[, maxcol=72]])
345
346   Simple writer class which writes output on the file object passed in as *file*
347   or, if *file* is omitted, on standard output.  The output is simply word-wrapped
348   to the number of columns specified by *maxcol*.  This class is suitable for
349   reflowing a sequence of paragraphs.
350
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op