Commits

gbrandl  committed aa36837

[svn] Small docs update.

  • Participants
  • Parent commits 86cef5c
  • Branches trunk

Comments (0)

Files changed (2)

File docs/src/formatters.txt

 Common options
 ==============
 
-All formatters support this option:
+All formatters support these options:
 
 `encoding`
     *New in Pygments 0.6.*

File pygments/formatters/html.py

     *New in Pygments 0.7.* 
 
     The HTML formatter is now built in a way that allows easy subclassing, thus
-    customizing the output HTML code. The `format()` method creates a basic
-    generator by calling `self._format_lines()`. The resulting iterator yields
-    tuples of ``(code, text)``, where ``code`` is always ``1`` and indicates that
-    the ``text`` is a line of the formatted source code.
+    customizing the output HTML code. The `format()` method calls
+    `self._format_lines()` which returns a generator that yields tuples of ``(1,
+    line)``, where the ``1`` indicates that the ``line`` is a line of the
+    formatted source code.
 
     If the `nowrap` option is set, the generator is the iterated over and the
     resulting HTML is output.
 
-    Otherwise, `format()` calls `self.wrap()`, which wraps the generator with other
-    generators. These add some HTML code to the one generated by `_format_lines()`,
-    either by modifying the lines generated by the latter, then yielding them again
-    with ``(1, line)``, and/or by yielding other code before or after the lines,
-    with ``(0, html)``. The distinction between source lines and other code makes it
-    possible to wrap the generator multiple times.
+    Otherwise, `format()` calls `self.wrap()`, which wraps the generator with
+    other generators. These may add some HTML code to the one generated by
+    `_format_lines()`, either by modifying the lines generated by the latter,
+    then yielding them again with ``(1, line)``, and/or by yielding other HTML
+    code before or after the lines, with ``(0, html)``. The distinction between
+    source lines and other code makes it possible to wrap the generator multiple
+    times.
 
     The default `wrap()` implementation adds a ``<div>`` and a ``<pre>`` tag.
 
                 yield 0, '<code>'
                 for i, t in source:
                     if i == 1:
+                        # it's a line of formatted code
                         t += '<br>'
                     yield i, t
                 yield 0, '</code>'
     source lines are broken using ``<br>`` tags.
 
     After calling `wrap()`, the `format()` method also adds the "line numbers"
-    and/or "full document" wrappers if the respective options are set.
+    and/or "full document" wrappers if the respective options are set. Then, all
+    HTML yielded by the wrapped generator is output.
     """
 
     name = 'HTML'