annotate MoinMoin/support/pygments/formatters/_mapping.py @ 6133:a6283e189869 tip

fixup: remove nonexisting passlib.utils._blowfish this was removed by the passlib 1.7.1 upgrade.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 01 Jun 2017 18:10:19 +0200
parents 815981fad7fd
children
rev   line source
4377
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
2 """
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
3 pygments.formatters._mapping
6009
b48a69886ca4 upgrade bundled pygments to 1.6
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5564
diff changeset
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4377
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
5
6097
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
6 Formatter mapping definitions. This file is generated by itself. Everytime
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
7 you change something on a builtin formatter definition, run this script from
4377
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
8 the formatters folder to update it.
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
9
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
10 Do not alter the FORMATTERS dictionary by hand.
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
11
6097
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
12 :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
5184
0970ed47d2cd updated pygments to 1.1.1+ ( http://dev.pocoo.org/hg/pygments-main/rev/948f8885af16 )
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4377
diff changeset
13 :license: BSD, see LICENSE for details.
4377
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
14 """
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
15
6097
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
16 from __future__ import print_function
4377
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
17
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
18 FORMATTERS = {
6097
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
19 'BBCodeFormatter': ('pygments.formatters.bbcode', 'BBCode', ('bbcode', 'bb'), (), 'Format tokens with BBcodes. These formatting codes are used by many bulletin boards, so you can highlight your sourcecode with pygments before posting it there.'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
20 'BmpImageFormatter': ('pygments.formatters.img', 'img_bmp', ('bmp', 'bitmap'), ('*.bmp',), 'Create a bitmap image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
21 'GifImageFormatter': ('pygments.formatters.img', 'img_gif', ('gif',), ('*.gif',), 'Create a GIF image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
22 'HtmlFormatter': ('pygments.formatters.html', 'HTML', ('html',), ('*.html', '*.htm'), "Format tokens as HTML 4 ``<span>`` tags within a ``<pre>`` tag, wrapped in a ``<div>`` tag. The ``<div>``'s CSS class can be set by the `cssclass` option."),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
23 'IRCFormatter': ('pygments.formatters.irc', 'IRC', ('irc', 'IRC'), (), 'Format tokens with IRC color sequences'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
24 'ImageFormatter': ('pygments.formatters.img', 'img', ('img', 'IMG', 'png'), ('*.png',), 'Create a PNG image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
25 'JpgImageFormatter': ('pygments.formatters.img', 'img_jpg', ('jpg', 'jpeg'), ('*.jpg',), 'Create a JPEG image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
26 'LatexFormatter': ('pygments.formatters.latex', 'LaTeX', ('latex', 'tex'), ('*.tex',), 'Format tokens as LaTeX code. This needs the `fancyvrb` and `color` standard packages.'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
27 'NullFormatter': ('pygments.formatters.other', 'Text only', ('text', 'null'), ('*.txt',), 'Output the text unchanged without any formatting.'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
28 'RawTokenFormatter': ('pygments.formatters.other', 'Raw tokens', ('raw', 'tokens'), ('*.raw',), 'Format tokens as a raw representation for storing token streams.'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
29 'RtfFormatter': ('pygments.formatters.rtf', 'RTF', ('rtf',), ('*.rtf',), 'Format tokens as RTF markup. This formatter automatically outputs full RTF documents with color information and other useful stuff. Perfect for Copy and Paste into Microsoft(R) Word(R) documents.'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
30 'SvgFormatter': ('pygments.formatters.svg', 'SVG', ('svg',), ('*.svg',), 'Format tokens as an SVG graphics file. This formatter is still experimental. Each line of code is a ``<text>`` element with explicit ``x`` and ``y`` coordinates containing ``<tspan>`` elements with the individual token styles.'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
31 'Terminal256Formatter': ('pygments.formatters.terminal256', 'Terminal256', ('terminal256', 'console256', '256'), (), 'Format tokens with ANSI color sequences, for output in a 256-color terminal or console. Like in `TerminalFormatter` color sequences are terminated at newlines, so that paging the output works correctly.'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
32 'TerminalFormatter': ('pygments.formatters.terminal', 'Terminal', ('terminal', 'console'), (), 'Format tokens with ANSI color sequences, for output in a text console. Color sequences are terminated at newlines, so that paging the output works correctly.'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
33 'TerminalTrueColorFormatter': ('pygments.formatters.terminal256', 'TerminalTrueColor', ('terminal16m', 'console16m', '16m'), (), 'Format tokens with ANSI color sequences, for output in a true-color terminal or console. Like in `TerminalFormatter` color sequences are terminated at newlines, so that paging the output works correctly.'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
34 'TestcaseFormatter': ('pygments.formatters.other', 'Testcase', ('testcase',), (), 'Format tokens as appropriate for a new testcase.')
4377
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
35 }
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
36
6097
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
37 if __name__ == '__main__': # pragma: no cover
4377
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
38 import sys
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
39 import os
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
40
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
41 # lookup formatters
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
42 found_formatters = []
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
43 imports = []
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
44 sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
6009
b48a69886ca4 upgrade bundled pygments to 1.6
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5564
diff changeset
45 from pygments.util import docstring_headline
b48a69886ca4 upgrade bundled pygments to 1.6
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5564
diff changeset
46
6097
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
47 for root, dirs, files in os.walk('.'):
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
48 for filename in files:
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
49 if filename.endswith('.py') and not filename.startswith('_'):
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
50 module_name = 'pygments.formatters%s.%s' % (
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
51 root[1:].replace('/', '.'), filename[:-3])
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
52 print(module_name)
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
53 module = __import__(module_name, None, None, [''])
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
54 for formatter_name in module.__all__:
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
55 formatter = getattr(module, formatter_name)
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
56 found_formatters.append(
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
57 '%r: %r' % (formatter_name,
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
58 (module_name,
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
59 formatter.name,
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
60 tuple(formatter.aliases),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
61 tuple(formatter.filenames),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
62 docstring_headline(formatter))))
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
63 # sort them to make the diff minimal
4377
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
64 found_formatters.sort()
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
65
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
66 # extract useful sourcecode from this file
6097
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
67 with open(__file__) as fp:
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
68 content = fp.read()
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
69 # replace crnl to nl for Windows.
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
70 #
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
71 # Note that, originally, contributers should keep nl of master
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
72 # repository, for example by using some kind of automatic
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
73 # management EOL, like `EolExtension
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
74 # <https://www.mercurial-scm.org/wiki/EolExtension>`.
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
75 content = content.replace("\r\n", "\n")
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
76 header = content[:content.find('FORMATTERS = {')]
4377
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
77 footer = content[content.find("if __name__ == '__main__':"):]
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
78
00b1307bd9c2 Adding Pygments to MoinMoin/support
Radomir Dopieralski <moindev@sheep.art.pl>
parents:
diff changeset
79 # write new file
6097
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
80 with open(__file__, 'w') as fp:
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
81 fp.write(header)
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
82 fp.write('FORMATTERS = {\n %s\n}\n\n' % ',\n '.join(found_formatters))
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
83 fp.write(footer)
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
84
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 6009
diff changeset
85 print ('=== %d formatters processed.' % len(found_formatters))