Changes

Jump to navigation Jump to search
→‎Defining hooks: Update to the addition of the begin/end hooks.
not defined, a default version will be called instead.
When pretty printinga file or buffer (named or anonymous using<code>\starttyping</code>), the following hooks are called:
# Call <tt>begin_of_display</tt>
# For each line in the input:
#* If the line contains only whitespace:
#*# Call <tt>flush_line</tt> to process and output the current line.
#*# Call <tt>end_of_line</tt>
# Call <tt>end_of_display</tt>
 
When prettyprint a single phrase (using <code>\type</code>), the following
hooks are called:
 
# Call <tt>begin_of_inline</tt>
# Call <tt>flush_line</tt>
# Call <tt>end_of_inline</tt>
 
Note that in this case, the <tt>line</tt> hook is not called!
Each hook should be defined as function named as follows:
<tt>buffersvisualizer.visualizers.''printer_name''.''function_name''</tt>, where <tt>visualizer</tt> is thedictionary returned by <tt>newvisualizer</tt> (see above).
For example, the <tt>flush_line</tt> function for the <tt>foo</tt>
pretty printer, above should be defined as:
function buffers.visualizers.foovisualizer.flush_line(str,nested)
== Hooks ==
14

edits

Navigation menu