15 * a number of output formats, presently HTML, LaTeX, RTF, SVG, all image |
15 * a number of output formats, presently HTML, LaTeX, RTF, SVG, all image |
16 formats that PIL supports, and ANSI sequences |
16 formats that PIL supports, and ANSI sequences |
17 * it is usable as a command-line tool and as a library |
17 * it is usable as a command-line tool and as a library |
18 * ... and it highlights even Brainfuck! |
18 * ... and it highlights even Brainfuck! |
19 |
19 |
20 The `Pygments tip`_ is installable with ``easy_install Pygments==dev``. |
20 The `Pygments master branch`_ is installable with ``easy_install Pygments==dev``. |
21 |
21 |
22 .. _Pygments tip: |
22 .. _Pygments master branch: |
23 http://bitbucket.org/birkenfeld/pygments-main/get/tip.zip#egg=Pygments-dev |
23 https://github.com/pygments/pygments/archive/master.zip#egg=Pygments-dev |
24 |
24 |
25 :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. |
25 :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. |
26 :license: BSD, see LICENSE for details. |
26 :license: BSD, see LICENSE for details. |
27 """ |
27 """ |
28 import sys |
28 import sys |
|
29 from io import StringIO, BytesIO |
29 |
30 |
30 from pygments.util import StringIO, BytesIO |
31 __version__ = '2.6.1' |
31 |
|
32 __version__ = '2.3.1' |
|
33 __docformat__ = 'restructuredtext' |
32 __docformat__ = 'restructuredtext' |
34 |
33 |
35 __all__ = ['lex', 'format', 'highlight'] |
34 __all__ = ['lex', 'format', 'highlight'] |
36 |
35 |
37 |
36 |
82 with a ``write`` method), the result will be written to it, otherwise |
81 with a ``write`` method), the result will be written to it, otherwise |
83 it is returned as a string. |
82 it is returned as a string. |
84 """ |
83 """ |
85 return format(lex(code, lexer), formatter, outfile) |
84 return format(lex(code, lexer), formatter, outfile) |
86 |
85 |
87 |
|
88 if __name__ == '__main__': # pragma: no cover |
|
89 from pygments.cmdline import main |
|
90 sys.exit(main(sys.argv)) |
|