Sha256: 2b3b1524385effd21b9a51731e4a33e6142d60b22d812dc233e0d3bcccffec6e

Contents?: true

Size: 1.58 KB

Versions: 11

Compression:

Stored size: 1.58 KB

Contents

.. -*- mode: rst -*-

====================
Available formatters
====================

This page lists all builtin formatters.

Common options
==============

All formatters support these options:

`encoding`
    If given, must be an encoding name (such as ``"utf-8"``). This will
    be used to convert the token strings (which are Unicode strings)
    to byte strings in the output (default: ``None``).
    It will also be written in an encoding declaration suitable for the
    document format if the `full` option is given (e.g. a ``meta
    content-type`` directive in HTML or an invocation of the `inputenc`
    package in LaTeX).

    If this is ``""`` or ``None``, Unicode strings will be written
    to the output file, which most file-like objects do not support.
    For example, `pygments.highlight()` will return a Unicode string if
    called with no `outfile` argument and a formatter that has `encoding`
    set to ``None`` because it uses a `StringIO.StringIO` object that
    supports Unicode arguments to `write()`. Using a regular file object
    wouldn't work.

    .. versionadded:: 0.6

`outencoding`
    When using Pygments from the command line, any `encoding` option given is
    passed to the lexer and the formatter. This is sometimes not desirable,
    for example if you want to set the input encoding to ``"guess"``.
    Therefore, `outencoding` has been introduced which overrides `encoding`
    for the formatter if given.

    .. versionadded:: 0.7


Formatter classes
=================

All these classes are importable from :mod:`pygments.formatters`.

.. pygmentsdoc:: formatters

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
pygments.rb-1.2.1 vendor/pygments-main/doc/docs/formatters.rst
pygments.rb-1.2.0 vendor/pygments-main/doc/docs/formatters.rst
pygments.rb-1.1.2 vendor/pygments-main/doc/docs/formatters.rst
pygments.rb-1.1.1 vendor/pygments-main/doc/docs/formatters.rst
pygments.rb-1.1.0 vendor/pygments-main/doc/docs/formatters.rst
pygments.rb-1.0.0 vendor/pygments-main/doc/docs/formatters.rst
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/pygments.rb-0.6.3/vendor/pygments-main/doc/docs/formatters.rst
pygments.rb-0.6.3 vendor/pygments-main/doc/docs/formatters.rst
pygments.rb-0.6.2 vendor/pygments-main/doc/docs/formatters.rst
pygments.rb-0.6.1 vendor/pygments-main/doc/docs/formatters.rst
pygments.rb-0.6.0 vendor/pygments-main/doc/docs/formatters.rst