pygments.rb 1.2.1 → 2.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/dependabot.yml +13 -0
- data/.github/workflows/ci.yml +28 -0
- data/.github/workflows/release.yml +24 -0
- data/.gitignore +5 -6
- data/CHANGELOG.adoc +119 -0
- data/Gemfile +3 -1
- data/LICENSE +1 -1
- data/README.adoc +161 -0
- data/Rakefile +10 -21
- data/bench.rb +8 -7
- data/cache-lexers.rb +3 -2
- data/lib/pygments.rb +10 -11
- data/lib/pygments/lexer.rb +5 -5
- data/lib/pygments/mentos.py +23 -66
- data/lib/pygments/popen.rb +152 -204
- data/lib/pygments/version.rb +2 -2
- data/pygments.rb.gemspec +11 -9
- data/test/test_pygments.rb +51 -84
- data/vendor/pygments-main/{AUTHORS → Pygments-2.7.3.dist-info/AUTHORS} +21 -3
- data/vendor/pygments-main/Pygments-2.7.3.dist-info/INSTALLER +1 -0
- data/vendor/pygments-main/{LICENSE → Pygments-2.7.3.dist-info/LICENSE} +1 -1
- data/vendor/pygments-main/Pygments-2.7.3.dist-info/METADATA +49 -0
- data/vendor/pygments-main/Pygments-2.7.3.dist-info/RECORD +482 -0
- data/vendor/pygments-main/Pygments-2.7.3.dist-info/REQUESTED +0 -0
- data/vendor/pygments-main/Pygments-2.7.3.dist-info/WHEEL +5 -0
- data/vendor/pygments-main/Pygments-2.7.3.dist-info/entry_points.txt +3 -0
- data/vendor/pygments-main/Pygments-2.7.3.dist-info/top_level.txt +1 -0
- data/vendor/pygments-main/bin/pygmentize +8 -0
- data/vendor/pygments-main/pygments/__init__.py +6 -11
- data/vendor/pygments-main/pygments/__main__.py +18 -0
- data/vendor/pygments-main/pygments/cmdline.py +38 -29
- data/vendor/pygments-main/pygments/console.py +6 -9
- data/vendor/pygments-main/pygments/filter.py +4 -6
- data/vendor/pygments-main/pygments/filters/__init__.py +609 -21
- data/vendor/pygments-main/pygments/formatter.py +4 -4
- data/vendor/pygments-main/pygments/formatters/__init__.py +9 -8
- data/vendor/pygments-main/pygments/formatters/_mapping.py +1 -3
- data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
- data/vendor/pygments-main/pygments/formatters/html.py +223 -135
- data/vendor/pygments-main/pygments/formatters/img.py +68 -41
- data/vendor/pygments-main/pygments/formatters/irc.py +39 -39
- data/vendor/pygments-main/pygments/formatters/latex.py +56 -26
- data/vendor/pygments-main/pygments/formatters/other.py +12 -8
- data/vendor/pygments-main/pygments/formatters/rtf.py +29 -29
- data/vendor/pygments-main/pygments/formatters/svg.py +38 -4
- data/vendor/pygments-main/pygments/formatters/terminal.py +25 -31
- data/vendor/pygments-main/pygments/formatters/terminal256.py +22 -12
- data/vendor/pygments-main/pygments/lexer.py +41 -39
- data/vendor/pygments-main/pygments/lexers/__init__.py +342 -0
- data/vendor/pygments-main/pygments/lexers/_asy_builtins.py +1645 -0
- data/vendor/pygments-main/pygments/lexers/_cl_builtins.py +232 -0
- data/vendor/pygments-main/pygments/lexers/_cocoa_builtins.py +71 -0
- data/vendor/pygments-main/pygments/lexers/_csound_builtins.py +1725 -0
- data/vendor/pygments-main/pygments/lexers/_lasso_builtins.py +5327 -0
- data/vendor/pygments-main/pygments/lexers/_lua_builtins.py +293 -0
- data/vendor/pygments-main/pygments/lexers/_mapping.py +551 -0
- data/vendor/pygments-main/pygments/lexers/_mql_builtins.py +1172 -0
- data/vendor/pygments-main/pygments/lexers/_mysql_builtins.py +1282 -0
- data/vendor/pygments-main/pygments/lexers/_openedge_builtins.py +2547 -0
- data/vendor/pygments-main/pygments/lexers/_php_builtins.py +4753 -0
- data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +678 -0
- data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +3094 -0
- data/vendor/pygments-main/pygments/lexers/_sourcemod_builtins.py +1161 -0
- data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +558 -0
- data/vendor/pygments-main/pygments/lexers/_stata_builtins.py +421 -0
- data/vendor/pygments-main/pygments/lexers/_tsql_builtins.py +1004 -0
- data/vendor/pygments-main/pygments/lexers/_usd_builtins.py +113 -0
- data/vendor/pygments-main/pygments/lexers/_vbscript_builtins.py +280 -0
- data/vendor/pygments-main/pygments/lexers/_vim_builtins.py +1939 -0
- data/vendor/pygments-main/pygments/lexers/actionscript.py +245 -0
- data/vendor/pygments-main/pygments/lexers/agile.py +24 -0
- data/vendor/pygments-main/pygments/lexers/algebra.py +240 -0
- data/vendor/pygments-main/pygments/lexers/ambient.py +76 -0
- data/vendor/pygments-main/pygments/lexers/ampl.py +87 -0
- data/vendor/pygments-main/pygments/lexers/apl.py +101 -0
- data/vendor/pygments-main/pygments/lexers/archetype.py +318 -0
- data/vendor/pygments-main/pygments/lexers/arrow.py +117 -0
- data/vendor/pygments-main/pygments/lexers/asm.py +1005 -0
- data/vendor/pygments-main/pygments/lexers/automation.py +374 -0
- data/vendor/pygments-main/pygments/lexers/bare.py +104 -0
- data/vendor/pygments-main/pygments/lexers/basic.py +662 -0
- data/vendor/pygments-main/pygments/lexers/bibtex.py +160 -0
- data/vendor/pygments-main/pygments/lexers/boa.py +102 -0
- data/vendor/pygments-main/pygments/lexers/business.py +627 -0
- data/vendor/pygments-main/pygments/lexers/c_cpp.py +344 -0
- data/vendor/pygments-main/pygments/lexers/c_like.py +566 -0
- data/vendor/pygments-main/pygments/lexers/capnproto.py +78 -0
- data/vendor/pygments-main/pygments/lexers/chapel.py +112 -0
- data/vendor/pygments-main/pygments/lexers/clean.py +179 -0
- data/vendor/pygments-main/pygments/lexers/compiled.py +34 -0
- data/vendor/pygments-main/pygments/lexers/configs.py +984 -0
- data/vendor/pygments-main/pygments/lexers/console.py +114 -0
- data/vendor/pygments-main/pygments/lexers/crystal.py +392 -0
- data/vendor/pygments-main/pygments/lexers/csound.py +467 -0
- data/vendor/pygments-main/pygments/lexers/css.py +691 -0
- data/vendor/pygments-main/pygments/lexers/d.py +256 -0
- data/vendor/pygments-main/pygments/lexers/dalvik.py +125 -0
- data/vendor/pygments-main/pygments/lexers/data.py +698 -0
- data/vendor/pygments-main/pygments/lexers/devicetree.py +109 -0
- data/vendor/pygments-main/pygments/lexers/diff.py +165 -0
- data/vendor/pygments-main/pygments/lexers/dotnet.py +707 -0
- data/vendor/pygments-main/pygments/lexers/dsls.py +960 -0
- data/vendor/pygments-main/pygments/lexers/dylan.py +287 -0
- data/vendor/pygments-main/pygments/lexers/ecl.py +139 -0
- data/vendor/pygments-main/pygments/lexers/eiffel.py +65 -0
- data/vendor/pygments-main/pygments/lexers/elm.py +121 -0
- data/vendor/pygments-main/pygments/lexers/email.py +151 -0
- data/vendor/pygments-main/pygments/lexers/erlang.py +530 -0
- data/vendor/pygments-main/pygments/lexers/esoteric.py +304 -0
- data/vendor/pygments-main/pygments/lexers/ezhil.py +77 -0
- data/vendor/pygments-main/pygments/lexers/factor.py +344 -0
- data/vendor/pygments-main/pygments/lexers/fantom.py +250 -0
- data/vendor/pygments-main/pygments/lexers/felix.py +273 -0
- data/vendor/pygments-main/pygments/lexers/floscript.py +83 -0
- data/vendor/pygments-main/pygments/lexers/forth.py +178 -0
- data/vendor/pygments-main/pygments/lexers/fortran.py +206 -0
- data/vendor/pygments-main/pygments/lexers/foxpro.py +428 -0
- data/vendor/pygments-main/pygments/lexers/freefem.py +898 -0
- data/vendor/pygments-main/pygments/lexers/functional.py +21 -0
- data/vendor/pygments-main/pygments/lexers/gdscript.py +346 -0
- data/vendor/pygments-main/pygments/lexers/go.py +101 -0
- data/vendor/pygments-main/pygments/lexers/grammar_notation.py +270 -0
- data/vendor/pygments-main/pygments/lexers/graph.py +85 -0
- data/vendor/pygments-main/pygments/lexers/graphics.py +800 -0
- data/vendor/pygments-main/pygments/lexers/haskell.py +870 -0
- data/vendor/pygments-main/pygments/lexers/haxe.py +936 -0
- data/vendor/pygments-main/pygments/lexers/hdl.py +472 -0
- data/vendor/pygments-main/pygments/lexers/hexdump.py +103 -0
- data/vendor/pygments-main/pygments/lexers/html.py +614 -0
- data/vendor/pygments-main/pygments/lexers/idl.py +281 -0
- data/vendor/pygments-main/pygments/lexers/igor.py +420 -0
- data/vendor/pygments-main/pygments/lexers/inferno.py +96 -0
- data/vendor/pygments-main/pygments/lexers/installers.py +322 -0
- data/vendor/pygments-main/pygments/lexers/int_fiction.py +1368 -0
- data/vendor/pygments-main/pygments/lexers/iolang.py +63 -0
- data/vendor/pygments-main/pygments/lexers/j.py +146 -0
- data/vendor/pygments-main/pygments/lexers/javascript.py +1540 -0
- data/vendor/pygments-main/pygments/lexers/julia.py +331 -0
- data/vendor/pygments-main/pygments/lexers/jvm.py +1673 -0
- data/vendor/pygments-main/pygments/lexers/lisp.py +2699 -0
- data/vendor/pygments-main/pygments/lexers/make.py +206 -0
- data/vendor/pygments-main/pygments/lexers/markup.py +765 -0
- data/vendor/pygments-main/pygments/lexers/math.py +21 -0
- data/vendor/pygments-main/pygments/lexers/matlab.py +720 -0
- data/vendor/pygments-main/pygments/lexers/mime.py +226 -0
- data/vendor/pygments-main/pygments/lexers/ml.py +958 -0
- data/vendor/pygments-main/pygments/lexers/modeling.py +366 -0
- data/vendor/pygments-main/pygments/lexers/modula2.py +1580 -0
- data/vendor/pygments-main/pygments/lexers/monte.py +204 -0
- data/vendor/pygments-main/pygments/lexers/mosel.py +448 -0
- data/vendor/pygments-main/pygments/lexers/ncl.py +894 -0
- data/vendor/pygments-main/pygments/lexers/nimrod.py +159 -0
- data/vendor/pygments-main/pygments/lexers/nit.py +64 -0
- data/vendor/pygments-main/pygments/lexers/nix.py +136 -0
- data/vendor/pygments-main/pygments/lexers/oberon.py +121 -0
- data/vendor/pygments-main/pygments/lexers/objective.py +504 -0
- data/vendor/pygments-main/pygments/lexers/ooc.py +85 -0
- data/vendor/pygments-main/pygments/lexers/other.py +41 -0
- data/vendor/pygments-main/pygments/lexers/parasail.py +79 -0
- data/vendor/pygments-main/pygments/lexers/parsers.py +800 -0
- data/vendor/pygments-main/pygments/lexers/pascal.py +644 -0
- data/vendor/pygments-main/pygments/lexers/pawn.py +205 -0
- data/vendor/pygments-main/pygments/lexers/perl.py +732 -0
- data/vendor/pygments-main/pygments/lexers/php.py +321 -0
- data/vendor/pygments-main/pygments/lexers/pointless.py +71 -0
- data/vendor/pygments-main/pygments/lexers/pony.py +94 -0
- data/vendor/pygments-main/pygments/lexers/praat.py +302 -0
- data/vendor/pygments-main/pygments/lexers/prolog.py +306 -0
- data/vendor/pygments-main/pygments/lexers/promql.py +183 -0
- data/vendor/pygments-main/pygments/lexers/python.py +1151 -0
- data/vendor/pygments-main/pygments/lexers/qvt.py +152 -0
- data/vendor/pygments-main/pygments/lexers/r.py +191 -0
- data/vendor/pygments-main/pygments/lexers/rdf.py +463 -0
- data/vendor/pygments-main/pygments/lexers/rebol.py +431 -0
- data/vendor/pygments-main/pygments/lexers/resource.py +85 -0
- data/vendor/pygments-main/pygments/lexers/ride.py +139 -0
- data/vendor/pygments-main/pygments/lexers/rnc.py +67 -0
- data/vendor/pygments-main/pygments/lexers/roboconf.py +82 -0
- data/vendor/pygments-main/pygments/lexers/robotframework.py +552 -0
- data/vendor/pygments-main/pygments/lexers/ruby.py +517 -0
- data/vendor/pygments-main/pygments/lexers/rust.py +224 -0
- data/vendor/pygments-main/pygments/lexers/sas.py +228 -0
- data/vendor/pygments-main/pygments/lexers/scdoc.py +83 -0
- data/vendor/pygments-main/pygments/lexers/scripting.py +1284 -0
- data/vendor/pygments-main/pygments/lexers/sgf.py +61 -0
- data/vendor/pygments-main/pygments/lexers/shell.py +914 -0
- data/vendor/pygments-main/pygments/lexers/sieve.py +69 -0
- data/vendor/pygments-main/pygments/lexers/slash.py +185 -0
- data/vendor/pygments-main/pygments/lexers/smalltalk.py +195 -0
- data/vendor/pygments-main/pygments/lexers/smv.py +79 -0
- data/vendor/pygments-main/pygments/lexers/snobol.py +83 -0
- data/vendor/pygments-main/pygments/lexers/solidity.py +92 -0
- data/vendor/pygments-main/pygments/lexers/special.py +105 -0
- data/vendor/pygments-main/pygments/lexers/sql.py +837 -0
- data/vendor/pygments-main/pygments/lexers/stata.py +171 -0
- data/vendor/pygments-main/pygments/lexers/supercollider.py +95 -0
- data/vendor/pygments-main/pygments/lexers/tcl.py +145 -0
- data/vendor/pygments-main/pygments/lexers/templates.py +2264 -0
- data/vendor/pygments-main/pygments/lexers/teraterm.py +335 -0
- data/vendor/pygments-main/pygments/lexers/testing.py +207 -0
- data/vendor/pygments-main/pygments/lexers/text.py +26 -0
- data/vendor/pygments-main/pygments/lexers/textedit.py +169 -0
- data/vendor/pygments-main/pygments/lexers/textfmts.py +430 -0
- data/vendor/pygments-main/pygments/lexers/theorem.py +474 -0
- data/vendor/pygments-main/pygments/lexers/tnt.py +263 -0
- data/vendor/pygments-main/pygments/lexers/trafficscript.py +54 -0
- data/vendor/pygments-main/pygments/lexers/typoscript.py +219 -0
- data/vendor/pygments-main/pygments/lexers/unicon.py +412 -0
- data/vendor/pygments-main/pygments/lexers/urbi.py +146 -0
- data/vendor/pygments-main/pygments/lexers/usd.py +90 -0
- data/vendor/pygments-main/pygments/lexers/varnish.py +190 -0
- data/vendor/pygments-main/pygments/lexers/verification.py +114 -0
- data/vendor/pygments-main/pygments/lexers/web.py +24 -0
- data/vendor/pygments-main/pygments/lexers/webidl.py +299 -0
- data/vendor/pygments-main/pygments/lexers/webmisc.py +991 -0
- data/vendor/pygments-main/pygments/lexers/whiley.py +116 -0
- data/vendor/pygments-main/pygments/lexers/x10.py +69 -0
- data/vendor/pygments-main/pygments/lexers/xorg.py +37 -0
- data/vendor/pygments-main/pygments/lexers/yang.py +104 -0
- data/vendor/pygments-main/pygments/lexers/zig.py +124 -0
- data/vendor/pygments-main/pygments/modeline.py +1 -1
- data/vendor/pygments-main/pygments/plugin.py +4 -2
- data/vendor/pygments-main/pygments/regexopt.py +1 -1
- data/vendor/pygments-main/pygments/scanner.py +2 -2
- data/vendor/pygments-main/pygments/sphinxext.py +2 -4
- data/vendor/pygments-main/pygments/style.py +61 -24
- data/vendor/pygments-main/pygments/styles/__init__.py +10 -4
- data/vendor/pygments-main/pygments/styles/abap.py +1 -1
- data/vendor/pygments-main/pygments/styles/algol.py +1 -1
- data/vendor/pygments-main/pygments/styles/algol_nu.py +1 -1
- data/vendor/pygments-main/pygments/styles/arduino.py +2 -2
- data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
- data/vendor/pygments-main/pygments/styles/borland.py +1 -1
- data/vendor/pygments-main/pygments/styles/bw.py +1 -1
- data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
- data/vendor/pygments-main/pygments/styles/default.py +1 -1
- data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
- data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
- data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
- data/vendor/pygments-main/pygments/styles/igor.py +1 -1
- data/vendor/pygments-main/pygments/styles/inkpot.py +67 -0
- data/vendor/pygments-main/pygments/styles/lovelace.py +1 -1
- data/vendor/pygments-main/pygments/styles/manni.py +1 -1
- data/vendor/pygments-main/pygments/styles/monokai.py +4 -3
- data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
- data/vendor/pygments-main/pygments/styles/native.py +1 -1
- data/vendor/pygments-main/pygments/styles/paraiso_dark.py +1 -1
- data/vendor/pygments-main/pygments/styles/paraiso_light.py +1 -1
- data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
- data/vendor/pygments-main/pygments/styles/perldoc.py +1 -1
- data/vendor/pygments-main/pygments/styles/rainbow_dash.py +1 -1
- data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
- data/vendor/pygments-main/pygments/styles/sas.py +1 -1
- data/vendor/pygments-main/pygments/styles/solarized.py +134 -0
- data/vendor/pygments-main/pygments/styles/stata_dark.py +41 -0
- data/vendor/pygments-main/pygments/styles/{stata.py → stata_light.py} +14 -15
- data/vendor/pygments-main/pygments/styles/tango.py +1 -1
- data/vendor/pygments-main/pygments/styles/trac.py +1 -1
- data/vendor/pygments-main/pygments/styles/vim.py +1 -1
- data/vendor/pygments-main/pygments/styles/vs.py +1 -1
- data/vendor/pygments-main/pygments/styles/xcode.py +1 -1
- data/vendor/pygments-main/pygments/token.py +1 -1
- data/vendor/pygments-main/pygments/unistring.py +47 -108
- data/vendor/pygments-main/pygments/util.py +15 -92
- metadata +69 -136
- data/CHANGELOG.md +0 -111
- data/README.md +0 -121
- data/circle.yml +0 -20
- data/test/test_data.py +0 -514
- data/test/test_data_generated +0 -2582
- data/vendor/custom_lexers/github.py +0 -565
- data/vendor/pygments-main/CHANGES +0 -1186
- data/vendor/pygments-main/MANIFEST.in +0 -6
- data/vendor/pygments-main/Makefile +0 -65
- data/vendor/pygments-main/README.rst +0 -39
- data/vendor/pygments-main/REVISION +0 -1
- data/vendor/pygments-main/TODO +0 -12
- data/vendor/pygments-main/doc/Makefile +0 -153
- data/vendor/pygments-main/doc/_static/favicon.ico +0 -0
- data/vendor/pygments-main/doc/_static/logo_new.png +0 -0
- data/vendor/pygments-main/doc/_static/logo_only.png +0 -0
- data/vendor/pygments-main/doc/_templates/docssidebar.html +0 -3
- data/vendor/pygments-main/doc/_templates/indexsidebar.html +0 -25
- data/vendor/pygments-main/doc/_themes/pygments14/layout.html +0 -98
- data/vendor/pygments-main/doc/_themes/pygments14/static/bodybg.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/docbg.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/listitem.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/logo.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/pocoo.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/pygments14.css_t +0 -401
- data/vendor/pygments-main/doc/_themes/pygments14/theme.conf +0 -15
- data/vendor/pygments-main/doc/conf.py +0 -241
- data/vendor/pygments-main/doc/docs/api.rst +0 -354
- data/vendor/pygments-main/doc/docs/authors.rst +0 -4
- data/vendor/pygments-main/doc/docs/changelog.rst +0 -1
- data/vendor/pygments-main/doc/docs/cmdline.rst +0 -166
- data/vendor/pygments-main/doc/docs/filterdevelopment.rst +0 -71
- data/vendor/pygments-main/doc/docs/filters.rst +0 -41
- data/vendor/pygments-main/doc/docs/formatterdevelopment.rst +0 -169
- data/vendor/pygments-main/doc/docs/formatters.rst +0 -48
- data/vendor/pygments-main/doc/docs/index.rst +0 -66
- data/vendor/pygments-main/doc/docs/integrate.rst +0 -40
- data/vendor/pygments-main/doc/docs/java.rst +0 -70
- data/vendor/pygments-main/doc/docs/lexerdevelopment.rst +0 -728
- data/vendor/pygments-main/doc/docs/lexers.rst +0 -69
- data/vendor/pygments-main/doc/docs/moinmoin.rst +0 -39
- data/vendor/pygments-main/doc/docs/plugins.rst +0 -93
- data/vendor/pygments-main/doc/docs/quickstart.rst +0 -205
- data/vendor/pygments-main/doc/docs/rstdirective.rst +0 -22
- data/vendor/pygments-main/doc/docs/styles.rst +0 -201
- data/vendor/pygments-main/doc/docs/tokens.rst +0 -372
- data/vendor/pygments-main/doc/docs/unicode.rst +0 -58
- data/vendor/pygments-main/doc/download.rst +0 -41
- data/vendor/pygments-main/doc/faq.rst +0 -139
- data/vendor/pygments-main/doc/index.rst +0 -54
- data/vendor/pygments-main/doc/languages.rst +0 -154
- data/vendor/pygments-main/doc/make.bat +0 -190
- data/vendor/pygments-main/doc/pygmentize.1 +0 -94
- data/vendor/pygments-main/external/autopygmentize +0 -101
- data/vendor/pygments-main/external/lasso-builtins-generator-9.lasso +0 -162
- data/vendor/pygments-main/external/markdown-processor.py +0 -67
- data/vendor/pygments-main/external/moin-parser.py +0 -112
- data/vendor/pygments-main/external/pygments.bashcomp +0 -38
- data/vendor/pygments-main/external/rst-directive.py +0 -82
- data/vendor/pygments-main/pygmentize +0 -8
- data/vendor/pygments-main/requirements.txt +0 -5
- data/vendor/pygments-main/scripts/check_sources.py +0 -211
- data/vendor/pygments-main/scripts/debug_lexer.py +0 -246
- data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +0 -33
- data/vendor/pygments-main/scripts/epydoc.css +0 -280
- data/vendor/pygments-main/scripts/get_vimkw.py +0 -74
- data/vendor/pygments-main/scripts/pylintrc +0 -301
- data/vendor/pygments-main/scripts/vim2pygments.py +0 -935
- data/vendor/pygments-main/setup.cfg +0 -10
- data/vendor/pygments-main/setup.py +0 -77
- data/vendor/pygments-main/tox.ini +0 -7
- data/vendor/simplejson/.gitignore +0 -10
- data/vendor/simplejson/.travis.yml +0 -5
- data/vendor/simplejson/CHANGES.txt +0 -291
- data/vendor/simplejson/LICENSE.txt +0 -19
- data/vendor/simplejson/MANIFEST.in +0 -5
- data/vendor/simplejson/README.rst +0 -19
- data/vendor/simplejson/conf.py +0 -179
- data/vendor/simplejson/index.rst +0 -628
- data/vendor/simplejson/scripts/make_docs.py +0 -18
- data/vendor/simplejson/setup.py +0 -104
- data/vendor/simplejson/simplejson/__init__.py +0 -510
- data/vendor/simplejson/simplejson/_speedups.c +0 -2745
- data/vendor/simplejson/simplejson/decoder.py +0 -425
- data/vendor/simplejson/simplejson/encoder.py +0 -567
- data/vendor/simplejson/simplejson/ordered_dict.py +0 -119
- data/vendor/simplejson/simplejson/scanner.py +0 -77
- data/vendor/simplejson/simplejson/tests/__init__.py +0 -67
- data/vendor/simplejson/simplejson/tests/test_bigint_as_string.py +0 -55
- data/vendor/simplejson/simplejson/tests/test_check_circular.py +0 -30
- data/vendor/simplejson/simplejson/tests/test_decimal.py +0 -66
- data/vendor/simplejson/simplejson/tests/test_decode.py +0 -83
- data/vendor/simplejson/simplejson/tests/test_default.py +0 -9
- data/vendor/simplejson/simplejson/tests/test_dump.py +0 -67
- data/vendor/simplejson/simplejson/tests/test_encode_basestring_ascii.py +0 -46
- data/vendor/simplejson/simplejson/tests/test_encode_for_html.py +0 -32
- data/vendor/simplejson/simplejson/tests/test_errors.py +0 -34
- data/vendor/simplejson/simplejson/tests/test_fail.py +0 -91
- data/vendor/simplejson/simplejson/tests/test_float.py +0 -19
- data/vendor/simplejson/simplejson/tests/test_indent.py +0 -86
- data/vendor/simplejson/simplejson/tests/test_item_sort_key.py +0 -20
- data/vendor/simplejson/simplejson/tests/test_namedtuple.py +0 -121
- data/vendor/simplejson/simplejson/tests/test_pass1.py +0 -76
- data/vendor/simplejson/simplejson/tests/test_pass2.py +0 -14
- data/vendor/simplejson/simplejson/tests/test_pass3.py +0 -20
- data/vendor/simplejson/simplejson/tests/test_recursion.py +0 -67
- data/vendor/simplejson/simplejson/tests/test_scanstring.py +0 -117
- data/vendor/simplejson/simplejson/tests/test_separators.py +0 -42
- data/vendor/simplejson/simplejson/tests/test_speedups.py +0 -20
- data/vendor/simplejson/simplejson/tests/test_tuple.py +0 -49
- data/vendor/simplejson/simplejson/tests/test_unicode.py +0 -109
- data/vendor/simplejson/simplejson/tool.py +0 -39
@@ -1,15 +0,0 @@
|
|
1
|
-
[theme]
|
2
|
-
inherit = basic
|
3
|
-
stylesheet = pygments14.css
|
4
|
-
pygments_style = friendly
|
5
|
-
|
6
|
-
[options]
|
7
|
-
green = #66b55e
|
8
|
-
darkgreen = #36852e
|
9
|
-
darkgray = #666666
|
10
|
-
border = #66b55e
|
11
|
-
yellow = #f4cd00
|
12
|
-
darkyellow = #d4ad00
|
13
|
-
lightyellow = #fffbe3
|
14
|
-
background = #f9f9f9
|
15
|
-
font = PT Sans
|
@@ -1,241 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# Pygments documentation build configuration file
|
4
|
-
#
|
5
|
-
|
6
|
-
import sys, os
|
7
|
-
|
8
|
-
# If extensions (or modules to document with autodoc) are in another directory,
|
9
|
-
# add these directories to sys.path here. If the directory is relative to the
|
10
|
-
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
11
|
-
sys.path.insert(0, os.path.abspath('..'))
|
12
|
-
|
13
|
-
import pygments
|
14
|
-
|
15
|
-
# -- General configuration -----------------------------------------------------
|
16
|
-
|
17
|
-
# If your documentation needs a minimal Sphinx version, state it here.
|
18
|
-
#needs_sphinx = '1.0'
|
19
|
-
|
20
|
-
# Add any Sphinx extension module names here, as strings. They can be extensions
|
21
|
-
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
22
|
-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'pygments.sphinxext']
|
23
|
-
|
24
|
-
# Add any paths that contain templates here, relative to this directory.
|
25
|
-
templates_path = ['_templates']
|
26
|
-
|
27
|
-
# The suffix of source filenames.
|
28
|
-
source_suffix = '.rst'
|
29
|
-
|
30
|
-
# The encoding of source files.
|
31
|
-
#source_encoding = 'utf-8-sig'
|
32
|
-
|
33
|
-
# The master toctree document.
|
34
|
-
master_doc = 'index'
|
35
|
-
|
36
|
-
# General information about the project.
|
37
|
-
project = u'Pygments'
|
38
|
-
copyright = u'2015, Georg Brandl'
|
39
|
-
|
40
|
-
# The version info for the project you're documenting, acts as replacement for
|
41
|
-
# |version| and |release|, also used in various other places throughout the
|
42
|
-
# built documents.
|
43
|
-
#
|
44
|
-
# The short X.Y version.
|
45
|
-
version = pygments.__version__
|
46
|
-
# The full version, including alpha/beta/rc tags.
|
47
|
-
release = version
|
48
|
-
|
49
|
-
# The language for content autogenerated by Sphinx. Refer to documentation
|
50
|
-
# for a list of supported languages.
|
51
|
-
#language = None
|
52
|
-
|
53
|
-
# There are two options for replacing |today|: either, you set today to some
|
54
|
-
# non-false value, then it is used:
|
55
|
-
#today = ''
|
56
|
-
# Else, today_fmt is used as the format for a strftime call.
|
57
|
-
#today_fmt = '%B %d, %Y'
|
58
|
-
|
59
|
-
# List of patterns, relative to source directory, that match files and
|
60
|
-
# directories to ignore when looking for source files.
|
61
|
-
exclude_patterns = ['_build']
|
62
|
-
|
63
|
-
# The reST default role (used for this markup: `text`) to use for all documents.
|
64
|
-
#default_role = None
|
65
|
-
|
66
|
-
# If true, '()' will be appended to :func: etc. cross-reference text.
|
67
|
-
#add_function_parentheses = True
|
68
|
-
|
69
|
-
# If true, the current module name will be prepended to all description
|
70
|
-
# unit titles (such as .. function::).
|
71
|
-
#add_module_names = True
|
72
|
-
|
73
|
-
# If true, sectionauthor and moduleauthor directives will be shown in the
|
74
|
-
# output. They are ignored by default.
|
75
|
-
#show_authors = False
|
76
|
-
|
77
|
-
# The name of the Pygments (syntax highlighting) style to use.
|
78
|
-
#pygments_style = 'sphinx'
|
79
|
-
|
80
|
-
# A list of ignored prefixes for module index sorting.
|
81
|
-
#modindex_common_prefix = []
|
82
|
-
|
83
|
-
|
84
|
-
# -- Options for HTML output ---------------------------------------------------
|
85
|
-
|
86
|
-
# The theme to use for HTML and HTML Help pages. See the documentation for
|
87
|
-
# a list of builtin themes.
|
88
|
-
html_theme = 'pygments14'
|
89
|
-
|
90
|
-
# Theme options are theme-specific and customize the look and feel of a theme
|
91
|
-
# further. For a list of options available for each theme, see the
|
92
|
-
# documentation.
|
93
|
-
#html_theme_options = {}
|
94
|
-
|
95
|
-
# Add any paths that contain custom themes here, relative to this directory.
|
96
|
-
html_theme_path = ['_themes']
|
97
|
-
|
98
|
-
# The name for this set of Sphinx documents. If None, it defaults to
|
99
|
-
# "<project> v<release> documentation".
|
100
|
-
#html_title = None
|
101
|
-
|
102
|
-
# A shorter title for the navigation bar. Default is the same as html_title.
|
103
|
-
#html_short_title = None
|
104
|
-
|
105
|
-
# The name of an image file (relative to this directory) to place at the top
|
106
|
-
# of the sidebar.
|
107
|
-
#html_logo = None
|
108
|
-
|
109
|
-
# The name of an image file (within the static path) to use as favicon of the
|
110
|
-
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
111
|
-
# pixels large.
|
112
|
-
html_favicon = '_static/favicon.ico'
|
113
|
-
|
114
|
-
# Add any paths that contain custom static files (such as style sheets) here,
|
115
|
-
# relative to this directory. They are copied after the builtin static files,
|
116
|
-
# so a file named "default.css" will overwrite the builtin "default.css".
|
117
|
-
html_static_path = ['_static']
|
118
|
-
|
119
|
-
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
120
|
-
# using the given strftime format.
|
121
|
-
#html_last_updated_fmt = '%b %d, %Y'
|
122
|
-
|
123
|
-
# If true, SmartyPants will be used to convert quotes and dashes to
|
124
|
-
# typographically correct entities.
|
125
|
-
#html_use_smartypants = True
|
126
|
-
|
127
|
-
# Custom sidebar templates, maps document names to template names.
|
128
|
-
html_sidebars = {'index': 'indexsidebar.html',
|
129
|
-
'docs/*': 'docssidebar.html'}
|
130
|
-
|
131
|
-
# Additional templates that should be rendered to pages, maps page names to
|
132
|
-
# template names.
|
133
|
-
#html_additional_pages = {}
|
134
|
-
|
135
|
-
# If false, no module index is generated.
|
136
|
-
#html_domain_indices = True
|
137
|
-
|
138
|
-
# If false, no index is generated.
|
139
|
-
#html_use_index = True
|
140
|
-
|
141
|
-
# If true, the index is split into individual pages for each letter.
|
142
|
-
#html_split_index = False
|
143
|
-
|
144
|
-
# If true, links to the reST sources are added to the pages.
|
145
|
-
#html_show_sourcelink = True
|
146
|
-
|
147
|
-
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
148
|
-
#html_show_sphinx = True
|
149
|
-
|
150
|
-
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
151
|
-
#html_show_copyright = True
|
152
|
-
|
153
|
-
# If true, an OpenSearch description file will be output, and all pages will
|
154
|
-
# contain a <link> tag referring to it. The value of this option must be the
|
155
|
-
# base URL from which the finished HTML is served.
|
156
|
-
#html_use_opensearch = ''
|
157
|
-
|
158
|
-
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
159
|
-
#html_file_suffix = None
|
160
|
-
|
161
|
-
# Output file base name for HTML help builder.
|
162
|
-
htmlhelp_basename = 'Pygmentsdoc'
|
163
|
-
|
164
|
-
|
165
|
-
# -- Options for LaTeX output --------------------------------------------------
|
166
|
-
|
167
|
-
latex_elements = {
|
168
|
-
# The paper size ('letterpaper' or 'a4paper').
|
169
|
-
#'papersize': 'letterpaper',
|
170
|
-
|
171
|
-
# The font size ('10pt', '11pt' or '12pt').
|
172
|
-
#'pointsize': '10pt',
|
173
|
-
|
174
|
-
# Additional stuff for the LaTeX preamble.
|
175
|
-
#'preamble': '',
|
176
|
-
}
|
177
|
-
|
178
|
-
# Grouping the document tree into LaTeX files. List of tuples
|
179
|
-
# (source start file, target name, title, author, documentclass [howto/manual]).
|
180
|
-
latex_documents = [
|
181
|
-
('index', 'Pygments.tex', u'Pygments Documentation',
|
182
|
-
u'Georg Brandl', 'manual'),
|
183
|
-
]
|
184
|
-
|
185
|
-
# The name of an image file (relative to this directory) to place at the top of
|
186
|
-
# the title page.
|
187
|
-
#latex_logo = None
|
188
|
-
|
189
|
-
# For "manual" documents, if this is true, then toplevel headings are parts,
|
190
|
-
# not chapters.
|
191
|
-
#latex_use_parts = False
|
192
|
-
|
193
|
-
# If true, show page references after internal links.
|
194
|
-
#latex_show_pagerefs = False
|
195
|
-
|
196
|
-
# If true, show URL addresses after external links.
|
197
|
-
#latex_show_urls = False
|
198
|
-
|
199
|
-
# Documents to append as an appendix to all manuals.
|
200
|
-
#latex_appendices = []
|
201
|
-
|
202
|
-
# If false, no module index is generated.
|
203
|
-
#latex_domain_indices = True
|
204
|
-
|
205
|
-
|
206
|
-
# -- Options for manual page output --------------------------------------------
|
207
|
-
|
208
|
-
# One entry per manual page. List of tuples
|
209
|
-
# (source start file, name, description, authors, manual section).
|
210
|
-
man_pages = [
|
211
|
-
('index', 'pygments', u'Pygments Documentation',
|
212
|
-
[u'Georg Brandl'], 1)
|
213
|
-
]
|
214
|
-
|
215
|
-
# If true, show URL addresses after external links.
|
216
|
-
#man_show_urls = False
|
217
|
-
|
218
|
-
|
219
|
-
# -- Options for Texinfo output ------------------------------------------------
|
220
|
-
|
221
|
-
# Grouping the document tree into Texinfo files. List of tuples
|
222
|
-
# (source start file, target name, title, author,
|
223
|
-
# dir menu entry, description, category)
|
224
|
-
texinfo_documents = [
|
225
|
-
('index', 'Pygments', u'Pygments Documentation',
|
226
|
-
u'Georg Brandl', 'Pygments', 'One line description of project.',
|
227
|
-
'Miscellaneous'),
|
228
|
-
]
|
229
|
-
|
230
|
-
# Documents to append as an appendix to all manuals.
|
231
|
-
#texinfo_appendices = []
|
232
|
-
|
233
|
-
# If false, no module index is generated.
|
234
|
-
#texinfo_domain_indices = True
|
235
|
-
|
236
|
-
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
237
|
-
#texinfo_show_urls = 'footnote'
|
238
|
-
|
239
|
-
|
240
|
-
# Example configuration for intersphinx: refer to the Python standard library.
|
241
|
-
#intersphinx_mapping = {'http://docs.python.org/': None}
|
@@ -1,354 +0,0 @@
|
|
1
|
-
.. -*- mode: rst -*-
|
2
|
-
|
3
|
-
=====================
|
4
|
-
The full Pygments API
|
5
|
-
=====================
|
6
|
-
|
7
|
-
This page describes the Pygments API.
|
8
|
-
|
9
|
-
High-level API
|
10
|
-
==============
|
11
|
-
|
12
|
-
.. module:: pygments
|
13
|
-
|
14
|
-
Functions from the :mod:`pygments` module:
|
15
|
-
|
16
|
-
.. function:: lex(code, lexer)
|
17
|
-
|
18
|
-
Lex `code` with the `lexer` (must be a `Lexer` instance)
|
19
|
-
and return an iterable of tokens. Currently, this only calls
|
20
|
-
`lexer.get_tokens()`.
|
21
|
-
|
22
|
-
.. function:: format(tokens, formatter, outfile=None)
|
23
|
-
|
24
|
-
Format a token stream (iterable of tokens) `tokens` with the
|
25
|
-
`formatter` (must be a `Formatter` instance). The result is
|
26
|
-
written to `outfile`, or if that is ``None``, returned as a
|
27
|
-
string.
|
28
|
-
|
29
|
-
.. function:: highlight(code, lexer, formatter, outfile=None)
|
30
|
-
|
31
|
-
This is the most high-level highlighting function.
|
32
|
-
It combines `lex` and `format` in one function.
|
33
|
-
|
34
|
-
|
35
|
-
.. module:: pygments.lexers
|
36
|
-
|
37
|
-
Functions from :mod:`pygments.lexers`:
|
38
|
-
|
39
|
-
.. function:: get_lexer_by_name(alias, **options)
|
40
|
-
|
41
|
-
Return an instance of a `Lexer` subclass that has `alias` in its
|
42
|
-
aliases list. The lexer is given the `options` at its
|
43
|
-
instantiation.
|
44
|
-
|
45
|
-
Will raise :exc:`pygments.util.ClassNotFound` if no lexer with that alias is
|
46
|
-
found.
|
47
|
-
|
48
|
-
.. function:: get_lexer_for_filename(fn, **options)
|
49
|
-
|
50
|
-
Return a `Lexer` subclass instance that has a filename pattern
|
51
|
-
matching `fn`. The lexer is given the `options` at its
|
52
|
-
instantiation.
|
53
|
-
|
54
|
-
Will raise :exc:`pygments.util.ClassNotFound` if no lexer for that filename
|
55
|
-
is found.
|
56
|
-
|
57
|
-
.. function:: get_lexer_for_mimetype(mime, **options)
|
58
|
-
|
59
|
-
Return a `Lexer` subclass instance that has `mime` in its mimetype
|
60
|
-
list. The lexer is given the `options` at its instantiation.
|
61
|
-
|
62
|
-
Will raise :exc:`pygments.util.ClassNotFound` if not lexer for that mimetype
|
63
|
-
is found.
|
64
|
-
|
65
|
-
.. function:: load_lexer_from_file(filename, lexername="CustomLexer", **options)
|
66
|
-
|
67
|
-
Return a `Lexer` subclass instance loaded from the provided file, relative
|
68
|
-
to the current directory. The file is expected to contain a Lexer class
|
69
|
-
named `lexername` (by default, CustomLexer). Users should be very careful with
|
70
|
-
the input, because this method is equivalent to running eval on the input file.
|
71
|
-
The lexer is given the `options` at its instantiation.
|
72
|
-
|
73
|
-
:exc:`ClassNotFound` is raised if there are any errors loading the Lexer
|
74
|
-
|
75
|
-
.. versionadded:: 2.2
|
76
|
-
|
77
|
-
.. function:: guess_lexer(text, **options)
|
78
|
-
|
79
|
-
Return a `Lexer` subclass instance that's guessed from the text in
|
80
|
-
`text`. For that, the :meth:`.analyse_text()` method of every known lexer
|
81
|
-
class is called with the text as argument, and the lexer which returned the
|
82
|
-
highest value will be instantiated and returned.
|
83
|
-
|
84
|
-
:exc:`pygments.util.ClassNotFound` is raised if no lexer thinks it can
|
85
|
-
handle the content.
|
86
|
-
|
87
|
-
.. function:: guess_lexer_for_filename(filename, text, **options)
|
88
|
-
|
89
|
-
As :func:`guess_lexer()`, but only lexers which have a pattern in `filenames`
|
90
|
-
or `alias_filenames` that matches `filename` are taken into consideration.
|
91
|
-
|
92
|
-
:exc:`pygments.util.ClassNotFound` is raised if no lexer thinks it can
|
93
|
-
handle the content.
|
94
|
-
|
95
|
-
.. function:: get_all_lexers()
|
96
|
-
|
97
|
-
Return an iterable over all registered lexers, yielding tuples in the
|
98
|
-
format::
|
99
|
-
|
100
|
-
(longname, tuple of aliases, tuple of filename patterns, tuple of mimetypes)
|
101
|
-
|
102
|
-
.. versionadded:: 0.6
|
103
|
-
|
104
|
-
.. function:: find_lexer_class_by_name(alias)
|
105
|
-
|
106
|
-
Return the `Lexer` subclass that has `alias` in its aliases list, without
|
107
|
-
instantiating it.
|
108
|
-
|
109
|
-
Will raise :exc:`pygments.util.ClassNotFound` if no lexer with that alias is
|
110
|
-
found.
|
111
|
-
|
112
|
-
.. versionadded:: 2.2
|
113
|
-
|
114
|
-
.. function:: find_lexer_class(name)
|
115
|
-
|
116
|
-
Return the `Lexer` subclass that with the *name* attribute as given by
|
117
|
-
the *name* argument.
|
118
|
-
|
119
|
-
|
120
|
-
.. module:: pygments.formatters
|
121
|
-
|
122
|
-
Functions from :mod:`pygments.formatters`:
|
123
|
-
|
124
|
-
.. function:: get_formatter_by_name(alias, **options)
|
125
|
-
|
126
|
-
Return an instance of a :class:`.Formatter` subclass that has `alias` in its
|
127
|
-
aliases list. The formatter is given the `options` at its instantiation.
|
128
|
-
|
129
|
-
Will raise :exc:`pygments.util.ClassNotFound` if no formatter with that
|
130
|
-
alias is found.
|
131
|
-
|
132
|
-
.. function:: get_formatter_for_filename(fn, **options)
|
133
|
-
|
134
|
-
Return a :class:`.Formatter` subclass instance that has a filename pattern
|
135
|
-
matching `fn`. The formatter is given the `options` at its instantiation.
|
136
|
-
|
137
|
-
Will raise :exc:`pygments.util.ClassNotFound` if no formatter for that filename
|
138
|
-
is found.
|
139
|
-
|
140
|
-
.. function:: load_formatter_from_file(filename, formattername="CustomFormatter", **options)
|
141
|
-
|
142
|
-
Return a `Formatter` subclass instance loaded from the provided file, relative
|
143
|
-
to the current directory. The file is expected to contain a Formatter class
|
144
|
-
named ``formattername`` (by default, CustomFormatter). Users should be very
|
145
|
-
careful with the input, because this method is equivalent to running eval
|
146
|
-
on the input file. The formatter is given the `options` at its instantiation.
|
147
|
-
|
148
|
-
:exc:`ClassNotFound` is raised if there are any errors loading the Formatter
|
149
|
-
|
150
|
-
.. versionadded:: 2.2
|
151
|
-
|
152
|
-
.. module:: pygments.styles
|
153
|
-
|
154
|
-
Functions from :mod:`pygments.styles`:
|
155
|
-
|
156
|
-
.. function:: get_style_by_name(name)
|
157
|
-
|
158
|
-
Return a style class by its short name. The names of the builtin styles
|
159
|
-
are listed in :data:`pygments.styles.STYLE_MAP`.
|
160
|
-
|
161
|
-
Will raise :exc:`pygments.util.ClassNotFound` if no style of that name is
|
162
|
-
found.
|
163
|
-
|
164
|
-
.. function:: get_all_styles()
|
165
|
-
|
166
|
-
Return an iterable over all registered styles, yielding their names.
|
167
|
-
|
168
|
-
.. versionadded:: 0.6
|
169
|
-
|
170
|
-
|
171
|
-
.. module:: pygments.lexer
|
172
|
-
|
173
|
-
Lexers
|
174
|
-
======
|
175
|
-
|
176
|
-
The base lexer class from which all lexers are derived is:
|
177
|
-
|
178
|
-
.. class:: Lexer(**options)
|
179
|
-
|
180
|
-
The constructor takes a \*\*keywords dictionary of options.
|
181
|
-
Every subclass must first process its own options and then call
|
182
|
-
the `Lexer` constructor, since it processes the `stripnl`,
|
183
|
-
`stripall` and `tabsize` options.
|
184
|
-
|
185
|
-
An example looks like this:
|
186
|
-
|
187
|
-
.. sourcecode:: python
|
188
|
-
|
189
|
-
def __init__(self, **options):
|
190
|
-
self.compress = options.get('compress', '')
|
191
|
-
Lexer.__init__(self, **options)
|
192
|
-
|
193
|
-
As these options must all be specifiable as strings (due to the
|
194
|
-
command line usage), there are various utility functions
|
195
|
-
available to help with that, see `Option processing`_.
|
196
|
-
|
197
|
-
.. method:: get_tokens(text)
|
198
|
-
|
199
|
-
This method is the basic interface of a lexer. It is called by
|
200
|
-
the `highlight()` function. It must process the text and return an
|
201
|
-
iterable of ``(tokentype, value)`` pairs from `text`.
|
202
|
-
|
203
|
-
Normally, you don't need to override this method. The default
|
204
|
-
implementation processes the `stripnl`, `stripall` and `tabsize`
|
205
|
-
options and then yields all tokens from `get_tokens_unprocessed()`,
|
206
|
-
with the ``index`` dropped.
|
207
|
-
|
208
|
-
.. method:: get_tokens_unprocessed(text)
|
209
|
-
|
210
|
-
This method should process the text and return an iterable of
|
211
|
-
``(index, tokentype, value)`` tuples where ``index`` is the starting
|
212
|
-
position of the token within the input text.
|
213
|
-
|
214
|
-
This method must be overridden by subclasses.
|
215
|
-
|
216
|
-
.. staticmethod:: analyse_text(text)
|
217
|
-
|
218
|
-
A static method which is called for lexer guessing. It should analyse
|
219
|
-
the text and return a float in the range from ``0.0`` to ``1.0``.
|
220
|
-
If it returns ``0.0``, the lexer will not be selected as the most
|
221
|
-
probable one, if it returns ``1.0``, it will be selected immediately.
|
222
|
-
|
223
|
-
.. note:: You don't have to add ``@staticmethod`` to the definition of
|
224
|
-
this method, this will be taken care of by the Lexer's metaclass.
|
225
|
-
|
226
|
-
For a list of known tokens have a look at the :doc:`tokens` page.
|
227
|
-
|
228
|
-
A lexer also can have the following attributes (in fact, they are mandatory
|
229
|
-
except `alias_filenames`) that are used by the builtin lookup mechanism.
|
230
|
-
|
231
|
-
.. attribute:: name
|
232
|
-
|
233
|
-
Full name for the lexer, in human-readable form.
|
234
|
-
|
235
|
-
.. attribute:: aliases
|
236
|
-
|
237
|
-
A list of short, unique identifiers that can be used to lookup
|
238
|
-
the lexer from a list, e.g. using `get_lexer_by_name()`.
|
239
|
-
|
240
|
-
.. attribute:: filenames
|
241
|
-
|
242
|
-
A list of `fnmatch` patterns that match filenames which contain
|
243
|
-
content for this lexer. The patterns in this list should be unique among
|
244
|
-
all lexers.
|
245
|
-
|
246
|
-
.. attribute:: alias_filenames
|
247
|
-
|
248
|
-
A list of `fnmatch` patterns that match filenames which may or may not
|
249
|
-
contain content for this lexer. This list is used by the
|
250
|
-
:func:`.guess_lexer_for_filename()` function, to determine which lexers
|
251
|
-
are then included in guessing the correct one. That means that
|
252
|
-
e.g. every lexer for HTML and a template language should include
|
253
|
-
``\*.html`` in this list.
|
254
|
-
|
255
|
-
.. attribute:: mimetypes
|
256
|
-
|
257
|
-
A list of MIME types for content that can be lexed with this
|
258
|
-
lexer.
|
259
|
-
|
260
|
-
|
261
|
-
.. module:: pygments.formatter
|
262
|
-
|
263
|
-
Formatters
|
264
|
-
==========
|
265
|
-
|
266
|
-
A formatter is derived from this class:
|
267
|
-
|
268
|
-
|
269
|
-
.. class:: Formatter(**options)
|
270
|
-
|
271
|
-
As with lexers, this constructor processes options and then must call the
|
272
|
-
base class :meth:`__init__`.
|
273
|
-
|
274
|
-
The :class:`Formatter` class recognizes the options `style`, `full` and
|
275
|
-
`title`. It is up to the formatter class whether it uses them.
|
276
|
-
|
277
|
-
.. method:: get_style_defs(arg='')
|
278
|
-
|
279
|
-
This method must return statements or declarations suitable to define
|
280
|
-
the current style for subsequent highlighted text (e.g. CSS classes
|
281
|
-
in the `HTMLFormatter`).
|
282
|
-
|
283
|
-
The optional argument `arg` can be used to modify the generation and
|
284
|
-
is formatter dependent (it is standardized because it can be given on
|
285
|
-
the command line).
|
286
|
-
|
287
|
-
This method is called by the ``-S`` :doc:`command-line option <cmdline>`,
|
288
|
-
the `arg` is then given by the ``-a`` option.
|
289
|
-
|
290
|
-
.. method:: format(tokensource, outfile)
|
291
|
-
|
292
|
-
This method must format the tokens from the `tokensource` iterable and
|
293
|
-
write the formatted version to the file object `outfile`.
|
294
|
-
|
295
|
-
Formatter options can control how exactly the tokens are converted.
|
296
|
-
|
297
|
-
.. versionadded:: 0.7
|
298
|
-
A formatter must have the following attributes that are used by the
|
299
|
-
builtin lookup mechanism.
|
300
|
-
|
301
|
-
.. attribute:: name
|
302
|
-
|
303
|
-
Full name for the formatter, in human-readable form.
|
304
|
-
|
305
|
-
.. attribute:: aliases
|
306
|
-
|
307
|
-
A list of short, unique identifiers that can be used to lookup
|
308
|
-
the formatter from a list, e.g. using :func:`.get_formatter_by_name()`.
|
309
|
-
|
310
|
-
.. attribute:: filenames
|
311
|
-
|
312
|
-
A list of :mod:`fnmatch` patterns that match filenames for which this
|
313
|
-
formatter can produce output. The patterns in this list should be unique
|
314
|
-
among all formatters.
|
315
|
-
|
316
|
-
|
317
|
-
.. module:: pygments.util
|
318
|
-
|
319
|
-
Option processing
|
320
|
-
=================
|
321
|
-
|
322
|
-
The :mod:`pygments.util` module has some utility functions usable for option
|
323
|
-
processing:
|
324
|
-
|
325
|
-
.. exception:: OptionError
|
326
|
-
|
327
|
-
This exception will be raised by all option processing functions if
|
328
|
-
the type or value of the argument is not correct.
|
329
|
-
|
330
|
-
.. function:: get_bool_opt(options, optname, default=None)
|
331
|
-
|
332
|
-
Interpret the key `optname` from the dictionary `options` as a boolean and
|
333
|
-
return it. Return `default` if `optname` is not in `options`.
|
334
|
-
|
335
|
-
The valid string values for ``True`` are ``1``, ``yes``, ``true`` and
|
336
|
-
``on``, the ones for ``False`` are ``0``, ``no``, ``false`` and ``off``
|
337
|
-
(matched case-insensitively).
|
338
|
-
|
339
|
-
.. function:: get_int_opt(options, optname, default=None)
|
340
|
-
|
341
|
-
As :func:`get_bool_opt`, but interpret the value as an integer.
|
342
|
-
|
343
|
-
.. function:: get_list_opt(options, optname, default=None)
|
344
|
-
|
345
|
-
If the key `optname` from the dictionary `options` is a string,
|
346
|
-
split it at whitespace and return it. If it is already a list
|
347
|
-
or a tuple, it is returned as a list.
|
348
|
-
|
349
|
-
.. function:: get_choice_opt(options, optname, allowed, default=None)
|
350
|
-
|
351
|
-
If the key `optname` from the dictionary is not in the sequence
|
352
|
-
`allowed`, raise an error, otherwise return it.
|
353
|
-
|
354
|
-
.. versionadded:: 0.8
|