From: JinWang An Date: Tue, 5 Jan 2021 03:17:41 +0000 (+0900) Subject: Imported Upstream version 2.3.0 X-Git-Tag: upstream/2.3.0^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6440fb2593b2151fd272d474f128666ddbfce0ba;p=platform%2Fupstream%2Fpython3-pygments.git Imported Upstream version 2.3.0 --- diff --git a/AUTHORS b/AUTHORS index f9ba267..18e642f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -72,7 +72,7 @@ Other contributors, listed alphabetically, are: * Alex Gosse -- TrafficScript lexer * Patrick Gotthardt -- PHP namespaces support * Olivier Guibe -- Asymptote lexer -* Jordi Gutiérrez Hermoso -- Octave lexer +* Phil Hagelberg -- Fennel lexer * Florian Hahn -- Boogie lexer * Martin Harriman -- SNOBOL lexer * Matthew Harrison -- SVG formatter @@ -81,6 +81,7 @@ Other contributors, listed alphabetically, are: * Aslak Hellesøy -- Gherkin lexer * Greg Hendershott -- Racket lexer * Justin Hendrick -- ParaSail lexer +* Jordi Gutiérrez Hermoso -- Octave lexer * David Hess, Fish Software, Inc. -- Objective-J lexer * Varun Hiremath -- Debian control lexer * Rob Hoelz -- Perl 6 lexer @@ -160,6 +161,7 @@ Other contributors, listed alphabetically, are: * Elias Rabel -- Fortran fixed form lexer * raichoo -- Idris lexer * Kashif Rasul -- CUDA lexer +* Nathan Reed -- HLSL lexer * Justin Reidy -- MXML lexer * Norman Richards -- JSON lexer * Corey Richardson -- Rust lexer updates diff --git a/CHANGES b/CHANGES index 0bab911..c82ca1c 100644 --- a/CHANGES +++ b/CHANGES @@ -6,9 +6,30 @@ Issue numbers refer to the tracker at pull request numbers to the requests at . +Version 2.3.0 +------------- +(released Nov 25, 2018) + +- Added lexers: + + * Fennel (PR#783) + * HLSL (PR#675) + +- Updated lexers: + + * Dockerfile (PR#714) + +- Minimum Python versions changed to 2.7 and 3.5 +- Added support for Python 3.7 generator changes (PR#772) +- Fix incorrect token type in SCSS for single-quote strings (#1322) +- Use `terminal256` formatter if `TERM` contains `256` (PR#666) +- Fix incorrect handling of GitHub style fences in Markdown (PR#741, #1389) +- Fix `%a` not being highlighted in Python3 strings (PR#727) + + Version 2.2.0 ------------- -(release Jan 22, 2017) +(released Jan 22, 2017) - Added lexers: diff --git a/Makefile b/Makefile index 82c4a12..878b94b 100644 --- a/Makefile +++ b/Makefile @@ -63,3 +63,9 @@ tox-test: tox-test-coverage: @tox -- --with-coverage --cover-package=pygments --cover-erase $(TEST) + +RLMODULES = pygments.lexers + +regexlint: + @if [ -z "$(REGEXLINT)" ]; then echo "Please set REGEXLINT=checkout path"; exit 1; fi + PYTHONPATH=`pwd`:$(REGEXLINT) $(REGEXLINT)/regexlint/cmdline.py $(RLMODULES) diff --git a/PKG-INFO b/PKG-INFO index 34d39f2..3fcb3d9 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: Pygments -Version: 2.2.0 +Version: 2.3.0 Summary: Pygments is a syntax highlighting package written in Python. Home-page: http://pygments.org/ Author: Georg Brandl diff --git a/Pygments.egg-info/PKG-INFO b/Pygments.egg-info/PKG-INFO index 34d39f2..3fcb3d9 100644 --- a/Pygments.egg-info/PKG-INFO +++ b/Pygments.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: Pygments -Version: 2.2.0 +Version: 2.3.0 Summary: Pygments is a syntax highlighting package written in Python. Home-page: http://pygments.org/ Author: Georg Brandl diff --git a/Pygments.egg-info/SOURCES.txt b/Pygments.egg-info/SOURCES.txt index efb359f..453b29f 100644 --- a/Pygments.egg-info/SOURCES.txt +++ b/Pygments.egg-info/SOURCES.txt @@ -22,6 +22,115 @@ doc/index.rst doc/languages.rst doc/make.bat doc/pygmentize.1 +doc/_build/doctrees/download.doctree +doc/_build/doctrees/environment.pickle +doc/_build/doctrees/faq.doctree +doc/_build/doctrees/index.doctree +doc/_build/doctrees/languages.doctree +doc/_build/doctrees/docs/api.doctree +doc/_build/doctrees/docs/authors.doctree +doc/_build/doctrees/docs/changelog.doctree +doc/_build/doctrees/docs/cmdline.doctree +doc/_build/doctrees/docs/filterdevelopment.doctree +doc/_build/doctrees/docs/filters.doctree +doc/_build/doctrees/docs/formatterdevelopment.doctree +doc/_build/doctrees/docs/formatters.doctree +doc/_build/doctrees/docs/index.doctree +doc/_build/doctrees/docs/integrate.doctree +doc/_build/doctrees/docs/java.doctree +doc/_build/doctrees/docs/lexerdevelopment.doctree +doc/_build/doctrees/docs/lexers.doctree +doc/_build/doctrees/docs/moinmoin.doctree +doc/_build/doctrees/docs/plugins.doctree +doc/_build/doctrees/docs/quickstart.doctree +doc/_build/doctrees/docs/rstdirective.doctree +doc/_build/doctrees/docs/styles.doctree +doc/_build/doctrees/docs/tokens.doctree +doc/_build/doctrees/docs/unicode.doctree +doc/_build/html/.buildinfo +doc/_build/html/download.html +doc/_build/html/faq.html +doc/_build/html/genindex.html +doc/_build/html/index.html +doc/_build/html/languages.html +doc/_build/html/objects.inv +doc/_build/html/py-modindex.html +doc/_build/html/search.html +doc/_build/html/searchindex.js +doc/_build/html/_sources/download.rst.txt +doc/_build/html/_sources/faq.rst.txt +doc/_build/html/_sources/index.rst.txt +doc/_build/html/_sources/languages.rst.txt +doc/_build/html/_sources/docs/api.rst.txt +doc/_build/html/_sources/docs/authors.rst.txt +doc/_build/html/_sources/docs/changelog.rst.txt +doc/_build/html/_sources/docs/cmdline.rst.txt +doc/_build/html/_sources/docs/filterdevelopment.rst.txt +doc/_build/html/_sources/docs/filters.rst.txt +doc/_build/html/_sources/docs/formatterdevelopment.rst.txt +doc/_build/html/_sources/docs/formatters.rst.txt +doc/_build/html/_sources/docs/index.rst.txt +doc/_build/html/_sources/docs/integrate.rst.txt +doc/_build/html/_sources/docs/java.rst.txt +doc/_build/html/_sources/docs/lexerdevelopment.rst.txt +doc/_build/html/_sources/docs/lexers.rst.txt +doc/_build/html/_sources/docs/moinmoin.rst.txt +doc/_build/html/_sources/docs/plugins.rst.txt +doc/_build/html/_sources/docs/quickstart.rst.txt +doc/_build/html/_sources/docs/rstdirective.rst.txt +doc/_build/html/_sources/docs/styles.rst.txt +doc/_build/html/_sources/docs/tokens.rst.txt +doc/_build/html/_sources/docs/unicode.rst.txt +doc/_build/html/_static/ajax-loader.gif +doc/_build/html/_static/basic.css +doc/_build/html/_static/bodybg.png +doc/_build/html/_static/comment-bright.png +doc/_build/html/_static/comment-close.png +doc/_build/html/_static/comment.png +doc/_build/html/_static/docbg.png +doc/_build/html/_static/doctools.js +doc/_build/html/_static/documentation_options.js +doc/_build/html/_static/down-pressed.png +doc/_build/html/_static/down.png +doc/_build/html/_static/favicon.ico +doc/_build/html/_static/file.png +doc/_build/html/_static/jquery-3.2.1.js +doc/_build/html/_static/jquery.js +doc/_build/html/_static/listitem.png +doc/_build/html/_static/logo.png +doc/_build/html/_static/logo_new.png +doc/_build/html/_static/logo_only.png +doc/_build/html/_static/minus.png +doc/_build/html/_static/plus.png +doc/_build/html/_static/pocoo.png +doc/_build/html/_static/pygments.css +doc/_build/html/_static/pygments14.css +doc/_build/html/_static/searchtools.js +doc/_build/html/_static/underscore-1.3.1.js +doc/_build/html/_static/underscore.js +doc/_build/html/_static/up-pressed.png +doc/_build/html/_static/up.png +doc/_build/html/_static/websupport.js +doc/_build/html/docs/api.html +doc/_build/html/docs/authors.html +doc/_build/html/docs/changelog.html +doc/_build/html/docs/cmdline.html +doc/_build/html/docs/filterdevelopment.html +doc/_build/html/docs/filters.html +doc/_build/html/docs/formatterdevelopment.html +doc/_build/html/docs/formatters.html +doc/_build/html/docs/index.html +doc/_build/html/docs/integrate.html +doc/_build/html/docs/java.html +doc/_build/html/docs/lexerdevelopment.html +doc/_build/html/docs/lexers.html +doc/_build/html/docs/moinmoin.html +doc/_build/html/docs/plugins.html +doc/_build/html/docs/quickstart.html +doc/_build/html/docs/rstdirective.html +doc/_build/html/docs/styles.html +doc/_build/html/docs/tokens.html +doc/_build/html/docs/unicode.html doc/_static/favicon.ico doc/_static/logo_new.png doc/_static/logo_only.png @@ -231,6 +340,7 @@ pygments/lexers/web.py pygments/lexers/webmisc.py pygments/lexers/whiley.py pygments/lexers/x10.py +pygments/lexers/xorg.py pygments/styles/__init__.py pygments/styles/abap.py pygments/styles/algol.py @@ -270,6 +380,7 @@ scripts/epydoc.css scripts/find_error.py scripts/get_vimkw.py scripts/pylintrc +scripts/release-checklist scripts/vim2pygments.py tests/run.py tests/string_asserts.py @@ -292,6 +403,7 @@ tests/test_javascript.py tests/test_julia.py tests/test_latex_formatter.py tests/test_lexers_other.py +tests/test_markdown_lexer.py tests/test_modeline.py tests/test_objectiveclexer.py tests/test_perllexer.py @@ -424,6 +536,7 @@ tests/examplefiles/example.golo tests/examplefiles/example.groovy tests/examplefiles/example.gs tests/examplefiles/example.gst +tests/examplefiles/example.hlsl tests/examplefiles/example.hs tests/examplefiles/example.hx tests/examplefiles/example.i6t @@ -503,6 +616,7 @@ tests/examplefiles/example_coq.v tests/examplefiles/example_elixir.ex tests/examplefiles/example_file.fy tests/examplefiles/ezhil_primefactors.n +tests/examplefiles/fennelview.fnl tests/examplefiles/fibonacci.tokigun.aheui tests/examplefiles/firefox.mak tests/examplefiles/flatline_example @@ -747,6 +861,7 @@ tests/examplefiles/webkit-transition.css tests/examplefiles/while.pov tests/examplefiles/wiki.factor tests/examplefiles/xml_example +tests/examplefiles/xorg.conf tests/examplefiles/yahalom.cpsa tests/examplefiles/zmlrpc.f90 tests/support/empty.py diff --git a/doc/_build/doctrees/docs/api.doctree b/doc/_build/doctrees/docs/api.doctree new file mode 100644 index 0000000..fbaa32c Binary files /dev/null and b/doc/_build/doctrees/docs/api.doctree differ diff --git a/doc/_build/doctrees/docs/authors.doctree b/doc/_build/doctrees/docs/authors.doctree new file mode 100644 index 0000000..6899645 Binary files /dev/null and b/doc/_build/doctrees/docs/authors.doctree differ diff --git a/doc/_build/doctrees/docs/changelog.doctree b/doc/_build/doctrees/docs/changelog.doctree new file mode 100644 index 0000000..38a51a0 Binary files /dev/null and b/doc/_build/doctrees/docs/changelog.doctree differ diff --git a/doc/_build/doctrees/docs/cmdline.doctree b/doc/_build/doctrees/docs/cmdline.doctree new file mode 100644 index 0000000..004c378 Binary files /dev/null and b/doc/_build/doctrees/docs/cmdline.doctree differ diff --git a/doc/_build/doctrees/docs/filterdevelopment.doctree b/doc/_build/doctrees/docs/filterdevelopment.doctree new file mode 100644 index 0000000..64ae5ae Binary files /dev/null and b/doc/_build/doctrees/docs/filterdevelopment.doctree differ diff --git a/doc/_build/doctrees/docs/filters.doctree b/doc/_build/doctrees/docs/filters.doctree new file mode 100644 index 0000000..a45ce28 Binary files /dev/null and b/doc/_build/doctrees/docs/filters.doctree differ diff --git a/doc/_build/doctrees/docs/formatterdevelopment.doctree b/doc/_build/doctrees/docs/formatterdevelopment.doctree new file mode 100644 index 0000000..6c017f1 Binary files /dev/null and b/doc/_build/doctrees/docs/formatterdevelopment.doctree differ diff --git a/doc/_build/doctrees/docs/formatters.doctree b/doc/_build/doctrees/docs/formatters.doctree new file mode 100644 index 0000000..5a39ac3 Binary files /dev/null and b/doc/_build/doctrees/docs/formatters.doctree differ diff --git a/doc/_build/doctrees/docs/index.doctree b/doc/_build/doctrees/docs/index.doctree new file mode 100644 index 0000000..31cacb8 Binary files /dev/null and b/doc/_build/doctrees/docs/index.doctree differ diff --git a/doc/_build/doctrees/docs/integrate.doctree b/doc/_build/doctrees/docs/integrate.doctree new file mode 100644 index 0000000..fb3e961 Binary files /dev/null and b/doc/_build/doctrees/docs/integrate.doctree differ diff --git a/doc/_build/doctrees/docs/java.doctree b/doc/_build/doctrees/docs/java.doctree new file mode 100644 index 0000000..d2b4149 Binary files /dev/null and b/doc/_build/doctrees/docs/java.doctree differ diff --git a/doc/_build/doctrees/docs/lexerdevelopment.doctree b/doc/_build/doctrees/docs/lexerdevelopment.doctree new file mode 100644 index 0000000..57e10ac Binary files /dev/null and b/doc/_build/doctrees/docs/lexerdevelopment.doctree differ diff --git a/doc/_build/doctrees/docs/lexers.doctree b/doc/_build/doctrees/docs/lexers.doctree new file mode 100644 index 0000000..402ad4a Binary files /dev/null and b/doc/_build/doctrees/docs/lexers.doctree differ diff --git a/doc/_build/doctrees/docs/moinmoin.doctree b/doc/_build/doctrees/docs/moinmoin.doctree new file mode 100644 index 0000000..e93b9c2 Binary files /dev/null and b/doc/_build/doctrees/docs/moinmoin.doctree differ diff --git a/doc/_build/doctrees/docs/plugins.doctree b/doc/_build/doctrees/docs/plugins.doctree new file mode 100644 index 0000000..78f2cc1 Binary files /dev/null and b/doc/_build/doctrees/docs/plugins.doctree differ diff --git a/doc/_build/doctrees/docs/quickstart.doctree b/doc/_build/doctrees/docs/quickstart.doctree new file mode 100644 index 0000000..9720f1e Binary files /dev/null and b/doc/_build/doctrees/docs/quickstart.doctree differ diff --git a/doc/_build/doctrees/docs/rstdirective.doctree b/doc/_build/doctrees/docs/rstdirective.doctree new file mode 100644 index 0000000..b644275 Binary files /dev/null and b/doc/_build/doctrees/docs/rstdirective.doctree differ diff --git a/doc/_build/doctrees/docs/styles.doctree b/doc/_build/doctrees/docs/styles.doctree new file mode 100644 index 0000000..a416804 Binary files /dev/null and b/doc/_build/doctrees/docs/styles.doctree differ diff --git a/doc/_build/doctrees/docs/tokens.doctree b/doc/_build/doctrees/docs/tokens.doctree new file mode 100644 index 0000000..e233710 Binary files /dev/null and b/doc/_build/doctrees/docs/tokens.doctree differ diff --git a/doc/_build/doctrees/docs/unicode.doctree b/doc/_build/doctrees/docs/unicode.doctree new file mode 100644 index 0000000..5388960 Binary files /dev/null and b/doc/_build/doctrees/docs/unicode.doctree differ diff --git a/doc/_build/doctrees/download.doctree b/doc/_build/doctrees/download.doctree new file mode 100644 index 0000000..a4553a8 Binary files /dev/null and b/doc/_build/doctrees/download.doctree differ diff --git a/doc/_build/doctrees/environment.pickle b/doc/_build/doctrees/environment.pickle new file mode 100644 index 0000000..ae39e75 Binary files /dev/null and b/doc/_build/doctrees/environment.pickle differ diff --git a/doc/_build/doctrees/faq.doctree b/doc/_build/doctrees/faq.doctree new file mode 100644 index 0000000..aae17e8 Binary files /dev/null and b/doc/_build/doctrees/faq.doctree differ diff --git a/doc/_build/doctrees/index.doctree b/doc/_build/doctrees/index.doctree new file mode 100644 index 0000000..6381cc8 Binary files /dev/null and b/doc/_build/doctrees/index.doctree differ diff --git a/doc/_build/doctrees/languages.doctree b/doc/_build/doctrees/languages.doctree new file mode 100644 index 0000000..9b4c28f Binary files /dev/null and b/doc/_build/doctrees/languages.doctree differ diff --git a/doc/_build/html/.buildinfo b/doc/_build/html/.buildinfo new file mode 100644 index 0000000..75be2cd --- /dev/null +++ b/doc/_build/html/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: c66dbd8069c59e5ffae144e71f7742aa +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/doc/_build/html/_sources/docs/api.rst.txt b/doc/_build/html/_sources/docs/api.rst.txt new file mode 100644 index 0000000..a6b242d --- /dev/null +++ b/doc/_build/html/_sources/docs/api.rst.txt @@ -0,0 +1,354 @@ +.. -*- mode: rst -*- + +===================== +The full Pygments API +===================== + +This page describes the Pygments API. + +High-level API +============== + +.. module:: pygments + +Functions from the :mod:`pygments` module: + +.. function:: lex(code, lexer) + + Lex `code` with the `lexer` (must be a `Lexer` instance) + and return an iterable of tokens. Currently, this only calls + `lexer.get_tokens()`. + +.. function:: format(tokens, formatter, outfile=None) + + Format a token stream (iterable of tokens) `tokens` with the + `formatter` (must be a `Formatter` instance). The result is + written to `outfile`, or if that is ``None``, returned as a + string. + +.. function:: highlight(code, lexer, formatter, outfile=None) + + This is the most high-level highlighting function. + It combines `lex` and `format` in one function. + + +.. module:: pygments.lexers + +Functions from :mod:`pygments.lexers`: + +.. function:: get_lexer_by_name(alias, **options) + + Return an instance of a `Lexer` subclass that has `alias` in its + aliases list. The lexer is given the `options` at its + instantiation. + + Will raise :exc:`pygments.util.ClassNotFound` if no lexer with that alias is + found. + +.. function:: get_lexer_for_filename(fn, **options) + + Return a `Lexer` subclass instance that has a filename pattern + matching `fn`. The lexer is given the `options` at its + instantiation. + + Will raise :exc:`pygments.util.ClassNotFound` if no lexer for that filename + is found. + +.. function:: get_lexer_for_mimetype(mime, **options) + + Return a `Lexer` subclass instance that has `mime` in its mimetype + list. The lexer is given the `options` at its instantiation. + + Will raise :exc:`pygments.util.ClassNotFound` if not lexer for that mimetype + is found. + +.. function:: load_lexer_from_file(filename, lexername="CustomLexer", **options) + + Return a `Lexer` subclass instance loaded from the provided file, relative + to the current directory. The file is expected to contain a Lexer class + named `lexername` (by default, CustomLexer). Users should be very careful with + the input, because this method is equivalent to running eval on the input file. + The lexer is given the `options` at its instantiation. + + :exc:`ClassNotFound` is raised if there are any errors loading the Lexer + + .. versionadded:: 2.2 + +.. function:: guess_lexer(text, **options) + + Return a `Lexer` subclass instance that's guessed from the text in + `text`. For that, the :meth:`.analyse_text()` method of every known lexer + class is called with the text as argument, and the lexer which returned the + highest value will be instantiated and returned. + + :exc:`pygments.util.ClassNotFound` is raised if no lexer thinks it can + handle the content. + +.. function:: guess_lexer_for_filename(filename, text, **options) + + As :func:`guess_lexer()`, but only lexers which have a pattern in `filenames` + or `alias_filenames` that matches `filename` are taken into consideration. + + :exc:`pygments.util.ClassNotFound` is raised if no lexer thinks it can + handle the content. + +.. function:: get_all_lexers() + + Return an iterable over all registered lexers, yielding tuples in the + format:: + + (longname, tuple of aliases, tuple of filename patterns, tuple of mimetypes) + + .. versionadded:: 0.6 + +.. function:: find_lexer_class_by_name(alias) + + Return the `Lexer` subclass that has `alias` in its aliases list, without + instantiating it. + + Will raise :exc:`pygments.util.ClassNotFound` if no lexer with that alias is + found. + + .. versionadded:: 2.2 + +.. function:: find_lexer_class(name) + + Return the `Lexer` subclass that with the *name* attribute as given by + the *name* argument. + + +.. module:: pygments.formatters + +Functions from :mod:`pygments.formatters`: + +.. function:: get_formatter_by_name(alias, **options) + + Return an instance of a :class:`.Formatter` subclass that has `alias` in its + aliases list. The formatter is given the `options` at its instantiation. + + Will raise :exc:`pygments.util.ClassNotFound` if no formatter with that + alias is found. + +.. function:: get_formatter_for_filename(fn, **options) + + Return a :class:`.Formatter` subclass instance that has a filename pattern + matching `fn`. The formatter is given the `options` at its instantiation. + + Will raise :exc:`pygments.util.ClassNotFound` if no formatter for that filename + is found. + +.. function:: load_formatter_from_file(filename, formattername="CustomFormatter", **options) + + Return a `Formatter` subclass instance loaded from the provided file, relative + to the current directory. The file is expected to contain a Formatter class + named ``formattername`` (by default, CustomFormatter). Users should be very + careful with the input, because this method is equivalent to running eval + on the input file. The formatter is given the `options` at its instantiation. + + :exc:`ClassNotFound` is raised if there are any errors loading the Formatter + + .. versionadded:: 2.2 + +.. module:: pygments.styles + +Functions from :mod:`pygments.styles`: + +.. function:: get_style_by_name(name) + + Return a style class by its short name. The names of the builtin styles + are listed in :data:`pygments.styles.STYLE_MAP`. + + Will raise :exc:`pygments.util.ClassNotFound` if no style of that name is + found. + +.. function:: get_all_styles() + + Return an iterable over all registered styles, yielding their names. + + .. versionadded:: 0.6 + + +.. module:: pygments.lexer + +Lexers +====== + +The base lexer class from which all lexers are derived is: + +.. class:: Lexer(**options) + + The constructor takes a \*\*keywords dictionary of options. + Every subclass must first process its own options and then call + the `Lexer` constructor, since it processes the `stripnl`, + `stripall` and `tabsize` options. + + An example looks like this: + + .. sourcecode:: python + + def __init__(self, **options): + self.compress = options.get('compress', '') + Lexer.__init__(self, **options) + + As these options must all be specifiable as strings (due to the + command line usage), there are various utility functions + available to help with that, see `Option processing`_. + + .. method:: get_tokens(text) + + This method is the basic interface of a lexer. It is called by + the `highlight()` function. It must process the text and return an + iterable of ``(tokentype, value)`` pairs from `text`. + + Normally, you don't need to override this method. The default + implementation processes the `stripnl`, `stripall` and `tabsize` + options and then yields all tokens from `get_tokens_unprocessed()`, + with the ``index`` dropped. + + .. method:: get_tokens_unprocessed(text) + + This method should process the text and return an iterable of + ``(index, tokentype, value)`` tuples where ``index`` is the starting + position of the token within the input text. + + This method must be overridden by subclasses. + + .. staticmethod:: analyse_text(text) + + A static method which is called for lexer guessing. It should analyse + the text and return a float in the range from ``0.0`` to ``1.0``. + If it returns ``0.0``, the lexer will not be selected as the most + probable one, if it returns ``1.0``, it will be selected immediately. + + .. note:: You don't have to add ``@staticmethod`` to the definition of + this method, this will be taken care of by the Lexer's metaclass. + + For a list of known tokens have a look at the :doc:`tokens` page. + + A lexer also can have the following attributes (in fact, they are mandatory + except `alias_filenames`) that are used by the builtin lookup mechanism. + + .. attribute:: name + + Full name for the lexer, in human-readable form. + + .. attribute:: aliases + + A list of short, unique identifiers that can be used to lookup + the lexer from a list, e.g. using `get_lexer_by_name()`. + + .. attribute:: filenames + + A list of `fnmatch` patterns that match filenames which contain + content for this lexer. The patterns in this list should be unique among + all lexers. + + .. attribute:: alias_filenames + + A list of `fnmatch` patterns that match filenames which may or may not + contain content for this lexer. This list is used by the + :func:`.guess_lexer_for_filename()` function, to determine which lexers + are then included in guessing the correct one. That means that + e.g. every lexer for HTML and a template language should include + ``\*.html`` in this list. + + .. attribute:: mimetypes + + A list of MIME types for content that can be lexed with this + lexer. + + +.. module:: pygments.formatter + +Formatters +========== + +A formatter is derived from this class: + + +.. class:: Formatter(**options) + + As with lexers, this constructor processes options and then must call the + base class :meth:`__init__`. + + The :class:`Formatter` class recognizes the options `style`, `full` and + `title`. It is up to the formatter class whether it uses them. + + .. method:: get_style_defs(arg='') + + This method must return statements or declarations suitable to define + the current style for subsequent highlighted text (e.g. CSS classes + in the `HTMLFormatter`). + + The optional argument `arg` can be used to modify the generation and + is formatter dependent (it is standardized because it can be given on + the command line). + + This method is called by the ``-S`` :doc:`command-line option `, + the `arg` is then given by the ``-a`` option. + + .. method:: format(tokensource, outfile) + + This method must format the tokens from the `tokensource` iterable and + write the formatted version to the file object `outfile`. + + Formatter options can control how exactly the tokens are converted. + + .. versionadded:: 0.7 + A formatter must have the following attributes that are used by the + builtin lookup mechanism. + + .. attribute:: name + + Full name for the formatter, in human-readable form. + + .. attribute:: aliases + + A list of short, unique identifiers that can be used to lookup + the formatter from a list, e.g. using :func:`.get_formatter_by_name()`. + + .. attribute:: filenames + + A list of :mod:`fnmatch` patterns that match filenames for which this + formatter can produce output. The patterns in this list should be unique + among all formatters. + + +.. module:: pygments.util + +Option processing +================= + +The :mod:`pygments.util` module has some utility functions usable for option +processing: + +.. exception:: OptionError + + This exception will be raised by all option processing functions if + the type or value of the argument is not correct. + +.. function:: get_bool_opt(options, optname, default=None) + + Interpret the key `optname` from the dictionary `options` as a boolean and + return it. Return `default` if `optname` is not in `options`. + + The valid string values for ``True`` are ``1``, ``yes``, ``true`` and + ``on``, the ones for ``False`` are ``0``, ``no``, ``false`` and ``off`` + (matched case-insensitively). + +.. function:: get_int_opt(options, optname, default=None) + + As :func:`get_bool_opt`, but interpret the value as an integer. + +.. function:: get_list_opt(options, optname, default=None) + + If the key `optname` from the dictionary `options` is a string, + split it at whitespace and return it. If it is already a list + or a tuple, it is returned as a list. + +.. function:: get_choice_opt(options, optname, allowed, default=None) + + If the key `optname` from the dictionary is not in the sequence + `allowed`, raise an error, otherwise return it. + + .. versionadded:: 0.8 diff --git a/doc/_build/html/_sources/docs/authors.rst.txt b/doc/_build/html/_sources/docs/authors.rst.txt new file mode 100644 index 0000000..f8373f0 --- /dev/null +++ b/doc/_build/html/_sources/docs/authors.rst.txt @@ -0,0 +1,4 @@ +Full contributor list +===================== + +.. include:: ../../AUTHORS diff --git a/doc/_build/html/_sources/docs/changelog.rst.txt b/doc/_build/html/_sources/docs/changelog.rst.txt new file mode 100644 index 0000000..f264cab --- /dev/null +++ b/doc/_build/html/_sources/docs/changelog.rst.txt @@ -0,0 +1 @@ +.. include:: ../../CHANGES diff --git a/doc/_build/html/_sources/docs/cmdline.rst.txt b/doc/_build/html/_sources/docs/cmdline.rst.txt new file mode 100644 index 0000000..e4f94ea --- /dev/null +++ b/doc/_build/html/_sources/docs/cmdline.rst.txt @@ -0,0 +1,166 @@ +.. -*- mode: rst -*- + +====================== +Command Line Interface +====================== + +You can use Pygments from the shell, provided you installed the +:program:`pygmentize` script:: + + $ pygmentize test.py + print "Hello World" + +will print the file test.py to standard output, using the Python lexer +(inferred from the file name extension) and the terminal formatter (because +you didn't give an explicit formatter name). + +If you want HTML output:: + + $ pygmentize -f html -l python -o test.html test.py + +As you can see, the -l option explicitly selects a lexer. As seen above, if you +give an input file name and it has an extension that Pygments recognizes, you can +omit this option. + +The ``-o`` option gives an output file name. If it is not given, output is +written to stdout. + +The ``-f`` option selects a formatter (as with ``-l``, it can also be omitted +if an output file name is given and has a supported extension). +If no output file name is given and ``-f`` is omitted, the +:class:`.TerminalFormatter` is used. + +The above command could therefore also be given as:: + + $ pygmentize -o test.html test.py + +To create a full HTML document, including line numbers and stylesheet (using the +"emacs" style), highlighting the Python file ``test.py`` to ``test.html``:: + + $ pygmentize -O full,style=emacs -o test.html test.py + + +Options and filters +------------------- + +Lexer and formatter options can be given using the ``-O`` option:: + + $ pygmentize -f html -O style=colorful,linenos=1 -l python test.py + +Be sure to enclose the option string in quotes if it contains any special shell +characters, such as spaces or expansion wildcards like ``*``. If an option +expects a list value, separate the list entries with spaces (you'll have to +quote the option value in this case too, so that the shell doesn't split it). + +Since the ``-O`` option argument is split at commas and expects the split values +to be of the form ``name=value``, you can't give an option value that contains +commas or equals signs. Therefore, an option ``-P`` is provided (as of Pygments +0.9) that works like ``-O`` but can only pass one option per ``-P``. Its value +can then contain all characters:: + + $ pygmentize -P "heading=Pygments, the Python highlighter" ... + +Filters are added to the token stream using the ``-F`` option:: + + $ pygmentize -f html -l pascal -F keywordcase:case=upper main.pas + +As you see, options for the filter are given after a colon. As for ``-O``, the +filter name and options must be one shell word, so there may not be any spaces +around the colon. + + +Generating styles +----------------- + +Formatters normally don't output full style information. For example, the HTML +formatter by default only outputs ```` tags with ``class`` attributes. +Therefore, there's a special ``-S`` option for generating style definitions. +Usage is as follows:: + + $ pygmentize -f html -S colorful -a .syntax + +generates a CSS style sheet (because you selected the HTML formatter) for +the "colorful" style prepending a ".syntax" selector to all style rules. + +For an explanation what ``-a`` means for :doc:`a particular formatter +`, look for the `arg` argument for the formatter's +:meth:`.get_style_defs()` method. + + +Getting lexer names +------------------- + +.. versionadded:: 1.0 + +The ``-N`` option guesses a lexer name for a given filename, so that :: + + $ pygmentize -N setup.py + +will print out ``python``. It won't highlight anything yet. If no specific +lexer is known for that filename, ``text`` is printed. + +Custom Lexers and Formatters +---------------------------- + +.. versionadded:: 2.2 + +The ``-x`` flag enables custom lexers and formatters to be loaded +from files relative to the current directory. Create a file with a class named +CustomLexer or CustomFormatter, then specify it on the command line:: + + $ pygmentize -l your_lexer.py -f your_formatter.py -x + +You can also specify the name of your class with a colon:: + + $ pygmentize -l your_lexer.py:SomeLexer -x + +For more information, see :doc:`the Pygments documentation on Lexer development +`. + +Getting help +------------ + +The ``-L`` option lists lexers, formatters, along with their short +names and supported file name extensions, styles and filters. If you want to see +only one category, give it as an argument:: + + $ pygmentize -L filters + +will list only all installed filters. + +The ``-H`` option will give you detailed information (the same that can be found +in this documentation) about a lexer, formatter or filter. Usage is as follows:: + + $ pygmentize -H formatter html + +will print the help for the HTML formatter, while :: + + $ pygmentize -H lexer python + +will print the help for the Python lexer, etc. + + +A note on encodings +------------------- + +.. versionadded:: 0.9 + +Pygments tries to be smart regarding encodings in the formatting process: + +* If you give an ``encoding`` option, it will be used as the input and + output encoding. + +* If you give an ``outencoding`` option, it will override ``encoding`` + as the output encoding. + +* If you give an ``inencoding`` option, it will override ``encoding`` + as the input encoding. + +* If you don't give an encoding and have given an output file, the default + encoding for lexer and formatter is the terminal encoding or the default + locale encoding of the system. As a last resort, ``latin1`` is used (which + will pass through all non-ASCII characters). + +* If you don't give an encoding and haven't given an output file (that means + output is written to the console), the default encoding for lexer and + formatter is the terminal encoding (``sys.stdout.encoding``). diff --git a/doc/_build/html/_sources/docs/filterdevelopment.rst.txt b/doc/_build/html/_sources/docs/filterdevelopment.rst.txt new file mode 100644 index 0000000..fbcd0a0 --- /dev/null +++ b/doc/_build/html/_sources/docs/filterdevelopment.rst.txt @@ -0,0 +1,71 @@ +.. -*- mode: rst -*- + +===================== +Write your own filter +===================== + +.. versionadded:: 0.7 + +Writing own filters is very easy. All you have to do is to subclass +the `Filter` class and override the `filter` method. Additionally a +filter is instantiated with some keyword arguments you can use to +adjust the behavior of your filter. + + +Subclassing Filters +=================== + +As an example, we write a filter that converts all `Name.Function` tokens +to normal `Name` tokens to make the output less colorful. + +.. sourcecode:: python + + from pygments.util import get_bool_opt + from pygments.token import Name + from pygments.filter import Filter + + class UncolorFilter(Filter): + + def __init__(self, **options): + Filter.__init__(self, **options) + self.class_too = get_bool_opt(options, 'classtoo') + + def filter(self, lexer, stream): + for ttype, value in stream: + if ttype is Name.Function or (self.class_too and + ttype is Name.Class): + ttype = Name + yield ttype, value + +Some notes on the `lexer` argument: that can be quite confusing since it doesn't +need to be a lexer instance. If a filter was added by using the `add_filter()` +function of lexers, that lexer is registered for the filter. In that case +`lexer` will refer to the lexer that has registered the filter. It *can* be used +to access options passed to a lexer. Because it could be `None` you always have +to check for that case if you access it. + + +Using a decorator +================= + +You can also use the `simplefilter` decorator from the `pygments.filter` module: + +.. sourcecode:: python + + from pygments.util import get_bool_opt + from pygments.token import Name + from pygments.filter import simplefilter + + + @simplefilter + def uncolor(self, lexer, stream, options): + class_too = get_bool_opt(options, 'classtoo') + for ttype, value in stream: + if ttype is Name.Function or (class_too and + ttype is Name.Class): + ttype = Name + yield ttype, value + +The decorator automatically subclasses an internal filter class and uses the +decorated function as a method for filtering. (That's why there is a `self` +argument that you probably won't end up using in the method.) diff --git a/doc/_build/html/_sources/docs/filters.rst.txt b/doc/_build/html/_sources/docs/filters.rst.txt new file mode 100644 index 0000000..ff2519a --- /dev/null +++ b/doc/_build/html/_sources/docs/filters.rst.txt @@ -0,0 +1,41 @@ +.. -*- mode: rst -*- + +======= +Filters +======= + +.. versionadded:: 0.7 + +You can filter token streams coming from lexers to improve or annotate the +output. For example, you can highlight special words in comments, convert +keywords to upper or lowercase to enforce a style guide etc. + +To apply a filter, you can use the `add_filter()` method of a lexer: + +.. sourcecode:: pycon + + >>> from pygments.lexers import PythonLexer + >>> l = PythonLexer() + >>> # add a filter given by a string and options + >>> l.add_filter('codetagify', case='lower') + >>> l.filters + [] + >>> from pygments.filters import KeywordCaseFilter + >>> # or give an instance + >>> l.add_filter(KeywordCaseFilter(case='lower')) + +The `add_filter()` method takes keyword arguments which are forwarded to +the constructor of the filter. + +To get a list of all registered filters by name, you can use the +`get_all_filters()` function from the `pygments.filters` module that returns an +iterable for all known filters. + +If you want to write your own filter, have a look at :doc:`Write your own filter +`. + + +Builtin Filters +=============== + +.. pygmentsdoc:: filters diff --git a/doc/_build/html/_sources/docs/formatterdevelopment.rst.txt b/doc/_build/html/_sources/docs/formatterdevelopment.rst.txt new file mode 100644 index 0000000..2bfac05 --- /dev/null +++ b/doc/_build/html/_sources/docs/formatterdevelopment.rst.txt @@ -0,0 +1,169 @@ +.. -*- mode: rst -*- + +======================== +Write your own formatter +======================== + +As well as creating :doc:`your own lexer `, writing a new +formatter for Pygments is easy and straightforward. + +A formatter is a class that is initialized with some keyword arguments (the +formatter options) and that must provides a `format()` method. +Additionally a formatter should provide a `get_style_defs()` method that +returns the style definitions from the style in a form usable for the +formatter's output format. + + +Quickstart +========== + +The most basic formatter shipped with Pygments is the `NullFormatter`. It just +sends the value of a token to the output stream: + +.. sourcecode:: python + + from pygments.formatter import Formatter + + class NullFormatter(Formatter): + def format(self, tokensource, outfile): + for ttype, value in tokensource: + outfile.write(value) + +As you can see, the `format()` method is passed two parameters: `tokensource` +and `outfile`. The first is an iterable of ``(token_type, value)`` tuples, +the latter a file like object with a `write()` method. + +Because the formatter is that basic it doesn't overwrite the `get_style_defs()` +method. + + +Styles +====== + +Styles aren't instantiated but their metaclass provides some class functions +so that you can access the style definitions easily. + +Styles are iterable and yield tuples in the form ``(ttype, d)`` where `ttype` +is a token and `d` is a dict with the following keys: + +``'color'`` + Hexadecimal color value (eg: ``'ff0000'`` for red) or `None` if not + defined. + +``'bold'`` + `True` if the value should be bold + +``'italic'`` + `True` if the value should be italic + +``'underline'`` + `True` if the value should be underlined + +``'bgcolor'`` + Hexadecimal color value for the background (eg: ``'eeeeeee'`` for light + gray) or `None` if not defined. + +``'border'`` + Hexadecimal color value for the border (eg: ``'0000aa'`` for a dark + blue) or `None` for no border. + +Additional keys might appear in the future, formatters should ignore all keys +they don't support. + + +HTML 3.2 Formatter +================== + +For an more complex example, let's implement a HTML 3.2 Formatter. We don't +use CSS but inline markup (````, ````, etc). Because this isn't good +style this formatter isn't in the standard library ;-) + +.. sourcecode:: python + + from pygments.formatter import Formatter + + class OldHtmlFormatter(Formatter): + + def __init__(self, **options): + Formatter.__init__(self, **options) + + # create a dict of (start, end) tuples that wrap the + # value of a token so that we can use it in the format + # method later + self.styles = {} + + # we iterate over the `_styles` attribute of a style item + # that contains the parsed style values. + for token, style in self.style: + start = end = '' + # a style item is a tuple in the following form: + # colors are readily specified in hex: 'RRGGBB' + if style['color']: + start += '' % style['color'] + end = '' + end + if style['bold']: + start += '' + end = '' + end + if style['italic']: + start += '' + end = '' + end + if style['underline']: + start += '' + end = '' + end + self.styles[token] = (start, end) + + def format(self, tokensource, outfile): + # lastval is a string we use for caching + # because it's possible that an lexer yields a number + # of consecutive tokens with the same token type. + # to minimize the size of the generated html markup we + # try to join the values of same-type tokens here + lastval = '' + lasttype = None + + # wrap the whole output with
+            outfile.write('
')
+
+            for ttype, value in tokensource:
+                # if the token type doesn't exist in the stylemap
+                # we try it with the parent of the token type
+                # eg: parent of Token.Literal.String.Double is
+                # Token.Literal.String
+                while ttype not in self.styles:
+                    ttype = ttype.parent
+                if ttype == lasttype:
+                    # the current token type is the same of the last
+                    # iteration. cache it
+                    lastval += value
+                else:
+                    # not the same token as last iteration, but we
+                    # have some data in the buffer. wrap it with the
+                    # defined style and write it to the output file
+                    if lastval:
+                        stylebegin, styleend = self.styles[lasttype]
+                        outfile.write(stylebegin + lastval + styleend)
+                    # set lastval/lasttype to current values
+                    lastval = value
+                    lasttype = ttype
+
+            # if something is left in the buffer, write it to the
+            # output file, then close the opened 
 tag
+            if lastval:
+                stylebegin, styleend = self.styles[lasttype]
+                outfile.write(stylebegin + lastval + styleend)
+            outfile.write('
\n') + +The comments should explain it. Again, this formatter doesn't override the +`get_style_defs()` method. If we would have used CSS classes instead of +inline HTML markup, we would need to generate the CSS first. For that +purpose the `get_style_defs()` method exists: + + +Generating Style Definitions +============================ + +Some formatters like the `LatexFormatter` and the `HtmlFormatter` don't +output inline markup but reference either macros or css classes. Because +the definitions of those are not part of the output, the `get_style_defs()` +method exists. It is passed one parameter (if it's used and how it's used +is up to the formatter) and has to return a string or ``None``. diff --git a/doc/_build/html/_sources/docs/formatters.rst.txt b/doc/_build/html/_sources/docs/formatters.rst.txt new file mode 100644 index 0000000..9e7074e --- /dev/null +++ b/doc/_build/html/_sources/docs/formatters.rst.txt @@ -0,0 +1,48 @@ +.. -*- 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 diff --git a/doc/_build/html/_sources/docs/index.rst.txt b/doc/_build/html/_sources/docs/index.rst.txt new file mode 100644 index 0000000..30d5c08 --- /dev/null +++ b/doc/_build/html/_sources/docs/index.rst.txt @@ -0,0 +1,66 @@ +Pygments documentation +====================== + +**Starting with Pygments** + +.. toctree:: + :maxdepth: 1 + + ../download + quickstart + cmdline + +**Builtin components** + +.. toctree:: + :maxdepth: 1 + + lexers + filters + formatters + styles + +**Reference** + +.. toctree:: + :maxdepth: 1 + + unicode + tokens + api + +**Hacking for Pygments** + +.. toctree:: + :maxdepth: 1 + + lexerdevelopment + formatterdevelopment + filterdevelopment + plugins + +**Hints and tricks** + +.. toctree:: + :maxdepth: 1 + + rstdirective + moinmoin + java + integrate + +**About Pygments** + +.. toctree:: + :maxdepth: 1 + + changelog + authors + + +If you find bugs or have suggestions for the documentation, please look +:ref:`here ` for info on how to contact the team. + +.. XXX You can download an offline version of this documentation from the + :doc:`download page `. + diff --git a/doc/_build/html/_sources/docs/integrate.rst.txt b/doc/_build/html/_sources/docs/integrate.rst.txt new file mode 100644 index 0000000..77daaa4 --- /dev/null +++ b/doc/_build/html/_sources/docs/integrate.rst.txt @@ -0,0 +1,40 @@ +.. -*- mode: rst -*- + +=================================== +Using Pygments in various scenarios +=================================== + +Markdown +-------- + +Since Pygments 0.9, the distribution ships Markdown_ preprocessor sample code +that uses Pygments to render source code in +:file:`external/markdown-processor.py`. You can copy and adapt it to your +liking. + +.. _Markdown: http://www.freewisdom.org/projects/python-markdown/ + +TextMate +-------- + +Antonio Cangiano has created a Pygments bundle for TextMate that allows to +colorize code via a simple menu option. It can be found here_. + +.. _here: http://antoniocangiano.com/2008/10/28/pygments-textmate-bundle/ + +Bash completion +--------------- + +The source distribution contains a file ``external/pygments.bashcomp`` that +sets up completion for the ``pygmentize`` command in bash. + +Wrappers for other languages +---------------------------- + +These libraries provide Pygments highlighting for users of other languages +than Python: + +* `pygments.rb `_, a pygments wrapper for Ruby +* `Clygments `_, a pygments wrapper for + Clojure +* `PHPygments `_, a pygments wrapper for PHP diff --git a/doc/_build/html/_sources/docs/java.rst.txt b/doc/_build/html/_sources/docs/java.rst.txt new file mode 100644 index 0000000..f553463 --- /dev/null +++ b/doc/_build/html/_sources/docs/java.rst.txt @@ -0,0 +1,70 @@ +===================== +Use Pygments in Java +===================== + +Thanks to `Jython `_ it is possible to use Pygments in +Java. + +This page is a simple tutorial to get an idea of how this works. You can +then look at the `Jython documentation `_ for more +advanced uses. + +Since version 1.5, Pygments is deployed on `Maven Central +`_ as a JAR, as is Jython +which makes it a lot easier to create a Java project. + +Here is an example of a `Maven `_ ``pom.xml`` file for a +project running Pygments: + +.. sourcecode:: xml + + + + + 4.0.0 + example + example + 1.0-SNAPSHOT + + + org.python + jython-standalone + 2.5.3 + + + org.pygments + pygments + 1.5 + runtime + + + + +The following Java example: + +.. sourcecode:: java + + PythonInterpreter interpreter = new PythonInterpreter(); + + // Set a variable with the content you want to work with + interpreter.set("code", code); + + // Simple use Pygments as you would in Python + interpreter.exec("from pygments import highlight\n" + + "from pygments.lexers import PythonLexer\n" + + "from pygments.formatters import HtmlFormatter\n" + + "\nresult = highlight(code, PythonLexer(), HtmlFormatter())"); + + // Get the result that has been set in a variable + System.out.println(interpreter.get("result", String.class)); + +will print something like: + +.. sourcecode:: html + +
+
print "Hello World"
+
diff --git a/doc/_build/html/_sources/docs/lexerdevelopment.rst.txt b/doc/_build/html/_sources/docs/lexerdevelopment.rst.txt new file mode 100644 index 0000000..63bd01a --- /dev/null +++ b/doc/_build/html/_sources/docs/lexerdevelopment.rst.txt @@ -0,0 +1,728 @@ +.. -*- mode: rst -*- + +.. highlight:: python + +==================== +Write your own lexer +==================== + +If a lexer for your favorite language is missing in the Pygments package, you +can easily write your own and extend Pygments. + +All you need can be found inside the :mod:`pygments.lexer` module. As you can +read in the :doc:`API documentation `, a lexer is a class that is +initialized with some keyword arguments (the lexer options) and that provides a +:meth:`.get_tokens_unprocessed()` method which is given a string or unicode +object with the data to lex. + +The :meth:`.get_tokens_unprocessed()` method must return an iterator or iterable +containing tuples in the form ``(index, token, value)``. Normally you don't +need to do this since there are base lexers that do most of the work and that +you can subclass. + + +RegexLexer +========== + +The lexer base class used by almost all of Pygments' lexers is the +:class:`RegexLexer`. This class allows you to define lexing rules in terms of +*regular expressions* for different *states*. + +States are groups of regular expressions that are matched against the input +string at the *current position*. If one of these expressions matches, a +corresponding action is performed (such as yielding a token with a specific +type, or changing state), the current position is set to where the last match +ended and the matching process continues with the first regex of the current +state. + +Lexer states are kept on a stack: each time a new state is entered, the new +state is pushed onto the stack. The most basic lexers (like the `DiffLexer`) +just need one state. + +Each state is defined as a list of tuples in the form (`regex`, `action`, +`new_state`) where the last item is optional. In the most basic form, `action` +is a token type (like `Name.Builtin`). That means: When `regex` matches, emit a +token with the match text and type `tokentype` and push `new_state` on the state +stack. If the new state is ``'#pop'``, the topmost state is popped from the +stack instead. To pop more than one state, use ``'#pop:2'`` and so on. +``'#push'`` is a synonym for pushing the current state on the stack. + +The following example shows the `DiffLexer` from the builtin lexers. Note that +it contains some additional attributes `name`, `aliases` and `filenames` which +aren't required for a lexer. They are used by the builtin lexer lookup +functions. :: + + from pygments.lexer import RegexLexer + from pygments.token import * + + class DiffLexer(RegexLexer): + name = 'Diff' + aliases = ['diff'] + filenames = ['*.diff'] + + tokens = { + 'root': [ + (r' .*\n', Text), + (r'\+.*\n', Generic.Inserted), + (r'-.*\n', Generic.Deleted), + (r'@.*\n', Generic.Subheading), + (r'Index.*\n', Generic.Heading), + (r'=.*\n', Generic.Heading), + (r'.*\n', Text), + ] + } + +As you can see this lexer only uses one state. When the lexer starts scanning +the text, it first checks if the current character is a space. If this is true +it scans everything until newline and returns the data as a `Text` token (which +is the "no special highlighting" token). + +If this rule doesn't match, it checks if the current char is a plus sign. And +so on. + +If no rule matches at the current position, the current char is emitted as an +`Error` token that indicates a lexing error, and the position is increased by +one. + + +Adding and testing a new lexer +============================== + +The easiest way to use a new lexer is to use Pygments' support for loading +the lexer from a file relative to your current directory. + +First, change the name of your lexer class to CustomLexer: + +.. code-block:: python + + from pygments.lexer import RegexLexer + from pygments.token import * + + class CustomLexer(RegexLexer): + """All your lexer code goes here!""" + +Then you can load the lexer from the command line with the additional +flag ``-x``: + +.. code-block:: console + + $ pygmentize -l your_lexer_file.py -x + +To specify a class name other than CustomLexer, append it with a colon: + +.. code-block:: console + + $ pygmentize -l your_lexer.py:SomeLexer -x + +Or, using the Python API: + +.. code-block:: python + + # For a lexer named CustomLexer + your_lexer = load_lexer_from_file(filename, **options) + + # For a lexer named MyNewLexer + your_named_lexer = load_lexer_from_file(filename, "MyNewLexer", **options) + +When loading custom lexers and formatters, be extremely careful to use only +trusted files; Pygments will perform the equivalent of ``eval`` on them. + +If you only want to use your lexer with the Pygments API, you can import and +instantiate the lexer yourself, then pass it to :func:`pygments.highlight`. + +To prepare your new lexer for inclusion in the Pygments distribution, so that it +will be found when passing filenames or lexer aliases from the command line, you +have to perform the following steps. + +First, change to the current directory containing the Pygments source code. You +will need to have either an unpacked source tarball, or (preferably) a copy +cloned from BitBucket. + +.. code-block:: console + + $ cd .../pygments-main + +Select a matching module under ``pygments/lexers``, or create a new module for +your lexer class. + +Next, make sure the lexer is known from outside of the module. All modules in +the ``pygments.lexers`` package specify ``__all__``. For example, +``esoteric.py`` sets:: + + __all__ = ['BrainfuckLexer', 'BefungeLexer', ...] + +Add the name of your lexer class to this list (or create the list if your lexer +is the only class in the module). + +Finally the lexer can be made publicly known by rebuilding the lexer mapping: + +.. code-block:: console + + $ make mapfiles + +To test the new lexer, store an example file with the proper extension in +``tests/examplefiles``. For example, to test your ``DiffLexer``, add a +``tests/examplefiles/example.diff`` containing a sample diff output. + +Now you can use pygmentize to render your example to HTML: + +.. code-block:: console + + $ ./pygmentize -O full -f html -o /tmp/example.html tests/examplefiles/example.diff + +Note that this explicitly calls the ``pygmentize`` in the current directory +by preceding it with ``./``. This ensures your modifications are used. +Otherwise a possibly already installed, unmodified version without your new +lexer would have been called from the system search path (``$PATH``). + +To view the result, open ``/tmp/example.html`` in your browser. + +Once the example renders as expected, you should run the complete test suite: + +.. code-block:: console + + $ make test + +It also tests that your lexer fulfills the lexer API and certain invariants, +such as that the concatenation of all token text is the same as the input text. + + +Regex Flags +=========== + +You can either define regex flags locally in the regex (``r'(?x)foo bar'``) or +globally by adding a `flags` attribute to your lexer class. If no attribute is +defined, it defaults to `re.MULTILINE`. For more information about regular +expression flags see the page about `regular expressions`_ in the Python +documentation. + +.. _regular expressions: http://docs.python.org/library/re.html#regular-expression-syntax + + +Scanning multiple tokens at once +================================ + +So far, the `action` element in the rule tuple of regex, action and state has +been a single token type. Now we look at the first of several other possible +values. + +Here is a more complex lexer that highlights INI files. INI files consist of +sections, comments and ``key = value`` pairs:: + + from pygments.lexer import RegexLexer, bygroups + from pygments.token import * + + class IniLexer(RegexLexer): + name = 'INI' + aliases = ['ini', 'cfg'] + filenames = ['*.ini', '*.cfg'] + + tokens = { + 'root': [ + (r'\s+', Text), + (r';.*?$', Comment), + (r'\[.*?\]$', Keyword), + (r'(.*?)(\s*)(=)(\s*)(.*?)$', + bygroups(Name.Attribute, Text, Operator, Text, String)) + ] + } + +The lexer first looks for whitespace, comments and section names. Later it +looks for a line that looks like a key, value pair, separated by an ``'='`` +sign, and optional whitespace. + +The `bygroups` helper yields each capturing group in the regex with a different +token type. First the `Name.Attribute` token, then a `Text` token for the +optional whitespace, after that a `Operator` token for the equals sign. Then a +`Text` token for the whitespace again. The rest of the line is returned as +`String`. + +Note that for this to work, every part of the match must be inside a capturing +group (a ``(...)``), and there must not be any nested capturing groups. If you +nevertheless need a group, use a non-capturing group defined using this syntax: +``(?:some|words|here)`` (note the ``?:`` after the beginning parenthesis). + +If you find yourself needing a capturing group inside the regex which shouldn't +be part of the output but is used in the regular expressions for backreferencing +(eg: ``r'(<(foo|bar)>)(.*?)()'``), you can pass `None` to the bygroups +function and that group will be skipped in the output. + + +Changing states +=============== + +Many lexers need multiple states to work as expected. For example, some +languages allow multiline comments to be nested. Since this is a recursive +pattern it's impossible to lex just using regular expressions. + +Here is a lexer that recognizes C++ style comments (multi-line with ``/* */`` +and single-line with ``//`` until end of line):: + + from pygments.lexer import RegexLexer + from pygments.token import * + + class CppCommentLexer(RegexLexer): + name = 'Example Lexer with states' + + tokens = { + 'root': [ + (r'[^/]+', Text), + (r'/\*', Comment.Multiline, 'comment'), + (r'//.*?$', Comment.Singleline), + (r'/', Text) + ], + 'comment': [ + (r'[^*/]', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline) + ] + } + +This lexer starts lexing in the ``'root'`` state. It tries to match as much as +possible until it finds a slash (``'/'``). If the next character after the slash +is an asterisk (``'*'``) the `RegexLexer` sends those two characters to the +output stream marked as `Comment.Multiline` and continues lexing with the rules +defined in the ``'comment'`` state. + +If there wasn't an asterisk after the slash, the `RegexLexer` checks if it's a +Singleline comment (i.e. followed by a second slash). If this also wasn't the +case it must be a single slash, which is not a comment starter (the separate +regex for a single slash must also be given, else the slash would be marked as +an error token). + +Inside the ``'comment'`` state, we do the same thing again. Scan until the +lexer finds a star or slash. If it's the opening of a multiline comment, push +the ``'comment'`` state on the stack and continue scanning, again in the +``'comment'`` state. Else, check if it's the end of the multiline comment. If +yes, pop one state from the stack. + +Note: If you pop from an empty stack you'll get an `IndexError`. (There is an +easy way to prevent this from happening: don't ``'#pop'`` in the root state). + +If the `RegexLexer` encounters a newline that is flagged as an error token, the +stack is emptied and the lexer continues scanning in the ``'root'`` state. This +can help producing error-tolerant highlighting for erroneous input, e.g. when a +single-line string is not closed. + + +Advanced state tricks +===================== + +There are a few more things you can do with states: + +- You can push multiple states onto the stack if you give a tuple instead of a + simple string as the third item in a rule tuple. For example, if you want to + match a comment containing a directive, something like: + + .. code-block:: text + + /* rest of comment */ + + you can use this rule:: + + tokens = { + 'root': [ + (r'/\* <', Comment, ('comment', 'directive')), + ... + ], + 'directive': [ + (r'[^>]*', Comment.Directive), + (r'>', Comment, '#pop'), + ], + 'comment': [ + (r'[^*]+', Comment), + (r'\*/', Comment, '#pop'), + (r'\*', Comment), + ] + } + + When this encounters the above sample, first ``'comment'`` and ``'directive'`` + are pushed onto the stack, then the lexer continues in the directive state + until it finds the closing ``>``, then it continues in the comment state until + the closing ``*/``. Then, both states are popped from the stack again and + lexing continues in the root state. + + .. versionadded:: 0.9 + The tuple can contain the special ``'#push'`` and ``'#pop'`` (but not + ``'#pop:n'``) directives. + + +- You can include the rules of a state in the definition of another. This is + done by using `include` from `pygments.lexer`:: + + from pygments.lexer import RegexLexer, bygroups, include + from pygments.token import * + + class ExampleLexer(RegexLexer): + tokens = { + 'comments': [ + (r'/\*.*?\*/', Comment), + (r'//.*?\n', Comment), + ], + 'root': [ + include('comments'), + (r'(function )(\w+)( {)', + bygroups(Keyword, Name, Keyword), 'function'), + (r'.', Text), + ], + 'function': [ + (r'[^}/]+', Text), + include('comments'), + (r'/', Text), + (r'\}', Keyword, '#pop'), + ] + } + + This is a hypothetical lexer for a language that consist of functions and + comments. Because comments can occur at toplevel and in functions, we need + rules for comments in both states. As you can see, the `include` helper saves + repeating rules that occur more than once (in this example, the state + ``'comment'`` will never be entered by the lexer, as it's only there to be + included in ``'root'`` and ``'function'``). + +- Sometimes, you may want to "combine" a state from existing ones. This is + possible with the `combined` helper from `pygments.lexer`. + + If you, instead of a new state, write ``combined('state1', 'state2')`` as the + third item of a rule tuple, a new anonymous state will be formed from state1 + and state2 and if the rule matches, the lexer will enter this state. + + This is not used very often, but can be helpful in some cases, such as the + `PythonLexer`'s string literal processing. + +- If you want your lexer to start lexing in a different state you can modify the + stack by overriding the `get_tokens_unprocessed()` method:: + + from pygments.lexer import RegexLexer + + class ExampleLexer(RegexLexer): + tokens = {...} + + def get_tokens_unprocessed(self, text, stack=('root', 'otherstate')): + for item in RegexLexer.get_tokens_unprocessed(self, text, stack): + yield item + + Some lexers like the `PhpLexer` use this to make the leading ``', Name.Tag), + ], + 'script-content': [ + (r'(.+?)(<\s*/\s*script\s*>)', + bygroups(using(JavascriptLexer), Name.Tag), + '#pop'), + ] + } + +Here the content of a ```` end tag is processed by the `JavascriptLexer`, +while the end tag is yielded as a normal token with the `Name.Tag` type. + +Also note the ``(r'<\s*script\s*', Name.Tag, ('script-content', 'tag'))`` rule. +Here, two states are pushed onto the state stack, ``'script-content'`` and +``'tag'``. That means that first ``'tag'`` is processed, which will lex +attributes and the closing ``>``, then the ``'tag'`` state is popped and the +next state on top of the stack will be ``'script-content'``. + +Since you cannot refer to the class currently being defined, use `this` +(imported from `pygments.lexer`) to refer to the current lexer class, i.e. +``using(this)``. This construct may seem unnecessary, but this is often the +most obvious way of lexing arbitrary syntax between fixed delimiters without +introducing deeply nested states. + +The `using()` helper has a special keyword argument, `state`, which works as +follows: if given, the lexer to use initially is not in the ``"root"`` state, +but in the state given by this argument. This does not work with advanced +`RegexLexer` subclasses such as `ExtendedRegexLexer` (see below). + +Any other keywords arguments passed to `using()` are added to the keyword +arguments used to create the lexer. + + +Delegating Lexer +================ + +Another approach for nested lexers is the `DelegatingLexer` which is for example +used for the template engine lexers. It takes two lexers as arguments on +initialisation: a `root_lexer` and a `language_lexer`. + +The input is processed as follows: First, the whole text is lexed with the +`language_lexer`. All tokens yielded with the special type of ``Other`` are +then concatenated and given to the `root_lexer`. The language tokens of the +`language_lexer` are then inserted into the `root_lexer`'s token stream at the +appropriate positions. :: + + from pygments.lexer import DelegatingLexer + from pygments.lexers.web import HtmlLexer, PhpLexer + + class HtmlPhpLexer(DelegatingLexer): + def __init__(self, **options): + super(HtmlPhpLexer, self).__init__(HtmlLexer, PhpLexer, **options) + +This procedure ensures that e.g. HTML with template tags in it is highlighted +correctly even if the template tags are put into HTML tags or attributes. + +If you want to change the needle token ``Other`` to something else, you can give +the lexer another token type as the third parameter:: + + DelegatingLexer.__init__(MyLexer, OtherLexer, Text, **options) + + +Callbacks +========= + +Sometimes the grammar of a language is so complex that a lexer would be unable +to process it just by using regular expressions and stacks. + +For this, the `RegexLexer` allows callbacks to be given in rule tuples, instead +of token types (`bygroups` and `using` are nothing else but preimplemented +callbacks). The callback must be a function taking two arguments: + +* the lexer itself +* the match object for the last matched rule + +The callback must then return an iterable of (or simply yield) ``(index, +tokentype, value)`` tuples, which are then just passed through by +`get_tokens_unprocessed()`. The ``index`` here is the position of the token in +the input string, ``tokentype`` is the normal token type (like `Name.Builtin`), +and ``value`` the associated part of the input string. + +You can see an example here:: + + from pygments.lexer import RegexLexer + from pygments.token import Generic + + class HypotheticLexer(RegexLexer): + + def headline_callback(lexer, match): + equal_signs = match.group(1) + text = match.group(2) + yield match.start(), Generic.Headline, equal_signs + text + equal_signs + + tokens = { + 'root': [ + (r'(=+)(.*?)(\1)', headline_callback) + ] + } + +If the regex for the `headline_callback` matches, the function is called with +the match object. Note that after the callback is done, processing continues +normally, that is, after the end of the previous match. The callback has no +possibility to influence the position. + +There are not really any simple examples for lexer callbacks, but you can see +them in action e.g. in the `SMLLexer` class in `ml.py`_. + +.. _ml.py: http://bitbucket.org/birkenfeld/pygments-main/src/tip/pygments/lexers/ml.py + + +The ExtendedRegexLexer class +============================ + +The `RegexLexer`, even with callbacks, unfortunately isn't powerful enough for +the funky syntax rules of languages such as Ruby. + +But fear not; even then you don't have to abandon the regular expression +approach: Pygments has a subclass of `RegexLexer`, the `ExtendedRegexLexer`. +All features known from RegexLexers are available here too, and the tokens are +specified in exactly the same way, *except* for one detail: + +The `get_tokens_unprocessed()` method holds its internal state data not as local +variables, but in an instance of the `pygments.lexer.LexerContext` class, and +that instance is passed to callbacks as a third argument. This means that you +can modify the lexer state in callbacks. + +The `LexerContext` class has the following members: + +* `text` -- the input text +* `pos` -- the current starting position that is used for matching regexes +* `stack` -- a list containing the state stack +* `end` -- the maximum position to which regexes are matched, this defaults to + the length of `text` + +Additionally, the `get_tokens_unprocessed()` method can be given a +`LexerContext` instead of a string and will then process this context instead of +creating a new one for the string argument. + +Note that because you can set the current position to anything in the callback, +it won't be automatically be set by the caller after the callback is finished. +For example, this is how the hypothetical lexer above would be written with the +`ExtendedRegexLexer`:: + + from pygments.lexer import ExtendedRegexLexer + from pygments.token import Generic + + class ExHypotheticLexer(ExtendedRegexLexer): + + def headline_callback(lexer, match, ctx): + equal_signs = match.group(1) + text = match.group(2) + yield match.start(), Generic.Headline, equal_signs + text + equal_signs + ctx.pos = match.end() + + tokens = { + 'root': [ + (r'(=+)(.*?)(\1)', headline_callback) + ] + } + +This might sound confusing (and it can really be). But it is needed, and for an +example look at the Ruby lexer in `ruby.py`_. + +.. _ruby.py: https://bitbucket.org/birkenfeld/pygments-main/src/tip/pygments/lexers/ruby.py + + +Handling Lists of Keywords +========================== + +For a relatively short list (hundreds) you can construct an optimized regular +expression directly using ``words()`` (longer lists, see next section). This +function handles a few things for you automatically, including escaping +metacharacters and Python's first-match rather than longest-match in +alternations. Feel free to put the lists themselves in +``pygments/lexers/_$lang_builtins.py`` (see examples there), and generated by +code if possible. + +An example of using ``words()`` is something like:: + + from pygments.lexer import RegexLexer, words, Name + + class MyLexer(RegexLexer): + + tokens = { + 'root': [ + (words(('else', 'elseif'), suffix=r'\b'), Name.Builtin), + (r'\w+', Name), + ], + } + +As you can see, you can add ``prefix`` and ``suffix`` parts to the constructed +regex. + + +Modifying Token Streams +======================= + +Some languages ship a lot of builtin functions (for example PHP). The total +amount of those functions differs from system to system because not everybody +has every extension installed. In the case of PHP there are over 3000 builtin +functions. That's an incredibly huge amount of functions, much more than you +want to put into a regular expression. + +But because only `Name` tokens can be function names this is solvable by +overriding the ``get_tokens_unprocessed()`` method. The following lexer +subclasses the `PythonLexer` so that it highlights some additional names as +pseudo keywords:: + + from pygments.lexers.python import PythonLexer + from pygments.token import Name, Keyword + + class MyPythonLexer(PythonLexer): + EXTRA_KEYWORDS = set(('foo', 'bar', 'foobar', 'barfoo', 'spam', 'eggs')) + + def get_tokens_unprocessed(self, text): + for index, token, value in PythonLexer.get_tokens_unprocessed(self, text): + if token is Name and value in self.EXTRA_KEYWORDS: + yield index, Keyword.Pseudo, value + else: + yield index, token, value + +The `PhpLexer` and `LuaLexer` use this method to resolve builtin functions. diff --git a/doc/_build/html/_sources/docs/lexers.rst.txt b/doc/_build/html/_sources/docs/lexers.rst.txt new file mode 100644 index 0000000..ef40f14 --- /dev/null +++ b/doc/_build/html/_sources/docs/lexers.rst.txt @@ -0,0 +1,69 @@ +.. -*- mode: rst -*- + +================ +Available lexers +================ + +This page lists all available builtin lexers and the options they take. + +Currently, **all lexers** support these options: + +`stripnl` + Strip leading and trailing newlines from the input (default: ``True``) + +`stripall` + Strip all leading and trailing whitespace from the input (default: + ``False``). + +`ensurenl` + Make sure that the input ends with a newline (default: ``True``). This + is required for some lexers that consume input linewise. + + .. versionadded:: 1.3 + +`tabsize` + If given and greater than 0, expand tabs in the input (default: ``0``). + +`encoding` + If given, must be an encoding name (such as ``"utf-8"``). This encoding + will be used to convert the input string to Unicode (if it is not already + a Unicode string). The default is ``"guess"``. + + If this option is set to ``"guess"``, a simple UTF-8 vs. Latin-1 + detection is used, if it is set to ``"chardet"``, the + `chardet library `_ is used to + guess the encoding of the input. + + .. versionadded:: 0.6 + + +The "Short Names" field lists the identifiers that can be used with the +`get_lexer_by_name()` function. + +These lexers are builtin and can be imported from `pygments.lexers`: + +.. pygmentsdoc:: lexers + + +Iterating over all lexers +------------------------- + +.. versionadded:: 0.6 + +To get all lexers (both the builtin and the plugin ones), you can +use the `get_all_lexers()` function from the `pygments.lexers` +module: + +.. sourcecode:: pycon + + >>> from pygments.lexers import get_all_lexers + >>> i = get_all_lexers() + >>> i.next() + ('Diff', ('diff',), ('*.diff', '*.patch'), ('text/x-diff', 'text/x-patch')) + >>> i.next() + ('Delphi', ('delphi', 'objectpascal', 'pas', 'pascal'), ('*.pas',), ('text/x-pascal',)) + >>> i.next() + ('XML+Ruby', ('xml+erb', 'xml+ruby'), (), ()) + +As you can see, the return value is an iterator which yields tuples +in the form ``(name, aliases, filetypes, mimetypes)``. diff --git a/doc/_build/html/_sources/docs/moinmoin.rst.txt b/doc/_build/html/_sources/docs/moinmoin.rst.txt new file mode 100644 index 0000000..8b2216b --- /dev/null +++ b/doc/_build/html/_sources/docs/moinmoin.rst.txt @@ -0,0 +1,39 @@ +.. -*- mode: rst -*- + +============================ +Using Pygments with MoinMoin +============================ + +From Pygments 0.7, the source distribution ships a `Moin`_ parser plugin that +can be used to get Pygments highlighting in Moin wiki pages. + +To use it, copy the file `external/moin-parser.py` from the Pygments +distribution to the `data/plugin/parser` subdirectory of your Moin instance. +Edit the options at the top of the file (currently ``ATTACHMENTS`` and +``INLINESTYLES``) and rename the file to the name that the parser directive +should have. For example, if you name the file ``code.py``, you can get a +highlighted Python code sample with this Wiki markup:: + + {{{ + #!code python + [...] + }}} + +where ``python`` is the Pygments name of the lexer to use. + +Additionally, if you set the ``ATTACHMENTS`` option to True, Pygments will also +be called for all attachments for whose filenames there is no other parser +registered. + +You are responsible for including CSS rules that will map the Pygments CSS +classes to colors. You can output a stylesheet file with `pygmentize`, put it +into the `htdocs` directory of your Moin instance and then include it in the +`stylesheets` configuration option in the Moin config, e.g.:: + + stylesheets = [('screen', '/htdocs/pygments.css')] + +If you do not want to do that and are willing to accept larger HTML output, you +can set the ``INLINESTYLES`` option to True. + + +.. _Moin: http://moinmoin.wikiwikiweb.de/ diff --git a/doc/_build/html/_sources/docs/plugins.rst.txt b/doc/_build/html/_sources/docs/plugins.rst.txt new file mode 100644 index 0000000..a6f8d7b --- /dev/null +++ b/doc/_build/html/_sources/docs/plugins.rst.txt @@ -0,0 +1,93 @@ +================ +Register Plugins +================ + +If you want to extend Pygments without hacking the sources, but want to +use the lexer/formatter/style/filter lookup functions (`lexers.get_lexer_by_name` +et al.), you can use `setuptools`_ entrypoints to add new lexers, formatters +or styles as if they were in the Pygments core. + +.. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools + +That means you can use your highlighter modules with the `pygmentize` script, +which relies on the mentioned functions. + + +Entrypoints +=========== + +Here is a list of setuptools entrypoints that Pygments understands: + +`pygments.lexers` + + This entrypoint is used for adding new lexers to the Pygments core. + The name of the entrypoint values doesn't really matter, Pygments extracts + required metadata from the class definition: + + .. sourcecode:: ini + + [pygments.lexers] + yourlexer = yourmodule:YourLexer + + Note that you have to define ``name``, ``aliases`` and ``filename`` + attributes so that you can use the highlighter from the command line: + + .. sourcecode:: python + + class YourLexer(...): + name = 'Name Of Your Lexer' + aliases = ['alias'] + filenames = ['*.ext'] + + +`pygments.formatters` + + You can use this entrypoint to add new formatters to Pygments. The + name of an entrypoint item is the name of the formatter. If you + prefix the name with a slash it's used as a filename pattern: + + .. sourcecode:: ini + + [pygments.formatters] + yourformatter = yourmodule:YourFormatter + /.ext = yourmodule:YourFormatter + + +`pygments.styles` + + To add a new style you can use this entrypoint. The name of the entrypoint + is the name of the style: + + .. sourcecode:: ini + + [pygments.styles] + yourstyle = yourmodule:YourStyle + + +`pygments.filters` + + Use this entrypoint to register a new filter. The name of the + entrypoint is the name of the filter: + + .. sourcecode:: ini + + [pygments.filters] + yourfilter = yourmodule:YourFilter + + +How To Use Entrypoints +====================== + +This documentation doesn't explain how to use those entrypoints because this is +covered in the `setuptools documentation`_. That page should cover everything +you need to write a plugin. + +.. _setuptools documentation: http://peak.telecommunity.com/DevCenter/setuptools + + +Extending The Core +================== + +If you have written a Pygments plugin that is open source, please inform us +about that. There is a high chance that we'll add it to the Pygments +distribution. diff --git a/doc/_build/html/_sources/docs/quickstart.rst.txt b/doc/_build/html/_sources/docs/quickstart.rst.txt new file mode 100644 index 0000000..3a823e7 --- /dev/null +++ b/doc/_build/html/_sources/docs/quickstart.rst.txt @@ -0,0 +1,205 @@ +.. -*- mode: rst -*- + +=========================== +Introduction and Quickstart +=========================== + + +Welcome to Pygments! This document explains the basic concepts and terms and +gives a few examples of how to use the library. + + +Architecture +============ + +There are four types of components that work together highlighting a piece of +code: + +* A **lexer** splits the source into tokens, fragments of the source that + have a token type that determines what the text represents semantically + (e.g., keyword, string, or comment). There is a lexer for every language + or markup format that Pygments supports. +* The token stream can be piped through **filters**, which usually modify + the token types or text fragments, e.g. uppercasing all keywords. +* A **formatter** then takes the token stream and writes it to an output + file, in a format such as HTML, LaTeX or RTF. +* While writing the output, a **style** determines how to highlight all the + different token types. It maps them to attributes like "red and bold". + + +Example +======= + +Here is a small example for highlighting Python code: + +.. sourcecode:: python + + from pygments import highlight + from pygments.lexers import PythonLexer + from pygments.formatters import HtmlFormatter + + code = 'print "Hello World"' + print(highlight(code, PythonLexer(), HtmlFormatter())) + +which prints something like this: + +.. sourcecode:: html + +
+
print "Hello World"
+
+ +As you can see, Pygments uses CSS classes (by default, but you can change that) +instead of inline styles in order to avoid outputting redundant style information over +and over. A CSS stylesheet that contains all CSS classes possibly used in the output +can be produced by: + +.. sourcecode:: python + + print(HtmlFormatter().get_style_defs('.highlight')) + +The argument to :func:`get_style_defs` is used as an additional CSS selector: +the output may look like this: + +.. sourcecode:: css + + .highlight .k { color: #AA22FF; font-weight: bold } + .highlight .s { color: #BB4444 } + ... + + +Options +======= + +The :func:`highlight()` function supports a fourth argument called *outfile*, it +must be a file object if given. The formatted output will then be written to +this file instead of being returned as a string. + +Lexers and formatters both support options. They are given to them as keyword +arguments either to the class or to the lookup method: + +.. sourcecode:: python + + from pygments import highlight + from pygments.lexers import get_lexer_by_name + from pygments.formatters import HtmlFormatter + + lexer = get_lexer_by_name("python", stripall=True) + formatter = HtmlFormatter(linenos=True, cssclass="source") + result = highlight(code, lexer, formatter) + +This makes the lexer strip all leading and trailing whitespace from the input +(`stripall` option), lets the formatter output line numbers (`linenos` option), +and sets the wrapping ``
``'s class to ``source`` (instead of +``highlight``). + +Important options include: + +`encoding` : for lexers and formatters + Since Pygments uses Unicode strings internally, this determines which + encoding will be used to convert to or from byte strings. +`style` : for formatters + The name of the style to use when writing the output. + + +For an overview of builtin lexers and formatters and their options, visit the +:doc:`lexer ` and :doc:`formatters ` lists. + +For a documentation on filters, see :doc:`this page `. + + +Lexer and formatter lookup +========================== + +If you want to lookup a built-in lexer by its alias or a filename, you can use +one of the following methods: + +.. sourcecode:: pycon + + >>> from pygments.lexers import (get_lexer_by_name, + ... get_lexer_for_filename, get_lexer_for_mimetype) + + >>> get_lexer_by_name('python') + + + >>> get_lexer_for_filename('spam.rb') + + + >>> get_lexer_for_mimetype('text/x-perl') + + +All these functions accept keyword arguments; they will be passed to the lexer +as options. + +A similar API is available for formatters: use :func:`.get_formatter_by_name()` +and :func:`.get_formatter_for_filename()` from the :mod:`pygments.formatters` +module for this purpose. + + +Guessing lexers +=============== + +If you don't know the content of the file, or you want to highlight a file +whose extension is ambiguous, such as ``.html`` (which could contain plain HTML +or some template tags), use these functions: + +.. sourcecode:: pycon + + >>> from pygments.lexers import guess_lexer, guess_lexer_for_filename + + >>> guess_lexer('#!/usr/bin/python\nprint "Hello World!"') + + + >>> guess_lexer_for_filename('test.py', 'print "Hello World!"') + + +:func:`.guess_lexer()` passes the given content to the lexer classes' +:meth:`analyse_text()` method and returns the one for which it returns the +highest number. + +All lexers have two different filename pattern lists: the primary and the +secondary one. The :func:`.get_lexer_for_filename()` function only uses the +primary list, whose entries are supposed to be unique among all lexers. +:func:`.guess_lexer_for_filename()`, however, will first loop through all lexers +and look at the primary and secondary filename patterns if the filename matches. +If only one lexer matches, it is returned, else the guessing mechanism of +:func:`.guess_lexer()` is used with the matching lexers. + +As usual, keyword arguments to these functions are given to the created lexer +as options. + + +Command line usage +================== + +You can use Pygments from the command line, using the :program:`pygmentize` +script:: + + $ pygmentize test.py + +will highlight the Python file test.py using ANSI escape sequences +(a.k.a. terminal colors) and print the result to standard output. + +To output HTML, use the ``-f`` option:: + + $ pygmentize -f html -o test.html test.py + +to write an HTML-highlighted version of test.py to the file test.html. +Note that it will only be a snippet of HTML, if you want a full HTML document, +use the "full" option:: + + $ pygmentize -f html -O full -o test.html test.py + +This will produce a full HTML document with included stylesheet. + +A style can be selected with ``-O style=``. + +If you need a stylesheet for an existing HTML file using Pygments CSS classes, +it can be created with:: + + $ pygmentize -S default -f html > style.css + +where ``default`` is the style name. + +More options and tricks and be found in the :doc:`command line reference +`. diff --git a/doc/_build/html/_sources/docs/rstdirective.rst.txt b/doc/_build/html/_sources/docs/rstdirective.rst.txt new file mode 100644 index 0000000..c0d503b --- /dev/null +++ b/doc/_build/html/_sources/docs/rstdirective.rst.txt @@ -0,0 +1,22 @@ +.. -*- mode: rst -*- + +================================ +Using Pygments in ReST documents +================================ + +Many Python people use `ReST`_ for documentation their sourcecode, programs, +scripts et cetera. This also means that documentation often includes sourcecode +samples or snippets. + +You can easily enable Pygments support for your ReST texts using a custom +directive -- this is also how this documentation displays source code. + +From Pygments 0.9, the directive is shipped in the distribution as +`external/rst-directive.py`. You can copy and adapt this code to your liking. + +.. removed -- too confusing + *Loosely related note:* The ReST lexer now recognizes ``.. sourcecode::`` and + ``.. code::`` directives and highlights the contents in the specified language + if the `handlecodeblocks` option is true. + +.. _ReST: http://docutils.sf.net/rst.html diff --git a/doc/_build/html/_sources/docs/styles.rst.txt b/doc/_build/html/_sources/docs/styles.rst.txt new file mode 100644 index 0000000..1094a27 --- /dev/null +++ b/doc/_build/html/_sources/docs/styles.rst.txt @@ -0,0 +1,201 @@ +.. -*- mode: rst -*- + +====== +Styles +====== + +Pygments comes with some builtin styles that work for both the HTML and +LaTeX formatter. + +The builtin styles can be looked up with the `get_style_by_name` function: + +.. sourcecode:: pycon + + >>> from pygments.styles import get_style_by_name + >>> get_style_by_name('colorful') + + +You can pass a instance of a `Style` class to a formatter as the `style` +option in form of a string: + +.. sourcecode:: pycon + + >>> from pygments.styles import get_style_by_name + >>> from pygments.formatters import HtmlFormatter + >>> HtmlFormatter(style='colorful').style + + +Or you can also import your own style (which must be a subclass of +`pygments.style.Style`) and pass it to the formatter: + +.. sourcecode:: pycon + + >>> from yourapp.yourmodule import YourStyle + >>> from pygments.formatters import HtmlFormatter + >>> HtmlFormatter(style=YourStyle).style + + + +Creating Own Styles +=================== + +So, how to create a style? All you have to do is to subclass `Style` and +define some styles: + +.. sourcecode:: python + + from pygments.style import Style + from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic + + class YourStyle(Style): + default_style = "" + styles = { + Comment: 'italic #888', + Keyword: 'bold #005', + Name: '#f00', + Name.Function: '#0f0', + Name.Class: 'bold #0f0', + String: 'bg:#eee #111' + } + +That's it. There are just a few rules. When you define a style for `Name` +the style automatically also affects `Name.Function` and so on. If you +defined ``'bold'`` and you don't want boldface for a subtoken use ``'nobold'``. + +(Philosophy: the styles aren't written in CSS syntax since this way +they can be used for a variety of formatters.) + +`default_style` is the style inherited by all token types. + +To make the style usable for Pygments, you must + +* either register it as a plugin (see :doc:`the plugin docs `) +* or drop it into the `styles` subpackage of your Pygments distribution one style + class per style, where the file name is the style name and the class name is + `StylenameClass`. For example, if your style should be called + ``"mondrian"``, name the class `MondrianStyle`, put it into the file + ``mondrian.py`` and this file into the ``pygments.styles`` subpackage + directory. + + +Style Rules +=========== + +Here a small overview of all allowed styles: + +``bold`` + render text as bold +``nobold`` + don't render text as bold (to prevent subtokens being highlighted bold) +``italic`` + render text italic +``noitalic`` + don't render text as italic +``underline`` + render text underlined +``nounderline`` + don't render text underlined +``bg:`` + transparent background +``bg:#000000`` + background color (black) +``border:`` + no border +``border:#ffffff`` + border color (white) +``#ff0000`` + text color (red) +``noinherit`` + don't inherit styles from supertoken + +Note that there may not be a space between ``bg:`` and the color value +since the style definition string is split at whitespace. +Also, using named colors is not allowed since the supported color names +vary for different formatters. + +Furthermore, not all lexers might support every style. + + +Builtin Styles +============== + +Pygments ships some builtin styles which are maintained by the Pygments team. + +To get a list of known styles you can use this snippet: + +.. sourcecode:: pycon + + >>> from pygments.styles import STYLE_MAP + >>> STYLE_MAP.keys() + ['default', 'emacs', 'friendly', 'colorful'] + + +Getting a list of available styles +================================== + +.. versionadded:: 0.6 + +Because it could be that a plugin registered a style, there is +a way to iterate over all styles: + +.. sourcecode:: pycon + + >>> from pygments.styles import get_all_styles + >>> styles = list(get_all_styles()) + + +.. _AnsiTerminalStyle: + +Terminal Styles +=============== + +.. versionadded:: 2.2 + +Custom styles used with the 256-color terminal formatter can also map colors to +use the 8 default ANSI colors. To do so, use ``#ansigreen``, ``#ansired`` or +any other colors defined in :attr:`pygments.style.ansicolors`. Foreground ANSI +colors will be mapped to the corresponding `escape codes 30 to 37 +`_ thus respecting any +custom color mapping and themes provided by many terminal emulators. Light +variants are treated as foreground color with and an added bold flag. +``bg:#ansi`` will also be respected, except the light variant will be the +same shade as their dark variant. + +See the following example where the color of the string ``"hello world"`` is +governed by the escape sequence ``\x1b[34;01m`` (Ansi Blue, Bold, 41 being red +background) instead of an extended foreground & background color. + +.. sourcecode:: pycon + + >>> from pygments import highlight + >>> from pygments.style import Style + >>> from pygments.token import Token + >>> from pygments.lexers import Python3Lexer + >>> from pygments.formatters import Terminal256Formatter + + >>> class MyStyle(Style): + styles = { + Token.String: '#ansiblue bg:#ansired', + } + + >>> code = 'print("Hello World")' + >>> result = highlight(code, Python3Lexer(), Terminal256Formatter(style=MyStyle)) + >>> print(result.encode()) + b'\x1b[34;41;01m"\x1b[39;49;00m\x1b[34;41;01mHello World\x1b[39;49;00m\x1b[34;41;01m"\x1b[39;49;00m' + +Colors specified using ``#ansi*`` are converted to a default set of RGB colors +when used with formatters other than the terminal-256 formatter. + +By definition of ANSI, the following colors are considered "light" colors, and +will be rendered by most terminals as bold: + +- "darkgray", "red", "green", "yellow", "blue", "fuchsia", "turquoise", "white" + +The following are considered "dark" colors and will be rendered as non-bold: + +- "black", "darkred", "darkgreen", "brown", "darkblue", "purple", "teal", + "lightgray" + +Exact behavior might depends on the terminal emulator you are using, and its +settings. diff --git a/doc/_build/html/_sources/docs/tokens.rst.txt b/doc/_build/html/_sources/docs/tokens.rst.txt new file mode 100644 index 0000000..801fc63 --- /dev/null +++ b/doc/_build/html/_sources/docs/tokens.rst.txt @@ -0,0 +1,372 @@ +.. -*- mode: rst -*- + +============== +Builtin Tokens +============== + +.. module:: pygments.token + +In the :mod:`pygments.token` module, there is a special object called `Token` +that is used to create token types. + +You can create a new token type by accessing an attribute of `Token`: + +.. sourcecode:: pycon + + >>> from pygments.token import Token + >>> Token.String + Token.String + >>> Token.String is Token.String + True + +Note that tokens are singletons so you can use the ``is`` operator for comparing +token types. + +As of Pygments 0.7 you can also use the ``in`` operator to perform set tests: + +.. sourcecode:: pycon + + >>> from pygments.token import Comment + >>> Comment.Single in Comment + True + >>> Comment in Comment.Multi + False + +This can be useful in :doc:`filters ` and if you write lexers on your +own without using the base lexers. + +You can also split a token type into a hierarchy, and get the parent of it: + +.. sourcecode:: pycon + + >>> String.split() + [Token, Token.Literal, Token.Literal.String] + >>> String.parent + Token.Literal + +In principle, you can create an unlimited number of token types but nobody can +guarantee that a style would define style rules for a token type. Because of +that, Pygments proposes some global token types defined in the +`pygments.token.STANDARD_TYPES` dict. + +For some tokens aliases are already defined: + +.. sourcecode:: pycon + + >>> from pygments.token import String + >>> String + Token.Literal.String + +Inside the :mod:`pygments.token` module the following aliases are defined: + +============= ============================ ==================================== +`Text` `Token.Text` for any type of text data +`Whitespace` `Token.Text.Whitespace` for specially highlighted whitespace +`Error` `Token.Error` represents lexer errors +`Other` `Token.Other` special token for data not + matched by a parser (e.g. HTML + markup in PHP code) +`Keyword` `Token.Keyword` any kind of keywords +`Name` `Token.Name` variable/function names +`Literal` `Token.Literal` Any literals +`String` `Token.Literal.String` string literals +`Number` `Token.Literal.Number` number literals +`Operator` `Token.Operator` operators (``+``, ``not``...) +`Punctuation` `Token.Punctuation` punctuation (``[``, ``(``...) +`Comment` `Token.Comment` any kind of comments +`Generic` `Token.Generic` generic tokens (have a look at + the explanation below) +============= ============================ ==================================== + +The `Whitespace` token type is new in Pygments 0.8. It is used only by the +`VisibleWhitespaceFilter` currently. + +Normally you just create token types using the already defined aliases. For each +of those token aliases, a number of subtypes exists (excluding the special tokens +`Token.Text`, `Token.Error` and `Token.Other`) + +The `is_token_subtype()` function in the `pygments.token` module can be used to +test if a token type is a subtype of another (such as `Name.Tag` and `Name`). +(This is the same as ``Name.Tag in Name``. The overloaded `in` operator was newly +introduced in Pygments 0.7, the function still exists for backwards +compatibility.) + +With Pygments 0.7, it's also possible to convert strings to token types (for example +if you want to supply a token from the command line): + +.. sourcecode:: pycon + + >>> from pygments.token import String, string_to_tokentype + >>> string_to_tokentype("String") + Token.Literal.String + >>> string_to_tokentype("Token.Literal.String") + Token.Literal.String + >>> string_to_tokentype(String) + Token.Literal.String + + +Keyword Tokens +============== + +`Keyword` + For any kind of keyword (especially if it doesn't match any of the + subtypes of course). + +`Keyword.Constant` + For keywords that are constants (e.g. ``None`` in future Python versions). + +`Keyword.Declaration` + For keywords used for variable declaration (e.g. ``var`` in some programming + languages like JavaScript). + +`Keyword.Namespace` + For keywords used for namespace declarations (e.g. ``import`` in Python and + Java and ``package`` in Java). + +`Keyword.Pseudo` + For keywords that aren't really keywords (e.g. ``None`` in old Python + versions). + +`Keyword.Reserved` + For reserved keywords. + +`Keyword.Type` + For builtin types that can't be used as identifiers (e.g. ``int``, + ``char`` etc. in C). + + +Name Tokens +=========== + +`Name` + For any name (variable names, function names, classes). + +`Name.Attribute` + For all attributes (e.g. in HTML tags). + +`Name.Builtin` + Builtin names; names that are available in the global namespace. + +`Name.Builtin.Pseudo` + Builtin names that are implicit (e.g. ``self`` in Ruby, ``this`` in Java). + +`Name.Class` + Class names. Because no lexer can know if a name is a class or a function + or something else this token is meant for class declarations. + +`Name.Constant` + Token type for constants. In some languages you can recognise a token by the + way it's defined (the value after a ``const`` keyword for example). In + other languages constants are uppercase by definition (Ruby). + +`Name.Decorator` + Token type for decorators. Decorators are syntactic elements in the Python + language. Similar syntax elements exist in C# and Java. + +`Name.Entity` + Token type for special entities. (e.g. `` `` in HTML). + +`Name.Exception` + Token type for exception names (e.g. ``RuntimeError`` in Python). Some languages + define exceptions in the function signature (Java). You can highlight + the name of that exception using this token then. + +`Name.Function` + Token type for function names. + +`Name.Function.Magic` + same as `Name.Function` but for special function names that have an implicit use + in a language (e.g. ``__init__`` method in Python). + +`Name.Label` + Token type for label names (e.g. in languages that support ``goto``). + +`Name.Namespace` + Token type for namespaces. (e.g. import paths in Java/Python), names following + the ``module``/``namespace`` keyword in other languages. + +`Name.Other` + Other names. Normally unused. + +`Name.Tag` + Tag names (in HTML/XML markup or configuration files). + +`Name.Variable` + Token type for variables. Some languages have prefixes for variable names + (PHP, Ruby, Perl). You can highlight them using this token. + +`Name.Variable.Class` + same as `Name.Variable` but for class variables (also static variables). + +`Name.Variable.Global` + same as `Name.Variable` but for global variables (used in Ruby, for + example). + +`Name.Variable.Instance` + same as `Name.Variable` but for instance variables. + +`Name.Variable.Magic` + same as `Name.Variable` but for special variable names that have an implicit use + in a language (e.g. ``__doc__`` in Python). + + +Literals +======== + +`Literal` + For any literal (if not further defined). + +`Literal.Date` + for date literals (e.g. ``42d`` in Boo). + + +`String` + For any string literal. + +`String.Affix` + Token type for affixes that further specify the type of the string they're + attached to (e.g. the prefixes ``r`` and ``u8`` in ``r"foo"`` and ``u8"foo"``). + +`String.Backtick` + Token type for strings enclosed in backticks. + +`String.Char` + Token type for single characters (e.g. Java, C). + +`String.Delimiter` + Token type for delimiting identifiers in "heredoc", raw and other similar + strings (e.g. the word ``END`` in Perl code ``print <<'END';``). + +`String.Doc` + Token type for documentation strings (for example Python). + +`String.Double` + Double quoted strings. + +`String.Escape` + Token type for escape sequences in strings. + +`String.Heredoc` + Token type for "heredoc" strings (e.g. in Ruby or Perl). + +`String.Interpol` + Token type for interpolated parts in strings (e.g. ``#{foo}`` in Ruby). + +`String.Other` + Token type for any other strings (for example ``%q{foo}`` string constructs + in Ruby). + +`String.Regex` + Token type for regular expression literals (e.g. ``/foo/`` in JavaScript). + +`String.Single` + Token type for single quoted strings. + +`String.Symbol` + Token type for symbols (e.g. ``:foo`` in LISP or Ruby). + + +`Number` + Token type for any number literal. + +`Number.Bin` + Token type for binary literals (e.g. ``0b101010``). + +`Number.Float` + Token type for float literals (e.g. ``42.0``). + +`Number.Hex` + Token type for hexadecimal number literals (e.g. ``0xdeadbeef``). + +`Number.Integer` + Token type for integer literals (e.g. ``42``). + +`Number.Integer.Long` + Token type for long integer literals (e.g. ``42L`` in Python). + +`Number.Oct` + Token type for octal literals. + + +Operators +========= + +`Operator` + For any punctuation operator (e.g. ``+``, ``-``). + +`Operator.Word` + For any operator that is a word (e.g. ``not``). + + +Punctuation +=========== + +.. versionadded:: 0.7 + +`Punctuation` + For any punctuation which is not an operator (e.g. ``[``, ``(``...) + + +Comments +======== + +`Comment` + Token type for any comment. + +`Comment.Hashbang` + Token type for hashbang comments (i.e. first lines of files that start with + ``#!``). + +`Comment.Multiline` + Token type for multiline comments. + +`Comment.Preproc` + Token type for preprocessor comments (also ```. + +.. versionadded:: 0.7 + The formatters now also accept an `outencoding` option which will override + the `encoding` option if given. This makes it possible to use a single + options dict with lexers and formatters, and still have different input and + output encodings. + +.. _chardet: https://chardet.github.io/ diff --git a/doc/_build/html/_sources/download.rst.txt b/doc/_build/html/_sources/download.rst.txt new file mode 100644 index 0000000..cf32f48 --- /dev/null +++ b/doc/_build/html/_sources/download.rst.txt @@ -0,0 +1,41 @@ +Download and installation +========================= + +The current release is version |version|. + +Packaged versions +----------------- + +You can download it `from the Python Package Index +`_. For installation of packages from +PyPI, we recommend `Pip `_, which works on all +major platforms. + +Under Linux, most distributions include a package for Pygments, usually called +``pygments`` or ``python-pygments``. You can install it with the package +manager as usual. + +Development sources +------------------- + +We're using the `Mercurial `_ version control +system. You can get the development source using this command:: + + hg clone http://bitbucket.org/birkenfeld/pygments-main pygments + +Development takes place at `Bitbucket +`_, you can browse the source +online `here `_. + +The latest changes in the development source code are listed in the `changelog +`_. + +.. Documentation + ------------- + +.. XXX todo + + You can download the documentation either as + a bunch of rst files from the Mercurial repository, see above, or + as a tar.gz containing rendered HTML files:

+

pygmentsdocs.tar.gz

diff --git a/doc/_build/html/_sources/faq.rst.txt b/doc/_build/html/_sources/faq.rst.txt new file mode 100644 index 0000000..172929e --- /dev/null +++ b/doc/_build/html/_sources/faq.rst.txt @@ -0,0 +1,139 @@ +:orphan: + +Pygments FAQ +============= + +What is Pygments? +----------------- + +Pygments is a syntax highlighting engine written in Python. That means, it will +take source code (or other markup) in a supported language and output a +processed version (in different formats) containing syntax highlighting markup. + +Its features include: + +* a wide range of common :doc:`languages and markup formats ` is supported +* new languages and formats are added easily +* a number of output formats is available, including: + + - HTML + - ANSI sequences (console output) + - LaTeX + - RTF + +* it is usable as a command-line tool and as a library +* parsing and formatting is fast + +Pygments is licensed under the BSD license. + +Where does the name Pygments come from? +--------------------------------------- + +*Py* of course stands for Python, while *pigments* are used for coloring paint, +and in this case, source code! + +What are the system requirements? +--------------------------------- + +Pygments only needs a standard Python install, version 2.7 or higher or version +3.5 or higher for Python 3. No additional libraries are needed. + +How can I use Pygments? +----------------------- + +Pygments is usable as a command-line tool as well as a library. + +From the command-line, usage looks like this (assuming the pygmentize script is +properly installed):: + + pygmentize -f html /path/to/file.py + +This will print a HTML-highlighted version of /path/to/file.py to standard output. + +For a complete help, please run ``pygmentize -h``. + +Usage as a library is thoroughly demonstrated in the Documentation section. + +How do I make a new style? +-------------------------- + +Please see the :doc:`documentation on styles `. + +How can I report a bug or suggest a feature? +-------------------------------------------- + +Please report bugs and feature wishes in the tracker at Bitbucket. + +You can also e-mail the author or use IRC, see the contact details. + +I want this support for this language! +-------------------------------------- + +Instead of waiting for others to include language support, why not write it +yourself? All you have to know is :doc:`outlined in the docs +`. + +Can I use Pygments for programming language processing? +------------------------------------------------------- + +The Pygments lexing machinery is quite powerful can be used to build lexers for +basically all languages. However, parsing them is not possible, though some +lexers go some steps in this direction in order to e.g. highlight function names +differently. + +Also, error reporting is not the scope of Pygments. It focuses on correctly +highlighting syntactically valid documents, not finding and compensating errors. + +Who uses Pygments? +------------------ + +This is an (incomplete) list of projects and sites known to use the Pygments highlighter. + +* `Wikipedia `_ +* `BitBucket `_, a Mercurial and Git hosting site +* `The Sphinx documentation builder `_, for embedded source examples +* `rst2pdf `_, a reStructuredText to PDF converter +* `Codecov `_, a code coverage CI service +* `Trac `_, the universal project management tool +* `AsciiDoc `_, a text-based documentation generator +* `ActiveState Code `_, the Python Cookbook successor +* `ViewVC `_, a web-based version control repository browser +* `BzrFruit `_, a Bazaar branch viewer +* `QBzr `_, a cross-platform Qt-based GUI front end for Bazaar +* `Review Board `_, a collaborative code reviewing tool +* `Diamanda `_, a Django powered wiki system with support for Pygments +* `Progopedia `_ (`English `_), + an encyclopedia of programming languages +* `Bruce `_, a reStructuredText presentation tool +* `PIDA `_, a universal IDE written in Python +* `BPython `_, a curses-based intelligent Python shell +* `PuDB `_, a console Python debugger +* `XWiki `_, a wiki-based development framework in Java, using Jython +* `roux `_, a script for running R scripts + and creating beautiful output including graphs +* `hurl `_, a web service for making HTTP requests +* `wxHTMLPygmentizer `_ is + a GUI utility, used to make code-colorization easier +* `Postmarkup `_, a BBCode to XHTML generator +* `WpPygments `_, and `WPygments + `_, highlighter plugins for WordPress +* `Siafoo `_, a tool for sharing and storing useful code and programming experience +* `D source `_, a community for the D programming language +* `dpaste.com `_, another Django pastebin +* `Django snippets `_, a pastebin for Django code +* `Fayaa `_, a Chinese pastebin +* `Incollo.com `_, a free collaborative debugging tool +* `PasteBox `_, a pastebin focused on privacy +* `hilite.me `_, a site to highlight code snippets +* `patx.me `_, a pastebin +* `Fluidic `_, an experiment in + integrating shells with a GUI +* `pygments.rb `_, a pygments wrapper for Ruby +* `Clygments `_, a pygments wrapper for + Clojure +* `PHPygments `_, a pygments wrapper for PHP + + +If you have a project or web site using Pygments, drop me a line, and I'll add a +link here. + diff --git a/doc/_build/html/_sources/index.rst.txt b/doc/_build/html/_sources/index.rst.txt new file mode 100644 index 0000000..2611404 --- /dev/null +++ b/doc/_build/html/_sources/index.rst.txt @@ -0,0 +1,54 @@ +Welcome! +======== + +This is the home of Pygments. It is a generic syntax highlighter suitable for +use in code hosting, forums, wikis or other applications that need to prettify +source code. Highlights are: + +* a wide range of over 300 languages and other text formats is supported +* special attention is paid to details that increase highlighting quality +* support for new languages and formats are added easily; most languages use a + simple regex-based lexing mechanism +* a number of output formats is available, among them HTML, RTF, LaTeX and ANSI + sequences +* it is usable as a command-line tool and as a library +* ... and it highlights even Perl 6! + +Read more in the :doc:`FAQ list ` or the :doc:`documentation `, +or `download the latest release `_. + +.. _contribute: + +Contribute +---------- + +Like every open-source project, we are always looking for volunteers to help us +with programming. Python knowledge is required, but don't fear: Python is a very +clear and easy to learn language. + +Development takes place on `Bitbucket +`_, where the Mercurial +repository, tickets and pull requests can be viewed. + +Our primary communication instrument is the IRC channel **#pocoo** on the +Freenode network. To join it, let your IRC client connect to +``irc.freenode.net`` and do ``/join #pocoo``. + +If you found a bug, just open a ticket in the Bitbucket tracker. Be sure to log +in to be notified when the issue is fixed -- development is not fast-paced as +the library is quite stable. You can also send an e-mail to the developers, see +below. + +The authors +----------- + +Pygments is maintained by **Georg Brandl**, e-mail address *georg*\ *@*\ *python.org*. + +Many lexers and fixes have been contributed by **Armin Ronacher**, the rest of +the `Pocoo `_ team and **Tim Hatch**. + +.. toctree:: + :maxdepth: 1 + :hidden: + + docs/index diff --git a/doc/_build/html/_sources/languages.rst.txt b/doc/_build/html/_sources/languages.rst.txt new file mode 100644 index 0000000..e539940 --- /dev/null +++ b/doc/_build/html/_sources/languages.rst.txt @@ -0,0 +1,156 @@ +:orphan: + +Supported languages +=================== + +Pygments supports an ever-growing range of languages. Watch this space... + +Programming languages +--------------------- + +* ActionScript +* Ada +* ANTLR +* AppleScript +* Assembly (various) +* Asymptote +* Awk +* Befunge +* Boo +* BrainFuck +* C, C++ +* C# +* Clojure +* CoffeeScript +* ColdFusion +* Common Lisp +* Coq +* Cryptol (incl. Literate Cryptol) +* `Crystal `_ +* `Cython `_ +* `D `_ +* Dart +* Delphi +* Dylan +* `Elm `_ +* Erlang +* `Ezhil `_ Ezhil - A Tamil programming language +* Factor +* Fancy +* `Fennel `_ +* Fortran +* F# +* GAP +* Gherkin (Cucumber) +* GL shaders +* Groovy +* `Haskell `_ (incl. Literate Haskell) +* HLSL +* IDL +* Io +* Java +* JavaScript +* Lasso +* LLVM +* Logtalk +* `Lua `_ +* Matlab +* MiniD +* Modelica +* Modula-2 +* MuPad +* Nemerle +* Nimrod +* Objective-C +* Objective-J +* Octave +* OCaml +* PHP +* `Perl `_ +* PovRay +* PostScript +* PowerShell +* Prolog +* `Python `_ 2.x and 3.x (incl. console sessions and tracebacks) +* `REBOL `_ +* `Red `_ +* Redcode +* `Ruby `_ (incl. irb sessions) +* Rust +* S, S-Plus, R +* Scala +* Scheme +* Scilab +* Smalltalk +* SNOBOL +* Tcl +* Vala +* Verilog +* VHDL +* Visual Basic.NET +* Visual FoxPro +* XQuery +* Zephir + +Template languages +------------------ + +* Cheetah templates +* `Django `_ / `Jinja + `_ templates +* ERB (Ruby templating) +* `Genshi `_ (the Trac template language) +* JSP (Java Server Pages) +* `Myghty `_ (the HTML::Mason based framework) +* `Mako `_ (the Myghty successor) +* `Smarty `_ templates (PHP templating) +* Tea + +Other markup +------------ + +* Apache config files +* Bash shell scripts +* BBCode +* CMake +* CSS +* Debian control files +* Diff files +* DTD +* Gettext catalogs +* Gnuplot script +* Groff markup +* HTML +* HTTP sessions +* INI-style config files +* IRC logs (irssi style) +* Lighttpd config files +* Makefiles +* MoinMoin/Trac Wiki markup +* MySQL +* Nginx config files +* POV-Ray scenes +* Ragel +* Redcode +* ReST +* Robot Framework +* RPM spec files +* SQL, also MySQL, SQLite +* Squid configuration +* TeX +* tcsh +* Vim Script +* Windows batch files +* XML +* XSLT +* YAML + +... that's all? +--------------- + +Well, why not write your own? Contributing to Pygments is easy and fun. Take a look at the +:doc:`docs on lexer development ` and +:ref:`contact details `. + +Note: the languages listed here are supported in the development version. The +latest release may lack a few of them. diff --git a/doc/_build/html/_static/ajax-loader.gif b/doc/_build/html/_static/ajax-loader.gif new file mode 100644 index 0000000..61faf8c Binary files /dev/null and b/doc/_build/html/_static/ajax-loader.gif differ diff --git a/doc/_build/html/_static/basic.css b/doc/_build/html/_static/basic.css new file mode 100644 index 0000000..104f076 --- /dev/null +++ b/doc/_build/html/_static/basic.css @@ -0,0 +1,676 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li div.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 450px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px 7px 0 7px; + background-color: #ffe; + width: 40%; + float: right; +} + +p.sidebar-title { + font-weight: bold; +} + +/* -- topics ---------------------------------------------------------------- */ + +div.topic { + border: 1px solid #ccc; + padding: 7px 7px 0 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +div.admonition dl { + margin-bottom: 0; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist td { + vertical-align: top; +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +dl { + margin-bottom: 15px; +} + +dd p { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; +} + +td.linenos pre { + padding: 5px 0px; + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + margin-left: 0.5em; +} + +table.highlighttable td { + padding: 0 0.5em 0 0.5em; +} + +div.code-block-caption { + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +div.code-block-caption + div > div.highlight > pre { + margin-top: 0; +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + padding: 1em 1em 0; +} + +div.literal-block-wrapper div.highlight { + margin: 0; +} + +code.descname { + background-color: transparent; + font-weight: bold; + font-size: 1.2em; +} + +code.descclassname { + background-color: transparent; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: relative; + left: 0px; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/doc/_build/html/_static/bodybg.png b/doc/_build/html/_static/bodybg.png new file mode 100644 index 0000000..46892b8 Binary files /dev/null and b/doc/_build/html/_static/bodybg.png differ diff --git a/doc/_build/html/_static/comment-bright.png b/doc/_build/html/_static/comment-bright.png new file mode 100644 index 0000000..15e27ed Binary files /dev/null and b/doc/_build/html/_static/comment-bright.png differ diff --git a/doc/_build/html/_static/comment-close.png b/doc/_build/html/_static/comment-close.png new file mode 100644 index 0000000..4d91bcf Binary files /dev/null and b/doc/_build/html/_static/comment-close.png differ diff --git a/doc/_build/html/_static/comment.png b/doc/_build/html/_static/comment.png new file mode 100644 index 0000000..dfbc0cb Binary files /dev/null and b/doc/_build/html/_static/comment.png differ diff --git a/doc/_build/html/_static/docbg.png b/doc/_build/html/_static/docbg.png new file mode 100644 index 0000000..13e61f3 Binary files /dev/null and b/doc/_build/html/_static/docbg.png differ diff --git a/doc/_build/html/_static/doctools.js b/doc/_build/html/_static/doctools.js new file mode 100644 index 0000000..ffadbec --- /dev/null +++ b/doc/_build/html/_static/doctools.js @@ -0,0 +1,315 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Sphinx JavaScript utilities for all documentation. + * + * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * select a different prefix for underscore + */ +$u = _.noConflict(); + +/** + * make the code below compatible with browsers without + * an installed firebug like debugger +if (!window.console || !console.firebug) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", + "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", + "profile", "profileEnd"]; + window.console = {}; + for (var i = 0; i < names.length; ++i) + window.console[names[i]] = function() {}; +} + */ + +/** + * small helper function to urldecode strings + */ +jQuery.urldecode = function(x) { + return decodeURIComponent(x).replace(/\+/g, ' '); +}; + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s === 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +}; + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node, addItems) { + if (node.nodeType === 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && + !jQuery(node.parentNode).hasClass(className) && + !jQuery(node.parentNode).hasClass("nohighlight")) { + var span; + var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.className = className; + } + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + if (isInSVG) { + var bbox = span.getBBox(); + var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute('class', className); + var parentOfText = node.parentNode.parentNode; + addItems.push({ + "parent": node.parentNode, + "target": rect}); + } + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this, addItems); + }); + } + } + var addItems = []; + var result = this.each(function() { + highlight(this, addItems); + }); + for (var i = 0; i < addItems.length; ++i) { + jQuery(addItems[i].parent).before(addItems[i].target); + } + return result; +}; + +/* + * backward compatibility for jQuery.browser + * This will be supported until firefox bug is fixed. + */ +if (!jQuery.browser) { + jQuery.uaMatch = function(ua) { + ua = ua.toLowerCase(); + + var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || + /(webkit)[ \/]([\w.]+)/.exec(ua) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || + /(msie) ([\w.]+)/.exec(ua) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || + []; + + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; + }; + jQuery.browser = {}; + jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; +} + +/** + * Small JavaScript module for the documentation. + */ +var Documentation = { + + init : function() { + this.fixFirefoxAnchorBug(); + this.highlightSearchWords(); + this.initIndexTable(); + if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { + this.initOnKeyListeners(); + } + }, + + /** + * i18n support + */ + TRANSLATIONS : {}, + PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, + LOCALE : 'unknown', + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext : function(string) { + var translated = Documentation.TRANSLATIONS[string]; + if (typeof translated === 'undefined') + return string; + return (typeof translated === 'string') ? translated : translated[0]; + }, + + ngettext : function(singular, plural, n) { + var translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated === 'undefined') + return (n == 1) ? singular : plural; + return translated[Documentation.PLURALEXPR(n)]; + }, + + addTranslations : function(catalog) { + for (var key in catalog.messages) + this.TRANSLATIONS[key] = catalog.messages[key]; + this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); + this.LOCALE = catalog.locale; + }, + + /** + * add context elements like header anchor links + */ + addContextElements : function() { + $('div[id] > :header:first').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this headline')). + appendTo(this); + }); + $('dt[id]').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this definition')). + appendTo(this); + }); + }, + + /** + * workaround a firefox stupidity + * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 + */ + fixFirefoxAnchorBug : function() { + if (document.location.hash && $.browser.mozilla) + window.setTimeout(function() { + document.location.href += ''; + }, 10); + }, + + /** + * highlight the search words provided in the url in the text + */ + highlightSearchWords : function() { + var params = $.getQueryParameters(); + var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; + if (terms.length) { + var body = $('div.body'); + if (!body.length) { + body = $('body'); + } + window.setTimeout(function() { + $.each(terms, function() { + body.highlightText(this.toLowerCase(), 'highlighted'); + }); + }, 10); + $('') + .appendTo($('#searchbox')); + } + }, + + /** + * init the domain index toggle buttons + */ + initIndexTable : function() { + var togglers = $('img.toggler').click(function() { + var src = $(this).attr('src'); + var idnum = $(this).attr('id').substr(7); + $('tr.cg-' + idnum).toggle(); + if (src.substr(-9) === 'minus.png') + $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); + else + $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); + }).css('display', ''); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { + togglers.click(); + } + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords : function() { + $('#searchbox .highlight-link').fadeOut(300); + $('span.highlighted').removeClass('highlighted'); + }, + + /** + * make the url absolute + */ + makeURL : function(relativeURL) { + return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; + }, + + /** + * get the current relative url + */ + getCurrentURL : function() { + var path = document.location.pathname; + var parts = path.split(/\//); + $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { + if (this === '..') + parts.pop(); + }); + var url = parts.join('/'); + return path.substring(url.lastIndexOf('/') + 1, path.length - 1); + }, + + initOnKeyListeners: function() { + $(document).keyup(function(event) { + var activeElementType = document.activeElement.tagName; + // don't navigate when in search box or textarea + if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { + switch (event.keyCode) { + case 37: // left + var prevHref = $('link[rel="prev"]').prop('href'); + if (prevHref) { + window.location.href = prevHref; + return false; + } + case 39: // right + var nextHref = $('link[rel="next"]').prop('href'); + if (nextHref) { + window.location.href = nextHref; + return false; + } + } + } + }); + } +}; + +// quick alias for translations +_ = Documentation.gettext; + +$(document).ready(function() { + Documentation.init(); +}); diff --git a/doc/_build/html/_static/documentation_options.js b/doc/_build/html/_static/documentation_options.js new file mode 100644 index 0000000..d473d0f --- /dev/null +++ b/doc/_build/html/_static/documentation_options.js @@ -0,0 +1,296 @@ +var DOCUMENTATION_OPTIONS = { + URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), + VERSION: '2.3.0', + LANGUAGE: 'None', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false, + SEARCH_LANGUAGE_STOP_WORDS: ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"] +}; + + + +/* Non-minified version JS is _stemmer.js if file is provided */ +/** + * Porter Stemmer + */ +var Stemmer = function() { + + var step2list = { + ational: 'ate', + tional: 'tion', + enci: 'ence', + anci: 'ance', + izer: 'ize', + bli: 'ble', + alli: 'al', + entli: 'ent', + eli: 'e', + ousli: 'ous', + ization: 'ize', + ation: 'ate', + ator: 'ate', + alism: 'al', + iveness: 'ive', + fulness: 'ful', + ousness: 'ous', + aliti: 'al', + iviti: 'ive', + biliti: 'ble', + logi: 'log' + }; + + var step3list = { + icate: 'ic', + ative: '', + alize: 'al', + iciti: 'ic', + ical: 'ic', + ful: '', + ness: '' + }; + + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence + + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; + } +} + + + + + +var splitChars = (function() { + var result = {}; + var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, + 1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702, + 2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971, + 2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345, + 3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761, + 3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, + 4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125, + 8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695, + 11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587, + 43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141]; + var i, j, start, end; + for (i = 0; i < singles.length; i++) { + result[singles[i]] = true; + } + var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709], + [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161], + [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568], + [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807], + [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047], + [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383], + [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450], + [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547], + [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673], + [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820], + [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946], + [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023], + [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173], + [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332], + [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481], + [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718], + [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791], + [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095], + [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205], + [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687], + [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968], + [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869], + [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102], + [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271], + [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592], + [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822], + [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167], + [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959], + [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143], + [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318], + [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483], + [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101], + [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567], + [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292], + [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444], + [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783], + [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311], + [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511], + [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774], + [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071], + [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263], + [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519], + [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647], + [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967], + [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295], + [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274], + [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007], + [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381], + [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]]; + for (i = 0; i < ranges.length; i++) { + start = ranges[i][0]; + end = ranges[i][1]; + for (j = start; j <= end; j++) { + result[j] = true; + } + } + return result; +})(); + +function splitQuery(query) { + var result = []; + var start = -1; + for (var i = 0; i < query.length; i++) { + if (splitChars[query.charCodeAt(i)]) { + if (start !== -1) { + result.push(query.slice(start, i)); + start = -1; + } + } else if (start === -1) { + start = i; + } + } + if (start !== -1) { + result.push(query.slice(start)); + } + return result; +} + + diff --git a/doc/_build/html/_static/down-pressed.png b/doc/_build/html/_static/down-pressed.png new file mode 100644 index 0000000..5756c8c Binary files /dev/null and b/doc/_build/html/_static/down-pressed.png differ diff --git a/doc/_build/html/_static/down.png b/doc/_build/html/_static/down.png new file mode 100644 index 0000000..1b3bdad Binary files /dev/null and b/doc/_build/html/_static/down.png differ diff --git a/doc/_build/html/_static/favicon.ico b/doc/_build/html/_static/favicon.ico new file mode 100644 index 0000000..777f617 Binary files /dev/null and b/doc/_build/html/_static/favicon.ico differ diff --git a/doc/_build/html/_static/file.png b/doc/_build/html/_static/file.png new file mode 100644 index 0000000..a858a41 Binary files /dev/null and b/doc/_build/html/_static/file.png differ diff --git a/doc/_build/html/_static/jquery-3.2.1.js b/doc/_build/html/_static/jquery-3.2.1.js new file mode 100644 index 0000000..d2d8ca4 --- /dev/null +++ b/doc/_build/html/_static/jquery-3.2.1.js @@ -0,0 +1,10253 @@ +/*! + * jQuery JavaScript Library v3.2.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2017-03-20T18:59Z + */ +( function( global, factory ) { + + "use strict"; + + if ( typeof module === "object" && typeof module.exports === "object" ) { + + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 +// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode +// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common +// enough that all such attempts are guarded in a try block. +"use strict"; + +var arr = []; + +var document = window.document; + +var getProto = Object.getPrototypeOf; + +var slice = arr.slice; + +var concat = arr.concat; + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var fnToString = hasOwn.toString; + +var ObjectFunctionString = fnToString.call( Object ); + +var support = {}; + + + + function DOMEval( code, doc ) { + doc = doc || document; + + var script = doc.createElement( "script" ); + + script.text = code; + doc.head.appendChild( script ).parentNode.removeChild( script ); + } +/* global Symbol */ +// Defining this global in .eslintrc.json would create a danger of using the global +// unguarded in another place, it seems safer to define global only for this module + + + +var + version = "3.2.1", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }, + + // Support: Android <=4.0 only + // Make sure we trim BOM and NBSP + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // Matches dashed string for camelizing + rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return letter.toUpperCase(); + }; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + + // Return all the elements in a clean array + if ( num == null ) { + return slice.call( this ); + } + + // Return just the one element from the set + return num < 0 ? this[ num + this.length ] : this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = Array.isArray( copy ) ) ) ) { + + if ( copyIsArray ) { + copyIsArray = false; + clone = src && Array.isArray( src ) ? src : []; + + } else { + clone = src && jQuery.isPlainObject( src ) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isFunction: function( obj ) { + return jQuery.type( obj ) === "function"; + }, + + isWindow: function( obj ) { + return obj != null && obj === obj.window; + }, + + isNumeric: function( obj ) { + + // As of jQuery 3.0, isNumeric is limited to + // strings and numbers (primitives or objects) + // that can be coerced to finite numbers (gh-2662) + var type = jQuery.type( obj ); + return ( type === "number" || type === "string" ) && + + // parseFloat NaNs numeric-cast false positives ("") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + !isNaN( obj - parseFloat( obj ) ); + }, + + isPlainObject: function( obj ) { + var proto, Ctor; + + // Detect obvious negatives + // Use toString instead of jQuery.type to catch host objects + if ( !obj || toString.call( obj ) !== "[object Object]" ) { + return false; + } + + proto = getProto( obj ); + + // Objects with no prototype (e.g., `Object.create( null )`) are plain + if ( !proto ) { + return true; + } + + // Objects with prototype are plain iff they were constructed by a global Object function + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; + }, + + isEmptyObject: function( obj ) { + + /* eslint-disable no-unused-vars */ + // See https://github.com/eslint/eslint/issues/6125 + var name; + + for ( name in obj ) { + return false; + } + return true; + }, + + type: function( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android <=2.3 only (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; + }, + + // Evaluates a script in a global context + globalEval: function( code ) { + DOMEval( code ); + }, + + // Convert dashed to camelCase; used by the css and data modules + // Support: IE <=9 - 11, Edge 12 - 13 + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // Support: Android <=4.0 only + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var tmp, args, proxy; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + now: Date.now, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: real iOS 8.2 only (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = jQuery.type( obj ); + + if ( type === "function" || jQuery.isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.3.3 + * https://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-08-08 + */ +(function( window ) { + +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf as it's faster than native + // https://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + + // CSS escapes + // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox<24 + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + high < 0 ? + // BMP codepoint + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // CSS string/identifier serialization + // https://drafts.csswg.org/cssom/#common-serializing-idioms + rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, + fcssescape = function( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; + } + + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }, + + disabledAncestor = addCombinator( + function( elem ) { + return elem.disabled === true && ("form" in elem || "label" in elem); + }, + { dir: "parentNode", next: "legend" } + ); + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + + // ID selector + if ( (m = match[1]) ) { + + // Document context + if ( nodeType === 9 ) { + if ( (elem = context.getElementById( m )) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && (elem = newContext.getElementById( m )) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( (m = match[3]) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !compilerCache[ selector + " " ] && + (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + + if ( nodeType !== 1 ) { + newContext = context; + newSelector = selector; + + // qSA looks outside Element context, which is not what we want + // Thanks to Andrew Dupont for this workaround technique + // Support: IE <=8 + // Exclude object elements + } else if ( context.nodeName.toLowerCase() !== "object" ) { + + // Capture the context ID, setting it first if necessary + if ( (nid = context.getAttribute( "id" )) ) { + nid = nid.replace( rcssescape, fcssescape ); + } else { + context.setAttribute( "id", (nid = expando) ); + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + while ( i-- ) { + groups[i] = "#" + nid + " " + toSelector( groups[i] ); + } + newSelector = groups.join( "," ); + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key + " " ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created element and returns a boolean result + */ +function assert( fn ) { + var el = document.createElement("fieldset"); + + try { + return !!fn( el ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( el.parentNode ) { + el.parentNode.removeChild( el ); + } + // release memory in IE + el = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + a.sourceIndex - b.sourceIndex; + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for :enabled/:disabled + * @param {Boolean} disabled true for :disabled; false for :enabled + */ +function createDisabledPseudo( disabled ) { + + // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable + return function( elem ) { + + // Only certain elements can match :enabled or :disabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled + if ( "form" in elem ) { + + // Check for inherited disabledness on relevant non-disabled elements: + // * listed form-associated elements in a disabled fieldset + // https://html.spec.whatwg.org/multipage/forms.html#category-listed + // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled + // * option elements in a disabled optgroup + // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled + // All such elements have a "form" property. + if ( elem.parentNode && elem.disabled === false ) { + + // Option elements defer to a parent optgroup if present + if ( "label" in elem ) { + if ( "label" in elem.parentNode ) { + return elem.parentNode.disabled === disabled; + } else { + return elem.disabled === disabled; + } + } + + // Support: IE 6 - 11 + // Use the isDisabled shortcut property to check for disabled fieldset ancestors + return elem.isDisabled === disabled || + + // Where there is no isDisabled, check manually + /* jshint -W018 */ + elem.isDisabled !== !disabled && + disabledAncestor( elem ) === disabled; + } + + return elem.disabled === disabled; + + // Try to winnow out elements that can't be disabled before trusting the disabled property. + // Some victims get caught in our net (label, legend, menu, track), but it shouldn't + // even exist on them, let alone have a boolean value. + } else if ( "label" in elem ) { + return elem.disabled === disabled; + } + + // Remaining elements are neither :enabled nor :disabled + return false; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, subWindow, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9-11, Edge + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + if ( preferredDoc !== document && + (subWindow = document.defaultView) && subWindow.top !== subWindow ) { + + // Support: IE 11, Edge + if ( subWindow.addEventListener ) { + subWindow.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( subWindow.attachEvent ) { + subWindow.attachEvent( "onunload", unloadHandler ); + } + } + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert(function( el ) { + el.className = "i"; + return !el.getAttribute("className"); + }); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( el ) { + el.appendChild( document.createComment("") ); + return !el.getElementsByTagName("*").length; + }); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programmatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert(function( el ) { + docElem.appendChild( el ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + }); + + // ID filter and find + if ( support.getById ) { + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var elem = context.getElementById( id ); + return elem ? [ elem ] : []; + } + }; + } else { + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + + // Support: IE 6 - 7 only + // getElementById is not reliable as a find shortcut + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var node, i, elems, + elem = context.getElementById( id ); + + if ( elem ) { + + // Verify the id attribute + node = elem.getAttributeNode("id"); + if ( node && node.value === id ) { + return [ elem ]; + } + + // Fall back on getElementsByName + elems = context.getElementsByName( id ); + i = 0; + while ( (elem = elems[i++]) ) { + node = elem.getAttributeNode("id"); + if ( node && node.value === id ) { + return [ elem ]; + } + } + } + + return []; + } + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See https://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( el ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // https://bugs.jquery.com/ticket/12359 + docElem.appendChild( el ).innerHTML = "" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( el.querySelectorAll("[msallowcapture^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !el.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push("~="); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !el.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibling-combinator selector` fails + if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push(".#.+[+~]"); + } + }); + + assert(function( el ) { + el.innerHTML = "" + + ""; + + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement("input"); + input.setAttribute( "type", "hidden" ); + el.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( el.querySelectorAll("[name=d]").length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( el.querySelectorAll(":enabled").length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: IE9-11+ + // IE's :disabled selector does not pick up the children of disabled fieldsets + docElem.appendChild( el ).disabled = true; + if ( el.querySelectorAll(":disabled").length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + el.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( el ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( el, "*" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( el, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + return -1; + } + if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + return a === document ? -1 : + b === document ? 1 : + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + if ( support.matchesSelector && documentIsHTML && + !compilerCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch (e) {} + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + (val = elem.getAttributeNode(name)) && val.specified ? + val.value : + null; +}; + +Sizzle.escape = function( sel ) { + return (sel + "").replace( rcssescape, fcssescape ); +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + while ( (node = elem[i++]) ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[6] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[3] ) { + match[2] = match[4] || match[5] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { return true; } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + // Use previously-cached element index if available + if ( useCache ) { + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + // Don't keep the element (issue #299) + input[0] = null; + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": createDisabledPseudo( false ), + "disabled": createDisabledPseudo( true ), + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( (tokens = []) ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push({ + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + }); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + skip = combinator.next, + key = skip || dir, + checkNonElements = base && key === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + return false; + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); + + if ( skip && skip === elem.nodeName.toLowerCase() ) { + elem = elem[ dir ] || elem; + } else if ( (oldCache = uniqueCache[ key ]) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return (newCache[ 2 ] = oldCache[ 2 ]); + } else { + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ key ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + return true; + } + } + } + } + } + return false; + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + len = elems.length; + + if ( outermost ) { + outermostContext = context === document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + if ( !context && elem.ownerDocument !== document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context || document, xml) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( (selector = compiled.selector || selector) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert(function( el ) { + // Should return 1, but returns 4 (following) + return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; +}); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( el ) { + el.innerHTML = ""; + return el.firstChild.getAttribute("href") === "#" ; +}) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + }); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert(function( el ) { + el.innerHTML = ""; + el.firstChild.setAttribute( "value", "" ); + return el.firstChild.getAttribute( "value" ) === ""; +}) ) { + addHandle( "value", function( elem, name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + }); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert(function( el ) { + return el.getAttribute("disabled") == null; +}) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + (val = elem.getAttributeNode( name )) && val.specified ? + val.value : + null; + } + }); +} + +return Sizzle; + +})( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; + +// Deprecated +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; +jQuery.escapeSelector = Sizzle.escape; + + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + + + +function nodeName( elem, name ) { + + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + +}; +var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); + + + +var risSimple = /^.[^:#\[\.,]*$/; + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + return !!qualifier.call( elem, i, elem ) !== not; + } ); + } + + // Single element + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + } + + // Arraylike of elements (jQuery, arguments, Array) + if ( typeof qualifier !== "string" ) { + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not; + } ); + } + + // Simple selector that can be filtered directly, removing non-Elements + if ( risSimple.test( qualifier ) ) { + return jQuery.filter( qualifier, elements, not ); + } + + // Complex selector, compare the two sets, removing non-Elements + qualifier = jQuery.filter( qualifier, elements ); + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1; + } ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + if ( elems.length === 1 && elem.nodeType === 1 ) { + return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; + } + + return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, ret, + len = this.length, + self = this; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + ret = this.pushStack( [] ); + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + return len > 1 ? jQuery.uniqueSort( ret ) : ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + // Shortcut simple #id case for speed + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Method init() accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector[ 0 ] === "<" && + selector[ selector.length - 1 ] === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // Option to run scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( jQuery.isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + if ( elem ) { + + // Inject the element directly into the jQuery object + this[ 0 ] = elem; + this.length = 1; + } + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return root.ready !== undefined ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // Methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var targets = jQuery( target, this ), + l = targets.length; + + return this.filter( function() { + var i = 0; + for ( ; i < l; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + targets = typeof selectors !== "string" && jQuery( selectors ); + + // Positional selectors never match, since there's no _selection_ context + if ( !rneedsContext.test( selectors ) ) { + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( targets ? + targets.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within the set + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // Index in selector + if ( typeof elem === "string" ) { + return indexOf.call( jQuery( elem ), this[ 0 ] ); + } + + // Locate the position of the desired element + return indexOf.call( this, + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem + ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + if ( nodeName( elem, "iframe" ) ) { + return elem.contentDocument; + } + + // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only + // Treat the template element as a regular one in browsers that + // don't support it. + if ( nodeName( elem, "template" ) ) { + elem = elem.content || elem; + } + + return jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var matched = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + matched = jQuery.filter( selector, matched ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + jQuery.uniqueSort( matched ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + matched.reverse(); + } + } + + return this.pushStack( matched ); + }; +} ); +var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = locked || options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( jQuery.isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = queue = []; + if ( !memory && !firing ) { + list = memory = ""; + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +function Identity( v ) { + return v; +} +function Thrower( ex ) { + throw ex; +} + +function adoptValue( value, resolve, reject, noValue ) { + var method; + + try { + + // Check for promise aspect first to privilege synchronous behavior + if ( value && jQuery.isFunction( ( method = value.promise ) ) ) { + method.call( value ).done( resolve ).fail( reject ); + + // Other thenables + } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) { + method.call( value, resolve, reject ); + + // Other non-thenables + } else { + + // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: + // * false: [ value ].slice( 0 ) => resolve( value ) + // * true: [ value ].slice( 1 ) => resolve() + resolve.apply( undefined, [ value ].slice( noValue ) ); + } + + // For Promises/A+, convert exceptions into rejections + // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in + // Deferred#then to conditionally suppress rejection. + } catch ( value ) { + + // Support: Android 4.0 only + // Strict mode functions invoked without .call/.apply get global-object context + reject.apply( undefined, [ value ] ); + } +} + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, callbacks, + // ... .then handlers, argument index, [final state] + [ "notify", "progress", jQuery.Callbacks( "memory" ), + jQuery.Callbacks( "memory" ), 2 ], + [ "resolve", "done", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 0, "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 1, "rejected" ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + "catch": function( fn ) { + return promise.then( null, fn ); + }, + + // Keep pipe for back-compat + pipe: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + + // Map tuples (progress, done, fail) to arguments (done, fail, progress) + var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; + + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + // deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + then: function( onFulfilled, onRejected, onProgress ) { + var maxDepth = 0; + function resolve( depth, deferred, handler, special ) { + return function() { + var that = this, + args = arguments, + mightThrow = function() { + var returned, then; + + // Support: Promises/A+ section 2.3.3.3.3 + // https://promisesaplus.com/#point-59 + // Ignore double-resolution attempts + if ( depth < maxDepth ) { + return; + } + + returned = handler.apply( that, args ); + + // Support: Promises/A+ section 2.3.1 + // https://promisesaplus.com/#point-48 + if ( returned === deferred.promise() ) { + throw new TypeError( "Thenable self-resolution" ); + } + + // Support: Promises/A+ sections 2.3.3.1, 3.5 + // https://promisesaplus.com/#point-54 + // https://promisesaplus.com/#point-75 + // Retrieve `then` only once + then = returned && + + // Support: Promises/A+ section 2.3.4 + // https://promisesaplus.com/#point-64 + // Only check objects and functions for thenability + ( typeof returned === "object" || + typeof returned === "function" ) && + returned.then; + + // Handle a returned thenable + if ( jQuery.isFunction( then ) ) { + + // Special processors (notify) just wait for resolution + if ( special ) { + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ) + ); + + // Normal processors (resolve) also hook into progress + } else { + + // ...and disregard older resolution values + maxDepth++; + + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ), + resolve( maxDepth, deferred, Identity, + deferred.notifyWith ) + ); + } + + // Handle all other returned values + } else { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Identity ) { + that = undefined; + args = [ returned ]; + } + + // Process the value(s) + // Default process is resolve + ( special || deferred.resolveWith )( that, args ); + } + }, + + // Only normal processors (resolve) catch and reject exceptions + process = special ? + mightThrow : + function() { + try { + mightThrow(); + } catch ( e ) { + + if ( jQuery.Deferred.exceptionHook ) { + jQuery.Deferred.exceptionHook( e, + process.stackTrace ); + } + + // Support: Promises/A+ section 2.3.3.3.4.1 + // https://promisesaplus.com/#point-61 + // Ignore post-resolution exceptions + if ( depth + 1 >= maxDepth ) { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Thrower ) { + that = undefined; + args = [ e ]; + } + + deferred.rejectWith( that, args ); + } + } + }; + + // Support: Promises/A+ section 2.3.3.3.1 + // https://promisesaplus.com/#point-57 + // Re-resolve promises immediately to dodge false rejection from + // subsequent errors + if ( depth ) { + process(); + } else { + + // Call an optional hook to record the stack, in case of exception + // since it's otherwise lost when execution goes async + if ( jQuery.Deferred.getStackHook ) { + process.stackTrace = jQuery.Deferred.getStackHook(); + } + window.setTimeout( process ); + } + }; + } + + return jQuery.Deferred( function( newDefer ) { + + // progress_handlers.add( ... ) + tuples[ 0 ][ 3 ].add( + resolve( + 0, + newDefer, + jQuery.isFunction( onProgress ) ? + onProgress : + Identity, + newDefer.notifyWith + ) + ); + + // fulfilled_handlers.add( ... ) + tuples[ 1 ][ 3 ].add( + resolve( + 0, + newDefer, + jQuery.isFunction( onFulfilled ) ? + onFulfilled : + Identity + ) + ); + + // rejected_handlers.add( ... ) + tuples[ 2 ][ 3 ].add( + resolve( + 0, + newDefer, + jQuery.isFunction( onRejected ) ? + onRejected : + Thrower + ) + ); + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 5 ]; + + // promise.progress = list.add + // promise.done = list.add + // promise.fail = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( + function() { + + // state = "resolved" (i.e., fulfilled) + // state = "rejected" + state = stateString; + }, + + // rejected_callbacks.disable + // fulfilled_callbacks.disable + tuples[ 3 - i ][ 2 ].disable, + + // progress_callbacks.lock + tuples[ 0 ][ 2 ].lock + ); + } + + // progress_handlers.fire + // fulfilled_handlers.fire + // rejected_handlers.fire + list.add( tuple[ 3 ].fire ); + + // deferred.notify = function() { deferred.notifyWith(...) } + // deferred.resolve = function() { deferred.resolveWith(...) } + // deferred.reject = function() { deferred.rejectWith(...) } + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); + return this; + }; + + // deferred.notifyWith = list.fireWith + // deferred.resolveWith = list.fireWith + // deferred.rejectWith = list.fireWith + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( singleValue ) { + var + + // count of uncompleted subordinates + remaining = arguments.length, + + // count of unprocessed arguments + i = remaining, + + // subordinate fulfillment data + resolveContexts = Array( i ), + resolveValues = slice.call( arguments ), + + // the master Deferred + master = jQuery.Deferred(), + + // subordinate callback factory + updateFunc = function( i ) { + return function( value ) { + resolveContexts[ i ] = this; + resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( !( --remaining ) ) { + master.resolveWith( resolveContexts, resolveValues ); + } + }; + }; + + // Single- and empty arguments are adopted like Promise.resolve + if ( remaining <= 1 ) { + adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, + !remaining ); + + // Use .then() to unwrap secondary thenables (cf. gh-3000) + if ( master.state() === "pending" || + jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { + + return master.then(); + } + } + + // Multiple arguments are aggregated like Promise.all array elements + while ( i-- ) { + adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); + } + + return master.promise(); + } +} ); + + +// These usually indicate a programmer mistake during development, +// warn about them ASAP rather than swallowing them by default. +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + +jQuery.Deferred.exceptionHook = function( error, stack ) { + + // Support: IE 8 - 9 only + // Console exists when dev tools are open, which can happen at any time + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); + } +}; + + + + +jQuery.readyException = function( error ) { + window.setTimeout( function() { + throw error; + } ); +}; + + + + +// The deferred used on DOM ready +var readyList = jQuery.Deferred(); + +jQuery.fn.ready = function( fn ) { + + readyList + .then( fn ) + + // Wrap jQuery.readyException in a function so that the lookup + // happens at the time of error handling instead of callback + // registration. + .catch( function( error ) { + jQuery.readyException( error ); + } ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + } +} ); + +jQuery.ready.then = readyList.then; + +// The ready event handler and self cleanup method +function completed() { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + jQuery.ready(); +} + +// Catch cases where $(document).ready() is called +// after the browser event has already occurred. +// Support: IE <=9 - 10 only +// Older IE sometimes signals "interactive" too soon +if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + +} else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); +} + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( jQuery.type( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !jQuery.isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + if ( chainable ) { + return elems; + } + + // Gets + if ( bulk ) { + return fn.call( elems ); + } + + return len ? fn( elems[ 0 ], key ) : emptyGet; +}; +var acceptData = function( owner ) { + + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + + + +function Data() { + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; + +Data.prototype = { + + cache: function( owner ) { + + // Check if the owner object already has a cache + var value = owner[ this.expando ]; + + // If not, create one + if ( !value ) { + value = {}; + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( acceptData( owner ) ) { + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } + } + } + + return value; + }, + set: function( owner, data, value ) { + var prop, + cache = this.cache( owner ); + + // Handle: [ owner, key, value ] args + // Always use camelCase key (gh-2257) + if ( typeof data === "string" ) { + cache[ jQuery.camelCase( data ) ] = value; + + // Handle: [ owner, { properties } ] args + } else { + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ jQuery.camelCase( prop ) ] = data[ prop ]; + } + } + return cache; + }, + get: function( owner, key ) { + return key === undefined ? + this.cache( owner ) : + + // Always use camelCase key (gh-2257) + owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ]; + }, + access: function( owner, key, value ) { + + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ( ( key && typeof key === "string" ) && value === undefined ) ) { + + return this.get( owner, key ); + } + + // When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, + cache = owner[ this.expando ]; + + if ( cache === undefined ) { + return; + } + + if ( key !== undefined ) { + + // Support array or space separated string of keys + if ( Array.isArray( key ) ) { + + // If key is an array of keys... + // We always set camelCase keys, so remove that. + key = key.map( jQuery.camelCase ); + } else { + key = jQuery.camelCase( key ); + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + key = key in cache ? + [ key ] : + ( key.match( rnothtmlwhite ) || [] ); + } + + i = key.length; + + while ( i-- ) { + delete cache[ key[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <=35 - 45 + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; + } + } + }, + hasData: function( owner ) { + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); + } +}; +var dataPriv = new Data(); + +var dataUser = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /[A-Z]/g; + +function getData( data ) { + if ( data === "true" ) { + return true; + } + + if ( data === "false" ) { + return false; + } + + if ( data === "null" ) { + return null; + } + + // Only convert to a number if it doesn't change the string + if ( data === +data + "" ) { + return +data; + } + + if ( rbrace.test( data ) ) { + return JSON.parse( data ); + } + + return data; +} + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = getData( data ); + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + dataUser.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend( { + hasData: function( elem ) { + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return dataUser.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + dataUser.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to dataPriv methods, these can be deprecated. + _data: function( elem, name, data ) { + return dataPriv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + dataPriv.remove( elem, name ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = dataUser.get( elem ); + + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE 11 only + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + dataPriv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + dataUser.set( this, key ); + } ); + } + + return access( this, function( value ) { + var data; + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + + // Attempt to get data from the cache + // The key will always be camelCased in Data + data = dataUser.get( elem, key ); + if ( data !== undefined ) { + return data; + } + + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, key ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + this.each( function() { + + // We always store the camelCased key + dataUser.set( this, key, value ); + } ); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each( function() { + dataUser.remove( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = dataPriv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || Array.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var isHiddenWithinTree = function( elem, el ) { + + // isHiddenWithinTree might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + + // Inline style trumps all + return elem.style.display === "none" || + elem.style.display === "" && + + // Otherwise, check computed style + // Support: Firefox <=43 - 45 + // Disconnected elements can have computed display: none, so first confirm that elem is + // in the document. + jQuery.contains( elem.ownerDocument, elem ) && + + jQuery.css( elem, "display" ) === "none"; + }; + +var swap = function( elem, options, callback, args ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.apply( elem, args || [] ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, + scale = 1, + maxIterations = 20, + currentValue = tween ? + function() { + return tween.cur(); + } : + function() { + return jQuery.css( elem, prop, "" ); + }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + do { + + // If previous iteration zeroed out, double until we get *something*. + // Use string for doubling so we don't accidentally see scale as unchanged below + scale = scale || ".5"; + + // Adjust and apply + initialInUnit = initialInUnit / scale; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Update scale, tolerating zero or NaN from tween.cur() + // Break the loop if scale is unchanged or perfect, or if we've just had enough. + } while ( + scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations + ); + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +var defaultDisplayMap = {}; + +function getDefaultDisplay( elem ) { + var temp, + doc = elem.ownerDocument, + nodeName = elem.nodeName, + display = defaultDisplayMap[ nodeName ]; + + if ( display ) { + return display; + } + + temp = doc.body.appendChild( doc.createElement( nodeName ) ); + display = jQuery.css( temp, "display" ); + + temp.parentNode.removeChild( temp ); + + if ( display === "none" ) { + display = "block"; + } + defaultDisplayMap[ nodeName ] = display; + + return display; +} + +function showHide( elements, show ) { + var display, elem, + values = [], + index = 0, + length = elements.length; + + // Determine new display value for elements that need to change + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + display = elem.style.display; + if ( show ) { + + // Since we force visibility upon cascade-hidden elements, an immediate (and slow) + // check is required in this first loop unless we have a nonempty display value (either + // inline or about-to-be-restored) + if ( display === "none" ) { + values[ index ] = dataPriv.get( elem, "display" ) || null; + if ( !values[ index ] ) { + elem.style.display = ""; + } + } + if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { + values[ index ] = getDefaultDisplay( elem ); + } + } else { + if ( display !== "none" ) { + values[ index ] = "none"; + + // Remember what we're overwriting + dataPriv.set( elem, "display", display ); + } + } + } + + // Set the display of the elements in a second loop to avoid constant reflow + for ( index = 0; index < length; index++ ) { + if ( values[ index ] != null ) { + elements[ index ].style.display = values[ index ]; + } + } + + return elements; +} + +jQuery.fn.extend( { + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each( function() { + if ( isHiddenWithinTree( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + } ); + } +} ); +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i ); + +var rscriptType = ( /^$|\/(?:java|ecma)script/i ); + + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + + // Support: IE <=9 only + option: [ 1, "" ], + + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting or other required elements. + thead: [ 1, "", "
" ], + col: [ 2, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + + _default: [ 0, "", "" ] +}; + +// Support: IE <=9 only +wrapMap.optgroup = wrapMap.option; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + + +function getAll( context, tag ) { + + // Support: IE <=9 - 11 only + // Use typeof to avoid zero-argument method invocation on host objects (#15151) + var ret; + + if ( typeof context.getElementsByTagName !== "undefined" ) { + ret = context.getElementsByTagName( tag || "*" ); + + } else if ( typeof context.querySelectorAll !== "undefined" ) { + ret = context.querySelectorAll( tag || "*" ); + + } else { + ret = []; + } + + if ( tag === undefined || tag && nodeName( context, tag ) ) { + return jQuery.merge( [ context ], ret ); + } + + return ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, contains, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( jQuery.type( elem ) === "object" ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; +} + + +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0 - 4.3 only + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Android <=4.1 only + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE <=11 only + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; +} )(); +var documentElement = document.documentElement; + + + +var + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE <=9 only +// See #13393 for more info +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.get( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Ensure that invalid selectors throw exceptions at attach time + // Evaluate against documentElement in case elem is a non-element node (e.g., document) + if ( selector ) { + jQuery.find.matchesSelector( documentElement, selector ); + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = {}; + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove data and the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + dataPriv.remove( elem, "handle events" ); + } + }, + + dispatch: function( nativeEvent ) { + + // Make a writable jQuery.Event from the native event object + var event = jQuery.event.fix( nativeEvent ); + + var i, j, ret, matched, handleObj, handlerQueue, + args = new Array( arguments.length ), + handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + + for ( i = 1; i < arguments.length; i++ ) { + args[ i ] = arguments[ i ]; + } + + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or 2) have namespace(s) + // a subset or equal to those in the bound event (both can have no namespace). + if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, handleObj, sel, matchedHandlers, matchedSelectors, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + if ( delegateCount && + + // Support: IE <=9 + // Black-hole SVG instance trees (trac-13180) + cur.nodeType && + + // Support: Firefox <=42 + // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) + // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click + // Support: IE 11 only + // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) + !( event.type === "click" && event.button >= 1 ) ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { + matchedHandlers = []; + matchedSelectors = {}; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matchedSelectors[ sel ] === undefined ) { + matchedSelectors[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matchedSelectors[ sel ] ) { + matchedHandlers.push( handleObj ); + } + } + if ( matchedHandlers.length ) { + handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + cur = this; + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + addProp: function( name, hook ) { + Object.defineProperty( jQuery.Event.prototype, name, { + enumerable: true, + configurable: true, + + get: jQuery.isFunction( hook ) ? + function() { + if ( this.originalEvent ) { + return hook( this.originalEvent ); + } + } : + function() { + if ( this.originalEvent ) { + return this.originalEvent[ name ]; + } + }, + + set: function( value ) { + Object.defineProperty( this, name, { + enumerable: true, + configurable: true, + writable: true, + value: value + } ); + } + } ); + }, + + fix: function( originalEvent ) { + return originalEvent[ jQuery.expando ] ? + originalEvent : + new jQuery.Event( originalEvent ); + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + focus: { + + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== safeActiveElement() && this.focus ) { + this.focus(); + return false; + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === safeActiveElement() && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + click: { + + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) { + this.click(); + return false; + } + }, + + // For cross-browser consistency, don't fire native .click() on links + _default: function( event ) { + return nodeName( event.target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + } +}; + +jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } +}; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: Android <=2.3 only + src.returnValue === false ? + returnTrue : + returnFalse; + + // Create target properties + // Support: Safari <=6 - 7 only + // Target should not be a text node (#504, #13143) + this.target = ( src.target && src.target.nodeType === 3 ) ? + src.target.parentNode : + src.target; + + this.currentTarget = src.currentTarget; + this.relatedTarget = src.relatedTarget; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + isSimulated: false, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e && !this.isSimulated ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Includes all common event props including KeyEvent and MouseEvent specific props +jQuery.each( { + altKey: true, + bubbles: true, + cancelable: true, + changedTouches: true, + ctrlKey: true, + detail: true, + eventPhase: true, + metaKey: true, + pageX: true, + pageY: true, + shiftKey: true, + view: true, + "char": true, + charCode: true, + key: true, + keyCode: true, + button: true, + buttons: true, + clientX: true, + clientY: true, + offsetX: true, + offsetY: true, + pointerId: true, + pointerType: true, + screenX: true, + screenY: true, + targetTouches: true, + toElement: true, + touches: true, + + which: function( event ) { + var button = event.button; + + // Add which for key events + if ( event.which == null && rkeyEvent.test( event.type ) ) { + return event.charCode != null ? event.charCode : event.keyCode; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { + if ( button & 1 ) { + return 1; + } + + if ( button & 2 ) { + return 3; + } + + if ( button & 4 ) { + return 2; + } + + return 0; + } + + return event.which; + } +}, jQuery.event.addProp ); + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +jQuery.fn.extend( { + + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + } +} ); + + +var + + /* eslint-disable max-len */ + + // See https://github.com/eslint/eslint/issues/3229 + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, + + /* eslint-enable */ + + // Support: IE <=10 - 11, Edge 12 - 13 + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g; + +// Prefer a tbody over its parent table for containing new rows +function manipulationTarget( elem, content ) { + if ( nodeName( elem, "table" ) && + nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { + + return jQuery( ">tbody", elem )[ 0 ] || elem; + } + + return elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + var match = rscriptTypeMasked.exec( elem.type ); + + if ( match ) { + elem.type = match[ 1 ]; + } else { + elem.removeAttribute( "type" ); + } + + return elem; +} + +function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; + + if ( dest.nodeType !== 1 ) { + return; + } + + // 1. Copy private data: events, handlers, etc. + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.access( src ); + pdataCur = dataPriv.set( dest, pdataOld ); + events = pdataOld.events; + + if ( events ) { + delete pdataCur.handle; + pdataCur.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + } + + // 2. Copy user data + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); + udataCur = jQuery.extend( {}, udataOld ); + + dataUser.set( dest, udataCur ); + } +} + +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); + + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; + + // Fails to return the selected option to the default selected state when cloning options + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = concat.apply( [], args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + isFunction = jQuery.isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( isFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( isFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl ) { + jQuery._evalUrl( node.src ); + } + } else { + DOMEval( node.textContent.replace( rcleanScript, "" ), doc ); + } + } + } + } + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html.replace( rxhtmlTag, "<$1>" ); + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = jQuery.contains( elem.ownerDocument, elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; + }, + + cleanData: function( elems ) { + var data, elem, type, + special = jQuery.event.special, + i = 0; + + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; + } + } + } + } +} ); + +jQuery.fn.extend( { + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each( function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + } ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: Android <=4.0 only, PhantomJS 1 only + // .get() because push.apply(_, arraylike) throws on ancient WebKit + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); +var rmargin = ( /^margin/ ); + +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); + +var getStyles = function( elem ) { + + // Support: IE <=11 only, Firefox <=30 (#15098, #14150) + // IE throws on elements created in popups + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" + var view = elem.ownerDocument.defaultView; + + if ( !view || !view.opener ) { + view = window; + } + + return view.getComputedStyle( elem ); + }; + + + +( function() { + + // Executing both pixelPosition & boxSizingReliable tests require only one layout + // so they're executed at the same time to save the second computation. + function computeStyleTests() { + + // This is a singleton, we need to execute it only once + if ( !div ) { + return; + } + + div.style.cssText = + "box-sizing:border-box;" + + "position:relative;display:block;" + + "margin:auto;border:1px;padding:1px;" + + "top:1%;width:50%"; + div.innerHTML = ""; + documentElement.appendChild( container ); + + var divStyle = window.getComputedStyle( div ); + pixelPositionVal = divStyle.top !== "1%"; + + // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 + reliableMarginLeftVal = divStyle.marginLeft === "2px"; + boxSizingReliableVal = divStyle.width === "4px"; + + // Support: Android 4.0 - 4.3 only + // Some styles come back with percentage values, even though they shouldn't + div.style.marginRight = "50%"; + pixelMarginRightVal = divStyle.marginRight === "4px"; + + documentElement.removeChild( container ); + + // Nullify the div so it wouldn't be stored in the memory and + // it will also be a sign that checks already performed + div = null; + } + + var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal, + container = document.createElement( "div" ), + div = document.createElement( "div" ); + + // Finish early in limited (non-browser) environments + if ( !div.style ) { + return; + } + + // Support: IE <=9 - 11 only + // Style of cloned element affects source element cloned (#8908) + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + + "padding:0;margin-top:1px;position:absolute"; + container.appendChild( div ); + + jQuery.extend( support, { + pixelPosition: function() { + computeStyleTests(); + return pixelPositionVal; + }, + boxSizingReliable: function() { + computeStyleTests(); + return boxSizingReliableVal; + }, + pixelMarginRight: function() { + computeStyleTests(); + return pixelMarginRightVal; + }, + reliableMarginLeft: function() { + computeStyleTests(); + return reliableMarginLeftVal; + } + } ); +} )(); + + +function curCSS( elem, name, computed ) { + var width, minWidth, maxWidth, ret, + + // Support: Firefox 51+ + // Retrieving style before computed somehow + // fixes an issue with getting wrong values + // on detached elements + style = elem.style; + + computed = computed || getStyles( elem ); + + // getPropertyValue is needed for: + // .css('filter') (IE 9 only, #12537) + // .css('--customProperty) (#3144) + if ( computed ) { + ret = computed.getPropertyValue( name ) || computed[ name ]; + + if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Android Browser returns percentage for some values, + // but width seems to be reliably pixels. + // This is against the CSSOM draft spec: + // https://drafts.csswg.org/cssom/#resolved-values + if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret !== undefined ? + + // Support: IE <=9 - 11 only + // IE returns zIndex value as an integer. + ret + "" : + ret; +} + + +function addGetHookIf( conditionFn, hookFn ) { + + // Define the hook, we'll check on the first run if it's really needed. + return { + get: function() { + if ( conditionFn() ) { + + // Hook not needed (or it's not possible to use it due + // to missing dependency), remove it. + delete this.get; + return; + } + + // Hook needed; redefine it so that the support test is not executed again. + return ( this.get = hookFn ).apply( this, arguments ); + } + }; +} + + +var + + // Swappable if display is none or starts with table + // except "table", "table-cell", or "table-caption" + // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rcustomProp = /^--/, + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: "0", + fontWeight: "400" + }, + + cssPrefixes = [ "Webkit", "Moz", "ms" ], + emptyStyle = document.createElement( "div" ).style; + +// Return a css property mapped to a potentially vendor prefixed property +function vendorPropName( name ) { + + // Shortcut for names that are not vendor prefixed + if ( name in emptyStyle ) { + return name; + } + + // Check for vendor prefixed names + var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in emptyStyle ) { + return name; + } + } +} + +// Return a property mapped along what jQuery.cssProps suggests or to +// a vendor prefixed property. +function finalPropName( name ) { + var ret = jQuery.cssProps[ name ]; + if ( !ret ) { + ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name; + } + return ret; +} + +function setPositiveNumber( elem, value, subtract ) { + + // Any relative (+/-) values have already been + // normalized at this point + var matches = rcssNum.exec( value ); + return matches ? + + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : + value; +} + +function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { + var i, + val = 0; + + // If we already have the right measurement, avoid augmentation + if ( extra === ( isBorderBox ? "border" : "content" ) ) { + i = 4; + + // Otherwise initialize for horizontal or vertical properties + } else { + i = name === "width" ? 1 : 0; + } + + for ( ; i < 4; i += 2 ) { + + // Both box models exclude margin, so add it if we want it + if ( extra === "margin" ) { + val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); + } + + if ( isBorderBox ) { + + // border-box includes padding, so remove it if we want content + if ( extra === "content" ) { + val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } + + // At this point, extra isn't border nor margin, so remove border + if ( extra !== "margin" ) { + val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } else { + + // At this point, extra isn't content, so add padding + val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // At this point, extra isn't content nor padding, so add border + if ( extra !== "padding" ) { + val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + return val; +} + +function getWidthOrHeight( elem, name, extra ) { + + // Start with computed style + var valueIsBorderBox, + styles = getStyles( elem ), + val = curCSS( elem, name, styles ), + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; + + // Computed unit is not pixels. Stop here and return. + if ( rnumnonpx.test( val ) ) { + return val; + } + + // Check for style in case a browser which returns unreliable values + // for getComputedStyle silently falls back to the reliable elem.style + valueIsBorderBox = isBorderBox && + ( support.boxSizingReliable() || val === elem.style[ name ] ); + + // Fall back to offsetWidth/Height when value is "auto" + // This happens for inline elements with no explicit setting (gh-3571) + if ( val === "auto" ) { + val = elem[ "offset" + name[ 0 ].toUpperCase() + name.slice( 1 ) ]; + } + + // Normalize "", auto, and prepare for extra + val = parseFloat( val ) || 0; + + // Use the active box-sizing model to add/subtract irrelevant styles + return ( val + + augmentWidthOrHeight( + elem, + name, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles + ) + ) + "px"; +} + +jQuery.extend( { + + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + } + } + } + }, + + // Don't automatically add "px" to these possibly-unitless properties + cssNumber: { + "animationIterationCount": true, + "columnCount": true, + "fillOpacity": true, + "flexGrow": true, + "flexShrink": true, + "fontWeight": true, + "lineHeight": true, + "opacity": true, + "order": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: { + "float": "cssFloat" + }, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = jQuery.camelCase( name ), + isCustomProp = rcustomProp.test( name ), + style = elem.style; + + // Make sure that we're working with the right name. We don't + // want to query the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Gets hook for the prefixed version, then unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // Convert "+=" or "-=" to relative numbers (#7345) + if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { + value = adjustCSS( elem, name, ret ); + + // Fixes bug #9237 + type = "number"; + } + + // Make sure that null and NaN values aren't set (#7116) + if ( value == null || value !== value ) { + return; + } + + // If a number was passed in, add the unit (except for certain CSS properties) + if ( type === "number" ) { + value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); + } + + // background-* props affect original clone's values + if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !( "set" in hooks ) || + ( value = hooks.set( elem, value, extra ) ) !== undefined ) { + + if ( isCustomProp ) { + style.setProperty( name, value ); + } else { + style[ name ] = value; + } + } + + } else { + + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && + ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { + + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var val, num, hooks, + origName = jQuery.camelCase( name ), + isCustomProp = rcustomProp.test( name ); + + // Make sure that we're working with the right name. We don't + // want to modify the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Try prefixed name followed by the unprefixed name + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + // Convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Make numeric if forced or a qualifier was provided and val looks numeric + if ( extra === "" || extra ) { + num = parseFloat( val ); + return extra === true || isFinite( num ) ? num || 0 : val; + } + + return val; + } +} ); + +jQuery.each( [ "height", "width" ], function( i, name ) { + jQuery.cssHooks[ name ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + + // Certain elements can have dimension info if we invisibly show them + // but it must have a current display style that would benefit + return rdisplayswap.test( jQuery.css( elem, "display" ) ) && + + // Support: Safari 8+ + // Table columns in Safari have non-zero offsetWidth & zero + // getBoundingClientRect().width unless display is changed. + // Support: IE <=11 only + // Running getBoundingClientRect on a disconnected node + // in IE throws an error. + ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? + swap( elem, cssShow, function() { + return getWidthOrHeight( elem, name, extra ); + } ) : + getWidthOrHeight( elem, name, extra ); + } + }, + + set: function( elem, value, extra ) { + var matches, + styles = extra && getStyles( elem ), + subtract = extra && augmentWidthOrHeight( + elem, + name, + extra, + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + styles + ); + + // Convert to pixels if value adjustment is needed + if ( subtract && ( matches = rcssNum.exec( value ) ) && + ( matches[ 3 ] || "px" ) !== "px" ) { + + elem.style[ name ] = value; + value = jQuery.css( elem, name ); + } + + return setPositiveNumber( elem, value, subtract ); + } + }; +} ); + +jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, + function( elem, computed ) { + if ( computed ) { + return ( parseFloat( curCSS( elem, "marginLeft" ) ) || + elem.getBoundingClientRect().left - + swap( elem, { marginLeft: 0 }, function() { + return elem.getBoundingClientRect().left; + } ) + ) + "px"; + } + } +); + +// These hooks are used by animate to expand properties +jQuery.each( { + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i = 0, + expanded = {}, + + // Assumes a single number if not a string + parts = typeof value === "string" ? value.split( " " ) : [ value ]; + + for ( ; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( !rmargin.test( prefix ) ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +} ); + +jQuery.fn.extend( { + css: function( name, value ) { + return access( this, function( elem, name, value ) { + var styles, len, + map = {}, + i = 0; + + if ( Array.isArray( name ) ) { + styles = getStyles( elem ); + len = name.length; + + for ( ; i < len; i++ ) { + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); + } + + return map; + } + + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + } +} ); + + +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; + +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || jQuery.easing._default; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; + + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; + + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; + + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + // Use a property on the element directly when it is not a DOM element, + // or when there is no matching style property that exists. + if ( tween.elem.nodeType !== 1 || + tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { + return tween.elem[ tween.prop ]; + } + + // Passing an empty string as a 3rd parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails. + // Simple values such as "10px" are parsed to Float; + // complex values such as "rotate(1rad)" are returned as-is. + result = jQuery.css( tween.elem, tween.prop, "" ); + + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + + // Use step hook for back compat. + // Use cssHook if its there. + // Use .style if available and use plain properties where available. + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.nodeType === 1 && + ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || + jQuery.cssHooks[ tween.prop ] ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; + } + } + } +}; + +// Support: IE <=9 only +// Panic based approach to setting things on disconnected nodes +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; + +jQuery.easing = { + linear: function( p ) { + return p; + }, + swing: function( p ) { + return 0.5 - Math.cos( p * Math.PI ) / 2; + }, + _default: "swing" +}; + +jQuery.fx = Tween.prototype.init; + +// Back compat <1.8 extension point +jQuery.fx.step = {}; + + + + +var + fxNow, inProgress, + rfxtypes = /^(?:toggle|show|hide)$/, + rrun = /queueHooks$/; + +function schedule() { + if ( inProgress ) { + if ( document.hidden === false && window.requestAnimationFrame ) { + window.requestAnimationFrame( schedule ); + } else { + window.setTimeout( schedule, jQuery.fx.interval ); + } + + jQuery.fx.tick(); + } +} + +// Animations created synchronously will run synchronously +function createFxNow() { + window.setTimeout( function() { + fxNow = undefined; + } ); + return ( fxNow = jQuery.now() ); +} + +// Generate parameters to create a standard animation +function genFx( type, includeWidth ) { + var which, + i = 0, + attrs = { height: type }; + + // If we include width, step value is 1 to do all cssExpand values, + // otherwise step value is 2 to skip over Left and Right + includeWidth = includeWidth ? 1 : 0; + for ( ; i < 4; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } + + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } + + return attrs; +} + +function createTween( value, prop, animation ) { + var tween, + collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { + + // We're done with this property + return tween; + } + } +} + +function defaultPrefilter( elem, props, opts ) { + var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, + isBox = "width" in props || "height" in props, + anim = this, + orig = {}, + style = elem.style, + hidden = elem.nodeType && isHiddenWithinTree( elem ), + dataShow = dataPriv.get( elem, "fxshow" ); + + // Queue-skipping animations hijack the fx hooks + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; + } + hooks.unqueued++; + + anim.always( function() { + + // Ensure the complete handler is called before this completes + anim.always( function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + } ); + } ); + } + + // Detect show/hide animations + for ( prop in props ) { + value = props[ prop ]; + if ( rfxtypes.test( value ) ) { + delete props[ prop ]; + toggle = toggle || value === "toggle"; + if ( value === ( hidden ? "hide" : "show" ) ) { + + // Pretend to be hidden if this is a "show" and + // there is still data from a stopped show/hide + if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { + hidden = true; + + // Ignore all other no-op show/hide data + } else { + continue; + } + } + orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); + } + } + + // Bail out if this is a no-op like .hide().hide() + propTween = !jQuery.isEmptyObject( props ); + if ( !propTween && jQuery.isEmptyObject( orig ) ) { + return; + } + + // Restrict "overflow" and "display" styles during box animations + if ( isBox && elem.nodeType === 1 ) { + + // Support: IE <=9 - 11, Edge 12 - 13 + // Record all 3 overflow attributes because IE does not infer the shorthand + // from identically-valued overflowX and overflowY + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; + + // Identify a display type, preferring old show/hide data over the CSS cascade + restoreDisplay = dataShow && dataShow.display; + if ( restoreDisplay == null ) { + restoreDisplay = dataPriv.get( elem, "display" ); + } + display = jQuery.css( elem, "display" ); + if ( display === "none" ) { + if ( restoreDisplay ) { + display = restoreDisplay; + } else { + + // Get nonempty value(s) by temporarily forcing visibility + showHide( [ elem ], true ); + restoreDisplay = elem.style.display || restoreDisplay; + display = jQuery.css( elem, "display" ); + showHide( [ elem ] ); + } + } + + // Animate inline elements as inline-block + if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { + if ( jQuery.css( elem, "float" ) === "none" ) { + + // Restore the original display value at the end of pure show/hide animations + if ( !propTween ) { + anim.done( function() { + style.display = restoreDisplay; + } ); + if ( restoreDisplay == null ) { + display = style.display; + restoreDisplay = display === "none" ? "" : display; + } + } + style.display = "inline-block"; + } + } + } + + if ( opts.overflow ) { + style.overflow = "hidden"; + anim.always( function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + } ); + } + + // Implement show/hide animations + propTween = false; + for ( prop in orig ) { + + // General show/hide setup for this element animation + if ( !propTween ) { + if ( dataShow ) { + if ( "hidden" in dataShow ) { + hidden = dataShow.hidden; + } + } else { + dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); + } + + // Store hidden/visible for toggle so `.stop().toggle()` "reverses" + if ( toggle ) { + dataShow.hidden = !hidden; + } + + // Show elements before animating them + if ( hidden ) { + showHide( [ elem ], true ); + } + + /* eslint-disable no-loop-func */ + + anim.done( function() { + + /* eslint-enable no-loop-func */ + + // The final step of a "hide" animation is actually hiding the element + if ( !hidden ) { + showHide( [ elem ] ); + } + dataPriv.remove( elem, "fxshow" ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + } ); + } + + // Per-property setup + propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = propTween.start; + if ( hidden ) { + propTween.end = propTween.start; + propTween.start = 0; + } + } + } +} + +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; + + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = jQuery.camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( Array.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; + } + + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } + + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; + + // Not quite $.extend, this won't overwrite existing keys. + // Reusing 'index' because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} + +function Animation( elem, properties, options ) { + var result, + stopped, + index = 0, + length = Animation.prefilters.length, + deferred = jQuery.Deferred().always( function() { + + // Don't match elem in the :animated selector + delete tick.elem; + } ), + tick = function() { + if ( stopped ) { + return false; + } + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + + // Support: Android 2.3 only + // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) + temp = remaining / animation.duration || 0, + percent = 1 - temp, + index = 0, + length = animation.tweens.length; + + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ] ); + + // If there's more to do, yield + if ( percent < 1 && length ) { + return remaining; + } + + // If this was an empty animation, synthesize a final progress notification + if ( !length ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + } + + // Resolve the animation and report its conclusion + deferred.resolveWith( elem, [ animation ] ); + return false; + }, + animation = deferred.promise( { + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { + specialEasing: {}, + easing: jQuery.easing._default + }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + + // If we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; + if ( stopped ) { + return this; + } + stopped = true; + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( 1 ); + } + + // Resolve when we played the last frame; otherwise, reject + if ( gotoEnd ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); + } + return this; + } + } ), + props = animation.props; + + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length; index++ ) { + result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + if ( jQuery.isFunction( result.stop ) ) { + jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = + jQuery.proxy( result.stop, result ); + } + return result; + } + } + + jQuery.map( props, createTween, animation ); + + if ( jQuery.isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } + + // Attach callbacks from options + animation + .progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); + + jQuery.fx.timer( + jQuery.extend( tick, { + elem: elem, + anim: animation, + queue: animation.opts.queue + } ) + ); + + return animation; +} + +jQuery.Animation = jQuery.extend( Animation, { + + tweeners: { + "*": [ function( prop, value ) { + var tween = this.createTween( prop, value ); + adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); + return tween; + } ] + }, + + tweener: function( props, callback ) { + if ( jQuery.isFunction( props ) ) { + callback = props; + props = [ "*" ]; + } else { + props = props.match( rnothtmlwhite ); + } + + var prop, + index = 0, + length = props.length; + + for ( ; index < length; index++ ) { + prop = props[ index ]; + Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; + Animation.tweeners[ prop ].unshift( callback ); + } + }, + + prefilters: [ defaultPrefilter ], + + prefilter: function( callback, prepend ) { + if ( prepend ) { + Animation.prefilters.unshift( callback ); + } else { + Animation.prefilters.push( callback ); + } + } +} ); + +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + jQuery.isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing + }; + + // Go to the end state if fx are off + if ( jQuery.fx.off ) { + opt.duration = 0; + + } else { + if ( typeof opt.duration !== "number" ) { + if ( opt.duration in jQuery.fx.speeds ) { + opt.duration = jQuery.fx.speeds[ opt.duration ]; + + } else { + opt.duration = jQuery.fx.speeds._default; + } + } + } + + // Normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; + } + + // Queueing + opt.old = opt.complete; + + opt.complete = function() { + if ( jQuery.isFunction( opt.old ) ) { + opt.old.call( this ); + } + + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); + } + }; + + return opt; +}; + +jQuery.fn.extend( { + fadeTo: function( speed, to, easing, callback ) { + + // Show any hidden elements after setting opacity to 0 + return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() + + // Animate to the value specified + .end().animate( { opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); + + // Empty animations, or finishing resolves immediately + if ( empty || dataPriv.get( this, "finish" ) ) { + anim.stop( true ); + } + }; + doAnimation.finish = doAnimation; + + return empty || optall.queue === false ? + this.each( doAnimation ) : + this.queue( optall.queue, doAnimation ); + }, + stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } + if ( clearQueue && type !== false ) { + this.queue( type || "fx", [] ); + } + + return this.each( function() { + var dequeue = true, + index = type != null && type + "queueHooks", + timers = jQuery.timers, + data = dataPriv.get( this ); + + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { + for ( index in data ) { + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); + } + } + } + + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && + ( type == null || timers[ index ].queue === type ) ) { + + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; + timers.splice( index, 1 ); + } + } + + // Start the next in the queue if the last step wasn't forced. + // Timers currently will call their complete callbacks, which + // will dequeue but only if they were gotoEnd. + if ( dequeue || !gotoEnd ) { + jQuery.dequeue( this, type ); + } + } ); + }, + finish: function( type ) { + if ( type !== false ) { + type = type || "fx"; + } + return this.each( function() { + var index, + data = dataPriv.get( this ), + queue = data[ type + "queue" ], + hooks = data[ type + "queueHooks" ], + timers = jQuery.timers, + length = queue ? queue.length : 0; + + // Enable finishing flag on private data + data.finish = true; + + // Empty the queue first + jQuery.queue( this, type, [] ); + + if ( hooks && hooks.stop ) { + hooks.stop.call( this, true ); + } + + // Look for any active animations, and finish them + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && timers[ index ].queue === type ) { + timers[ index ].anim.stop( true ); + timers.splice( index, 1 ); + } + } + + // Look for any animations in the old queue and finish them + for ( index = 0; index < length; index++ ) { + if ( queue[ index ] && queue[ index ].finish ) { + queue[ index ].finish.call( this ); + } + } + + // Turn off finishing flag + delete data.finish; + } ); + } +} ); + +jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +} ); + +// Generate shortcuts for custom animations +jQuery.each( { + slideDown: genFx( "show" ), + slideUp: genFx( "hide" ), + slideToggle: genFx( "toggle" ), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +} ); + +jQuery.timers = []; +jQuery.fx.tick = function() { + var timer, + i = 0, + timers = jQuery.timers; + + fxNow = jQuery.now(); + + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + + // Run the timer and safely remove it when done (allowing for external removal) + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } + fxNow = undefined; +}; + +jQuery.fx.timer = function( timer ) { + jQuery.timers.push( timer ); + jQuery.fx.start(); +}; + +jQuery.fx.interval = 13; +jQuery.fx.start = function() { + if ( inProgress ) { + return; + } + + inProgress = true; + schedule(); +}; + +jQuery.fx.stop = function() { + inProgress = null; +}; + +jQuery.fx.speeds = { + slow: 600, + fast: 200, + + // Default speed + _default: 400 +}; + + +// Based off of the plugin by Clint Helfers, with permission. +// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ +jQuery.fn.delay = function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = window.setTimeout( next, time ); + hooks.stop = function() { + window.clearTimeout( timeout ); + }; + } ); +}; + + +( function() { + var input = document.createElement( "input" ), + select = document.createElement( "select" ), + opt = select.appendChild( document.createElement( "option" ) ); + + input.type = "checkbox"; + + // Support: Android <=4.3 only + // Default value for a checkbox should be "on" + support.checkOn = input.value !== ""; + + // Support: IE <=11 only + // Must access selectedIndex to make default options select + support.optSelected = opt.selected; + + // Support: IE <=11 only + // An input loses its value after becoming a radio + input = document.createElement( "input" ); + input.value = "t"; + input.type = "radio"; + support.radioValue = input.value === "t"; +} )(); + + +var boolHook, + attrHandle = jQuery.expr.attrHandle; + +jQuery.fn.extend( { + attr: function( name, value ) { + return access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each( function() { + jQuery.removeAttr( this, name ); + } ); + } +} ); + +jQuery.extend( { + attr: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set attributes on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + // Attribute hooks are determined by the lowercase version + // Grab necessary hook if one is defined + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + hooks = jQuery.attrHooks[ name.toLowerCase() ] || + ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); + } + + if ( value !== undefined ) { + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + } + + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + elem.setAttribute( name, value + "" ); + return value; + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + ret = jQuery.find.attr( elem, name ); + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? undefined : ret; + }, + + attrHooks: { + type: { + set: function( elem, value ) { + if ( !support.radioValue && value === "radio" && + nodeName( elem, "input" ) ) { + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + } + }, + + removeAttr: function( elem, value ) { + var name, + i = 0, + + // Attribute names can contain non-HTML whitespace characters + // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 + attrNames = value && value.match( rnothtmlwhite ); + + if ( attrNames && elem.nodeType === 1 ) { + while ( ( name = attrNames[ i++ ] ) ) { + elem.removeAttribute( name ); + } + } + } +} ); + +// Hooks for boolean attributes +boolHook = { + set: function( elem, value, name ) { + if ( value === false ) { + + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + elem.setAttribute( name, name ); + } + return name; + } +}; + +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { + var getter = attrHandle[ name ] || jQuery.find.attr; + + attrHandle[ name ] = function( elem, name, isXML ) { + var ret, handle, + lowercaseName = name.toLowerCase(); + + if ( !isXML ) { + + // Avoid an infinite loop by temporarily removing this function from the getter + handle = attrHandle[ lowercaseName ]; + attrHandle[ lowercaseName ] = ret; + ret = getter( elem, name, isXML ) != null ? + lowercaseName : + null; + attrHandle[ lowercaseName ] = handle; + } + return ret; + }; +} ); + + + + +var rfocusable = /^(?:input|select|textarea|button)$/i, + rclickable = /^(?:a|area)$/i; + +jQuery.fn.extend( { + prop: function( name, value ) { + return access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + return this.each( function() { + delete this[ jQuery.propFix[ name ] || name ]; + } ); + } +} ); + +jQuery.extend( { + prop: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set properties on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + return ( elem[ name ] = value ); + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + return elem[ name ]; + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + + // Support: IE <=9 - 11 only + // elem.tabIndex doesn't always return the + // correct value when it hasn't been explicitly set + // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + // Use proper attribute retrieval(#12072) + var tabindex = jQuery.find.attr( elem, "tabindex" ); + + if ( tabindex ) { + return parseInt( tabindex, 10 ); + } + + if ( + rfocusable.test( elem.nodeName ) || + rclickable.test( elem.nodeName ) && + elem.href + ) { + return 0; + } + + return -1; + } + } + }, + + propFix: { + "for": "htmlFor", + "class": "className" + } +} ); + +// Support: IE <=11 only +// Accessing the selectedIndex property +// forces the browser to respect setting selected +// on the option +// The getter ensures a default option is selected +// when in an optgroup +// eslint rule "no-unused-expressions" is disabled for this code +// since it considers such accessions noop +if ( !support.optSelected ) { + jQuery.propHooks.selected = { + get: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent && parent.parentNode ) { + parent.parentNode.selectedIndex; + } + return null; + }, + set: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + }; +} + +jQuery.each( [ + "tabIndex", + "readOnly", + "maxLength", + "cellSpacing", + "cellPadding", + "rowSpan", + "colSpan", + "useMap", + "frameBorder", + "contentEditable" +], function() { + jQuery.propFix[ this.toLowerCase() ] = this; +} ); + + + + + // Strip and collapse whitespace according to HTML spec + // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace + function stripAndCollapse( value ) { + var tokens = value.match( rnothtmlwhite ) || []; + return tokens.join( " " ); + } + + +function getClass( elem ) { + return elem.getAttribute && elem.getAttribute( "class" ) || ""; +} + +jQuery.fn.extend( { + addClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( jQuery.isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + if ( typeof value === "string" && value ) { + classes = value.match( rnothtmlwhite ) || []; + + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + if ( cur.indexOf( " " + clazz + " " ) < 0 ) { + cur += clazz + " "; + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( jQuery.isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + if ( !arguments.length ) { + return this.attr( "class", "" ); + } + + if ( typeof value === "string" && value ) { + classes = value.match( rnothtmlwhite ) || []; + + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + + // This expression is here for better compressibility (see addClass) + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + + // Remove *all* instances + while ( cur.indexOf( " " + clazz + " " ) > -1 ) { + cur = cur.replace( " " + clazz + " ", " " ); + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value; + + if ( typeof stateVal === "boolean" && type === "string" ) { + return stateVal ? this.addClass( value ) : this.removeClass( value ); + } + + if ( jQuery.isFunction( value ) ) { + return this.each( function( i ) { + jQuery( this ).toggleClass( + value.call( this, i, getClass( this ), stateVal ), + stateVal + ); + } ); + } + + return this.each( function() { + var className, i, self, classNames; + + if ( type === "string" ) { + + // Toggle individual class names + i = 0; + self = jQuery( this ); + classNames = value.match( rnothtmlwhite ) || []; + + while ( ( className = classNames[ i++ ] ) ) { + + // Check each className given, space separated list + if ( self.hasClass( className ) ) { + self.removeClass( className ); + } else { + self.addClass( className ); + } + } + + // Toggle whole class name + } else if ( value === undefined || type === "boolean" ) { + className = getClass( this ); + if ( className ) { + + // Store className if set + dataPriv.set( this, "__className__", className ); + } + + // If the element has a class name or if we're passed `false`, + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + if ( this.setAttribute ) { + this.setAttribute( "class", + className || value === false ? + "" : + dataPriv.get( this, "__className__" ) || "" + ); + } + } + } ); + }, + + hasClass: function( selector ) { + var className, elem, + i = 0; + + className = " " + selector + " "; + while ( ( elem = this[ i++ ] ) ) { + if ( elem.nodeType === 1 && + ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { + return true; + } + } + + return false; + } +} ); + + + + +var rreturn = /\r/g; + +jQuery.fn.extend( { + val: function( value ) { + var hooks, ret, isFunction, + elem = this[ 0 ]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || + jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && + "get" in hooks && + ( ret = hooks.get( elem, "value" ) ) !== undefined + ) { + return ret; + } + + ret = elem.value; + + // Handle most common string cases + if ( typeof ret === "string" ) { + return ret.replace( rreturn, "" ); + } + + // Handle cases where value is null/undef or number + return ret == null ? "" : ret; + } + + return; + } + + isFunction = jQuery.isFunction( value ); + + return this.each( function( i ) { + var val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call( this, i, jQuery( this ).val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + + } else if ( typeof val === "number" ) { + val += ""; + + } else if ( Array.isArray( val ) ) { + val = jQuery.map( val, function( value ) { + return value == null ? "" : value + ""; + } ); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + } ); + } +} ); + +jQuery.extend( { + valHooks: { + option: { + get: function( elem ) { + + var val = jQuery.find.attr( elem, "value" ); + return val != null ? + val : + + // Support: IE <=10 - 11 only + // option.text throws exceptions (#14686, #14858) + // Strip and collapse whitespace + // https://html.spec.whatwg.org/#strip-and-collapse-whitespace + stripAndCollapse( jQuery.text( elem ) ); + } + }, + select: { + get: function( elem ) { + var value, option, i, + options = elem.options, + index = elem.selectedIndex, + one = elem.type === "select-one", + values = one ? null : [], + max = one ? index + 1 : options.length; + + if ( index < 0 ) { + i = max; + + } else { + i = one ? index : 0; + } + + // Loop through all the selected options + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Support: IE <=9 only + // IE8-9 doesn't update selected after form reset (#2551) + if ( ( option.selected || i === index ) && + + // Don't return options that are disabled or in a disabled optgroup + !option.disabled && + ( !option.parentNode.disabled || + !nodeName( option.parentNode, "optgroup" ) ) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + }, + + set: function( elem, value ) { + var optionSet, option, + options = elem.options, + values = jQuery.makeArray( value ), + i = options.length; + + while ( i-- ) { + option = options[ i ]; + + /* eslint-disable no-cond-assign */ + + if ( option.selected = + jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 + ) { + optionSet = true; + } + + /* eslint-enable no-cond-assign */ + } + + // Force browsers to behave consistently when non-matching value is set + if ( !optionSet ) { + elem.selectedIndex = -1; + } + return values; + } + } + } +} ); + +// Radios and checkboxes getter/setter +jQuery.each( [ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + set: function( elem, value ) { + if ( Array.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); + } + } + }; + if ( !support.checkOn ) { + jQuery.valHooks[ this ].get = function( elem ) { + return elem.getAttribute( "value" ) === null ? "on" : elem.value; + }; + } +} ); + + + + +// Return jQuery for attributes-only inclusion + + +var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/; + +jQuery.extend( jQuery.event, { + + trigger: function( event, data, elem, onlyHandlers ) { + + var i, cur, tmp, bubbleType, ontype, handle, special, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; + + cur = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "." ) > -1 ) { + + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split( "." ); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf( ":" ) < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join( "." ); + event.rnamespace = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === ( elem.ownerDocument || document ) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { + + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && + dataPriv.get( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( ( !special._default || + special._default.apply( eventPath.pop(), data ) === false ) && + acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name as the event. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + elem[ type ](); + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + // Piggyback on a donor event to simulate a different one + // Used only for `focus(in | out)` events + simulate: function( type, elem, event ) { + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true + } + ); + + jQuery.event.trigger( e, null, elem ); + } + +} ); + +jQuery.fn.extend( { + + trigger: function( type, data ) { + return this.each( function() { + jQuery.event.trigger( type, data, this ); + } ); + }, + triggerHandler: function( type, data ) { + var elem = this[ 0 ]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +} ); + + +jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup contextmenu" ).split( " " ), + function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + return arguments.length > 0 ? + this.on( name, null, data, fn ) : + this.trigger( name ); + }; +} ); + +jQuery.fn.extend( { + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +} ); + + + + +support.focusin = "onfocusin" in window; + + +// Support: Firefox <=44 +// Firefox doesn't have focus(in | out) events +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 +// +// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 +// focus(in | out) events fire after focus & blur events, +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order +// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 +if ( !support.focusin ) { + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + var doc = this.ownerDocument || this, + attaches = dataPriv.access( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this, + attaches = dataPriv.access( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + dataPriv.remove( doc, fix ); + + } else { + dataPriv.access( doc, fix, attaches ); + } + } + }; + } ); +} +var location = window.location; + +var nonce = jQuery.now(); + +var rquery = ( /\?/ ); + + + +// Cross-browser xml parsing +jQuery.parseXML = function( data ) { + var xml; + if ( !data || typeof data !== "string" ) { + return null; + } + + // Support: IE 9 - 11 only + // IE throws on parseFromString with invalid input. + try { + xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); + } catch ( e ) { + xml = undefined; + } + + if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; +}; + + +var + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, + rsubmittable = /^(?:input|select|textarea|keygen)/i; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( Array.isArray( obj ) ) { + + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + + // Item is non-scalar (array or object), encode its numeric index. + buildParams( + prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", + v, + traditional, + add + ); + } + } ); + + } else if ( !traditional && jQuery.type( obj ) === "object" ) { + + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + + // Serialize scalar item. + add( prefix, obj ); + } +} + +// Serialize an array of form elements or a set of +// key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, valueOrFunction ) { + + // If value is a function, invoke it and use its return value + var value = jQuery.isFunction( valueOrFunction ) ? + valueOrFunction() : + valueOrFunction; + + s[ s.length ] = encodeURIComponent( key ) + "=" + + encodeURIComponent( value == null ? "" : value ); + }; + + // If an array was passed in, assume that it is an array of form elements. + if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + } ); + + } else { + + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ); +}; + +jQuery.fn.extend( { + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map( function() { + + // Can add propHook for "elements" to filter or add form elements + var elements = jQuery.prop( this, "elements" ); + return elements ? jQuery.makeArray( elements ) : this; + } ) + .filter( function() { + var type = this.type; + + // Use .is( ":disabled" ) so that fieldset[disabled] works + return this.name && !jQuery( this ).is( ":disabled" ) && + rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && + ( this.checked || !rcheckableType.test( type ) ); + } ) + .map( function( i, elem ) { + var val = jQuery( this ).val(); + + if ( val == null ) { + return null; + } + + if ( Array.isArray( val ) ) { + return jQuery.map( val, function( val ) { + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ); + } + + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ).get(); + } +} ); + + +var + r20 = /%20/g, + rhash = /#.*$/, + rantiCache = /([?&])_=[^&]*/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, + + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = "*/".concat( "*" ), + + // Anchor tag for parsing the document origin + originAnchor = document.createElement( "a" ); + originAnchor.href = location.href; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, + i = 0, + dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; + + if ( jQuery.isFunction( func ) ) { + + // For each dataType in the dataTypeExpression + while ( ( dataType = dataTypes[ i++ ] ) ) { + + // Prepend if requested + if ( dataType[ 0 ] === "+" ) { + dataType = dataType.slice( 1 ) || "*"; + ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); + + // Otherwise append + } else { + ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); + } + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { + + var inspected = {}, + seekingTransport = ( structure === transports ); + + function inspect( dataType ) { + var selected; + inspected[ dataType ] = true; + jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { + var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); + if ( typeof dataTypeOrTransport === "string" && + !seekingTransport && !inspected[ dataTypeOrTransport ] ) { + + options.dataTypes.unshift( dataTypeOrTransport ); + inspect( dataTypeOrTransport ); + return false; + } else if ( seekingTransport ) { + return !( selected = dataTypeOrTransport ); + } + } ); + return selected; + } + + return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var key, deep, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } + + return target; +} + +/* Handles responses to an ajax request: + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + + var ct, type, finalDataType, firstDataType, + contents = s.contents, + dataTypes = s.dataTypes; + + // Remove auto dataType and get content-type in the process + while ( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +/* Chain conversions given the request and the original response + * Also sets the responseXXX fields on the jqXHR instance + */ +function ajaxConvert( s, response, jqXHR, isSuccess ) { + var conv2, current, conv, tmp, prev, + converters = {}, + + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(); + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + current = dataTypes.shift(); + + // Convert to each sequential dataType + while ( current ) { + + if ( s.responseFields[ current ] ) { + jqXHR[ s.responseFields[ current ] ] = response; + } + + // Apply the dataFilter if provided + if ( !prev && isSuccess && s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + prev = current; + current = dataTypes.shift(); + + if ( current ) { + + // There's only work to do if current dataType is non-auto + if ( current === "*" ) { + + current = prev; + + // Convert response if prev dataType is non-auto and differs from current + } else if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split( " " ); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.unshift( tmp[ 1 ] ); + } + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s.throws ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { + state: "parsererror", + error: conv ? e : "No conversion from " + prev + " to " + current + }; + } + } + } + } + } + } + + return { state: "success", data: response }; +} + +jQuery.extend( { + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {}, + + ajaxSettings: { + url: location.href, + type: "GET", + isLocal: rlocalProtocol.test( location.protocol ), + global: true, + processData: true, + async: true, + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + "*": allTypes, + text: "text/plain", + html: "text/html", + xml: "application/xml, text/xml", + json: "application/json, text/javascript" + }, + + contents: { + xml: /\bxml\b/, + html: /\bhtml/, + json: /\bjson\b/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText", + json: "responseJSON" + }, + + // Data converters + // Keys separate source (or catchall "*") and destination types with a single space + converters: { + + // Convert anything to text + "* text": String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": JSON.parse, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + url: true, + context: true + } + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + return settings ? + + // Building a settings object + ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : + + // Extending ajaxSettings + ajaxExtend( jQuery.ajaxSettings, target ); + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var transport, + + // URL without anti-cache param + cacheURL, + + // Response headers + responseHeadersString, + responseHeaders, + + // timeout handle + timeoutTimer, + + // Url cleanup var + urlAnchor, + + // Request state (becomes false upon send and true upon completion) + completed, + + // To know if global events are to be dispatched + fireGlobals, + + // Loop variable + i, + + // uncached part of the url + uncached, + + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + + // Callbacks context + callbackContext = s.context || s, + + // Context for global events is callbackContext if it is a DOM node or jQuery collection + globalEventContext = s.context && + ( callbackContext.nodeType || callbackContext.jquery ) ? + jQuery( callbackContext ) : + jQuery.event, + + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks( "once memory" ), + + // Status-dependent callbacks + statusCode = s.statusCode || {}, + + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + + // Default abort message + strAbort = "canceled", + + // Fake xhr + jqXHR = { + readyState: 0, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( completed ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while ( ( match = rheaders.exec( responseHeadersString ) ) ) { + responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; + } + } + match = responseHeaders[ key.toLowerCase() ]; + } + return match == null ? null : match; + }, + + // Raw string + getAllResponseHeaders: function() { + return completed ? responseHeadersString : null; + }, + + // Caches the header + setRequestHeader: function( name, value ) { + if ( completed == null ) { + name = requestHeadersNames[ name.toLowerCase() ] = + requestHeadersNames[ name.toLowerCase() ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( completed == null ) { + s.mimeType = type; + } + return this; + }, + + // Status-dependent callbacks + statusCode: function( map ) { + var code; + if ( map ) { + if ( completed ) { + + // Execute the appropriate callbacks + jqXHR.always( map[ jqXHR.status ] ); + } else { + + // Lazy-add the new callbacks in a way that preserves old ones + for ( code in map ) { + statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; + } + } + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + var finalText = statusText || strAbort; + if ( transport ) { + transport.abort( finalText ); + } + done( 0, finalText ); + return this; + } + }; + + // Attach deferreds + deferred.promise( jqXHR ); + + // Add protocol if not provided (prefilters might expect it) + // Handle falsy url in the settings object (#10093: consistency with old signature) + // We also use the url parameter if available + s.url = ( ( url || s.url || location.href ) + "" ) + .replace( rprotocol, location.protocol + "//" ); + + // Alias method option to type as per ticket #12004 + s.type = options.method || options.type || s.method || s.type; + + // Extract dataTypes list + s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; + + // A cross-domain request is in order when the origin doesn't match the current origin. + if ( s.crossDomain == null ) { + urlAnchor = document.createElement( "a" ); + + // Support: IE <=8 - 11, Edge 12 - 13 + // IE throws exception on accessing the href property if url is malformed, + // e.g. http://example.com:80x/ + try { + urlAnchor.href = s.url; + + // Support: IE <=8 - 11 only + // Anchor's host property isn't correctly set when s.url is relative + urlAnchor.href = urlAnchor.href; + s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== + urlAnchor.protocol + "//" + urlAnchor.host; + } catch ( e ) { + + // If there is an error parsing the URL, assume it is crossDomain, + // it can be rejected by the transport if it is invalid + s.crossDomain = true; + } + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( completed ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) + fireGlobals = jQuery.event && s.global; + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger( "ajaxStart" ); + } + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Save the URL in case we're toying with the If-Modified-Since + // and/or If-None-Match header later on + // Remove hash to simplify url manipulation + cacheURL = s.url.replace( rhash, "" ); + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // Remember the hash so we can put it back + uncached = s.url.slice( cacheURL.length ); + + // If data is available, append data to url + if ( s.data ) { + cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; + + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Add or update anti-cache param if needed + if ( s.cache === false ) { + cacheURL = cacheURL.replace( rantiCache, "$1" ); + uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; + } + + // Put hash and anti-cache on the URL that will be requested (gh-1732) + s.url = cacheURL + uncached; + + // Change '%20' to '+' if this is encoded form body content (gh-2658) + } else if ( s.data && s.processData && + ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { + s.data = s.data.replace( r20, "+" ); + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + if ( jQuery.lastModified[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); + } + if ( jQuery.etag[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? + s.accepts[ s.dataTypes[ 0 ] ] + + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && + ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { + + // Abort if not done already and return + return jqXHR.abort(); + } + + // Aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + completeDeferred.add( s.complete ); + jqXHR.done( s.success ); + jqXHR.fail( s.error ); + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + + // If request was aborted inside ajaxSend, stop there + if ( completed ) { + return jqXHR; + } + + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = window.setTimeout( function() { + jqXHR.abort( "timeout" ); + }, s.timeout ); + } + + try { + completed = false; + transport.send( requestHeaders, done ); + } catch ( e ) { + + // Rethrow post-completion exceptions + if ( completed ) { + throw e; + } + + // Propagate others as results + done( -1, e ); + } + } + + // Callback for when everything is done + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Ignore repeat invocations + if ( completed ) { + return; + } + + completed = true; + + // Clear timeout if it exists + if ( timeoutTimer ) { + window.clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Determine if successful + isSuccess = status >= 200 && status < 300 || status === 304; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // Convert no matter what (that way responseXXX fields are always set) + response = ajaxConvert( s, response, jqXHR, isSuccess ); + + // If successful, handle type chaining + if ( isSuccess ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + modified = jqXHR.getResponseHeader( "Last-Modified" ); + if ( modified ) { + jQuery.lastModified[ cacheURL ] = modified; + } + modified = jqXHR.getResponseHeader( "etag" ); + if ( modified ) { + jQuery.etag[ cacheURL ] = modified; + } + } + + // if no content + if ( status === 204 || s.type === "HEAD" ) { + statusText = "nocontent"; + + // if not modified + } else if ( status === 304 ) { + statusText = "notmodified"; + + // If we have data, let's convert it + } else { + statusText = response.state; + success = response.data; + error = response.error; + isSuccess = !error; + } + } else { + + // Extract error from statusText and normalize for non-aborts + error = statusText; + if ( status || !statusText ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger( "ajaxStop" ); + } + } + } + + return jqXHR; + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + }, + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + } +} ); + +jQuery.each( [ "get", "post" ], function( i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + + // Shift arguments if data argument was omitted + if ( jQuery.isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + // The url can be an options object (which then must have .url) + return jQuery.ajax( jQuery.extend( { + url: url, + type: method, + dataType: type, + data: data, + success: callback + }, jQuery.isPlainObject( url ) && url ) ); + }; +} ); + + +jQuery._evalUrl = function( url ) { + return jQuery.ajax( { + url: url, + + // Make this explicit, since user can override this through ajaxSetup (#11264) + type: "GET", + dataType: "script", + cache: true, + async: false, + global: false, + "throws": true + } ); +}; + + +jQuery.fn.extend( { + wrapAll: function( html ) { + var wrap; + + if ( this[ 0 ] ) { + if ( jQuery.isFunction( html ) ) { + html = html.call( this[ 0 ] ); + } + + // The elements to wrap the target around + wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); + + if ( this[ 0 ].parentNode ) { + wrap.insertBefore( this[ 0 ] ); + } + + wrap.map( function() { + var elem = this; + + while ( elem.firstElementChild ) { + elem = elem.firstElementChild; + } + + return elem; + } ).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each( function( i ) { + jQuery( this ).wrapInner( html.call( this, i ) ); + } ); + } + + return this.each( function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + } ); + }, + + wrap: function( html ) { + var isFunction = jQuery.isFunction( html ); + + return this.each( function( i ) { + jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); + } ); + }, + + unwrap: function( selector ) { + this.parent( selector ).not( "body" ).each( function() { + jQuery( this ).replaceWith( this.childNodes ); + } ); + return this; + } +} ); + + +jQuery.expr.pseudos.hidden = function( elem ) { + return !jQuery.expr.pseudos.visible( elem ); +}; +jQuery.expr.pseudos.visible = function( elem ) { + return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); +}; + + + + +jQuery.ajaxSettings.xhr = function() { + try { + return new window.XMLHttpRequest(); + } catch ( e ) {} +}; + +var xhrSuccessStatus = { + + // File protocol always yields status code 0, assume 200 + 0: 200, + + // Support: IE <=9 only + // #1450: sometimes IE returns 1223 when it should be 204 + 1223: 204 + }, + xhrSupported = jQuery.ajaxSettings.xhr(); + +support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); +support.ajax = xhrSupported = !!xhrSupported; + +jQuery.ajaxTransport( function( options ) { + var callback, errorCallback; + + // Cross domain only allowed if supported through XMLHttpRequest + if ( support.cors || xhrSupported && !options.crossDomain ) { + return { + send: function( headers, complete ) { + var i, + xhr = options.xhr(); + + xhr.open( + options.type, + options.url, + options.async, + options.username, + options.password + ); + + // Apply custom fields if provided + if ( options.xhrFields ) { + for ( i in options.xhrFields ) { + xhr[ i ] = options.xhrFields[ i ]; + } + } + + // Override mime type if needed + if ( options.mimeType && xhr.overrideMimeType ) { + xhr.overrideMimeType( options.mimeType ); + } + + // X-Requested-With header + // For cross-domain requests, seeing as conditions for a preflight are + // akin to a jigsaw puzzle, we simply never set it to be sure. + // (it can always be set on a per-request basis or even using ajaxSetup) + // For same-domain requests, won't change header if already provided. + if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { + headers[ "X-Requested-With" ] = "XMLHttpRequest"; + } + + // Set headers + for ( i in headers ) { + xhr.setRequestHeader( i, headers[ i ] ); + } + + // Callback + callback = function( type ) { + return function() { + if ( callback ) { + callback = errorCallback = xhr.onload = + xhr.onerror = xhr.onabort = xhr.onreadystatechange = null; + + if ( type === "abort" ) { + xhr.abort(); + } else if ( type === "error" ) { + + // Support: IE <=9 only + // On a manual native abort, IE9 throws + // errors on any property access that is not readyState + if ( typeof xhr.status !== "number" ) { + complete( 0, "error" ); + } else { + complete( + + // File: protocol always yields status 0; see #8605, #14207 + xhr.status, + xhr.statusText + ); + } + } else { + complete( + xhrSuccessStatus[ xhr.status ] || xhr.status, + xhr.statusText, + + // Support: IE <=9 only + // IE9 has no XHR2 but throws on binary (trac-11426) + // For XHR2 non-text, let the caller handle it (gh-2498) + ( xhr.responseType || "text" ) !== "text" || + typeof xhr.responseText !== "string" ? + { binary: xhr.response } : + { text: xhr.responseText }, + xhr.getAllResponseHeaders() + ); + } + } + }; + }; + + // Listen to events + xhr.onload = callback(); + errorCallback = xhr.onerror = callback( "error" ); + + // Support: IE 9 only + // Use onreadystatechange to replace onabort + // to handle uncaught aborts + if ( xhr.onabort !== undefined ) { + xhr.onabort = errorCallback; + } else { + xhr.onreadystatechange = function() { + + // Check readyState before timeout as it changes + if ( xhr.readyState === 4 ) { + + // Allow onerror to be called first, + // but that will not handle a native abort + // Also, save errorCallback to a variable + // as xhr.onerror cannot be accessed + window.setTimeout( function() { + if ( callback ) { + errorCallback(); + } + } ); + } + }; + } + + // Create the abort callback + callback = callback( "abort" ); + + try { + + // Do send the request (this may raise an exception) + xhr.send( options.hasContent && options.data || null ); + } catch ( e ) { + + // #14683: Only rethrow if this hasn't been notified as an error yet + if ( callback ) { + throw e; + } + } + }, + + abort: function() { + if ( callback ) { + callback(); + } + } + }; + } +} ); + + + + +// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) +jQuery.ajaxPrefilter( function( s ) { + if ( s.crossDomain ) { + s.contents.script = false; + } +} ); + +// Install script dataType +jQuery.ajaxSetup( { + accepts: { + script: "text/javascript, application/javascript, " + + "application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /\b(?:java|ecma)script\b/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +} ); + +// Handle cache's special case and crossDomain +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + if ( s.crossDomain ) { + s.type = "GET"; + } +} ); + +// Bind script tag hack transport +jQuery.ajaxTransport( "script", function( s ) { + + // This transport only deals with cross domain requests + if ( s.crossDomain ) { + var script, callback; + return { + send: function( _, complete ) { + script = jQuery( " + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

The full Pygments API¶

+

This page describes the Pygments API.

+
+

High-level API¶

+

Functions from the pygments module:

+
+
+pygments.lex(code, lexer)¶
+

Lex code with the lexer (must be a Lexer instance) +and return an iterable of tokens. Currently, this only calls +lexer.get_tokens().

+
+ +
+
+pygments.format(tokens, formatter, outfile=None)¶
+

Format a token stream (iterable of tokens) tokens with the +formatter (must be a Formatter instance). The result is +written to outfile, or if that is None, returned as a +string.

+
+ +
+
+pygments.highlight(code, lexer, formatter, outfile=None)¶
+

This is the most high-level highlighting function. +It combines lex and format in one function.

+
+ +

Functions from pygments.lexers:

+
+
+pygments.lexers.get_lexer_by_name(alias, **options)¶
+

Return an instance of a Lexer subclass that has alias in its +aliases list. The lexer is given the options at its +instantiation.

+

Will raise pygments.util.ClassNotFound if no lexer with that alias is +found.

+
+ +
+
+pygments.lexers.get_lexer_for_filename(fn, **options)¶
+

Return a Lexer subclass instance that has a filename pattern +matching fn. The lexer is given the options at its +instantiation.

+

Will raise pygments.util.ClassNotFound if no lexer for that filename +is found.

+
+ +
+
+pygments.lexers.get_lexer_for_mimetype(mime, **options)¶
+

Return a Lexer subclass instance that has mime in its mimetype +list. The lexer is given the options at its instantiation.

+

Will raise pygments.util.ClassNotFound if not lexer for that mimetype +is found.

+
+ +
+
+pygments.lexers.load_lexer_from_file(filename, lexername="CustomLexer", **options)¶
+

Return a Lexer subclass instance loaded from the provided file, relative +to the current directory. The file is expected to contain a Lexer class +named lexername (by default, CustomLexer). Users should be very careful with +the input, because this method is equivalent to running eval on the input file. +The lexer is given the options at its instantiation.

+

ClassNotFound is raised if there are any errors loading the Lexer

+
+

New in version 2.2.

+
+
+ +
+
+pygments.lexers.guess_lexer(text, **options)¶
+

Return a Lexer subclass instance that’s guessed from the text in +text. For that, the analyse_text() method of every known lexer +class is called with the text as argument, and the lexer which returned the +highest value will be instantiated and returned.

+

pygments.util.ClassNotFound is raised if no lexer thinks it can +handle the content.

+
+ +
+
+pygments.lexers.guess_lexer_for_filename(filename, text, **options)¶
+

As guess_lexer(), but only lexers which have a pattern in filenames +or alias_filenames that matches filename are taken into consideration.

+

pygments.util.ClassNotFound is raised if no lexer thinks it can +handle the content.

+
+ +
+
+pygments.lexers.get_all_lexers()¶
+

Return an iterable over all registered lexers, yielding tuples in the +format:

+
(longname, tuple of aliases, tuple of filename patterns, tuple of mimetypes)
+
+
+
+

New in version 0.6.

+
+
+ +
+
+pygments.lexers.find_lexer_class_by_name(alias)¶
+

Return the Lexer subclass that has alias in its aliases list, without +instantiating it.

+

Will raise pygments.util.ClassNotFound if no lexer with that alias is +found.

+
+

New in version 2.2.

+
+
+ +
+
+pygments.lexers.find_lexer_class(name)¶
+

Return the Lexer subclass that with the name attribute as given by +the name argument.

+
+ +

Functions from pygments.formatters:

+
+
+pygments.formatters.get_formatter_by_name(alias, **options)¶
+

Return an instance of a Formatter subclass that has alias in its +aliases list. The formatter is given the options at its instantiation.

+

Will raise pygments.util.ClassNotFound if no formatter with that +alias is found.

+
+ +
+
+pygments.formatters.get_formatter_for_filename(fn, **options)¶
+

Return a Formatter subclass instance that has a filename pattern +matching fn. The formatter is given the options at its instantiation.

+

Will raise pygments.util.ClassNotFound if no formatter for that filename +is found.

+
+ +
+
+pygments.formatters.load_formatter_from_file(filename, formattername="CustomFormatter", **options)¶
+

Return a Formatter subclass instance loaded from the provided file, relative +to the current directory. The file is expected to contain a Formatter class +named formattername (by default, CustomFormatter). Users should be very +careful with the input, because this method is equivalent to running eval +on the input file. The formatter is given the options at its instantiation.

+

ClassNotFound is raised if there are any errors loading the Formatter

+
+

New in version 2.2.

+
+
+ +

Functions from pygments.styles:

+
+
+pygments.styles.get_style_by_name(name)¶
+

Return a style class by its short name. The names of the builtin styles +are listed in pygments.styles.STYLE_MAP.

+

Will raise pygments.util.ClassNotFound if no style of that name is +found.

+
+ +
+
+pygments.styles.get_all_styles()¶
+

Return an iterable over all registered styles, yielding their names.

+
+

New in version 0.6.

+
+
+ +
+
+

Lexers¶

+

The base lexer class from which all lexers are derived is:

+
+
+class pygments.lexer.Lexer(**options)¶
+

The constructor takes a **keywords dictionary of options. +Every subclass must first process its own options and then call +the Lexer constructor, since it processes the stripnl, +stripall and tabsize options.

+

An example looks like this:

+
def __init__(self, **options):
+    self.compress = options.get('compress', '')
+    Lexer.__init__(self, **options)
+
+
+

As these options must all be specifiable as strings (due to the +command line usage), there are various utility functions +available to help with that, see Option processing.

+
+
+get_tokens(text)¶
+

This method is the basic interface of a lexer. It is called by +the highlight() function. It must process the text and return an +iterable of (tokentype, value) pairs from text.

+

Normally, you don’t need to override this method. The default +implementation processes the stripnl, stripall and tabsize +options and then yields all tokens from get_tokens_unprocessed(), +with the index dropped.

+
+ +
+
+get_tokens_unprocessed(text)¶
+

This method should process the text and return an iterable of +(index, tokentype, value) tuples where index is the starting +position of the token within the input text.

+

This method must be overridden by subclasses.

+
+ +
+
+static analyse_text(text)¶
+

A static method which is called for lexer guessing. It should analyse +the text and return a float in the range from 0.0 to 1.0. +If it returns 0.0, the lexer will not be selected as the most +probable one, if it returns 1.0, it will be selected immediately.

+
+

Note

+

You don’t have to add @staticmethod to the definition of +this method, this will be taken care of by the Lexer’s metaclass.

+
+
+ +

For a list of known tokens have a look at the Builtin Tokens page.

+

A lexer also can have the following attributes (in fact, they are mandatory +except alias_filenames) that are used by the builtin lookup mechanism.

+
+
+name¶
+

Full name for the lexer, in human-readable form.

+
+ +
+
+aliases¶
+

A list of short, unique identifiers that can be used to lookup +the lexer from a list, e.g. using get_lexer_by_name().

+
+ +
+
+filenames¶
+

A list of fnmatch patterns that match filenames which contain +content for this lexer. The patterns in this list should be unique among +all lexers.

+
+ +
+
+alias_filenames¶
+

A list of fnmatch patterns that match filenames which may or may not +contain content for this lexer. This list is used by the +guess_lexer_for_filename() function, to determine which lexers +are then included in guessing the correct one. That means that +e.g. every lexer for HTML and a template language should include +\*.html in this list.

+
+ +
+
+mimetypes¶
+

A list of MIME types for content that can be lexed with this +lexer.

+
+ +
+ +
+
+

Formatters¶

+

A formatter is derived from this class:

+
+
+class pygments.formatter.Formatter(**options)¶
+

As with lexers, this constructor processes options and then must call the +base class __init__().

+

The Formatter class recognizes the options style, full and +title. It is up to the formatter class whether it uses them.

+
+
+get_style_defs(arg='')¶
+

This method must return statements or declarations suitable to define +the current style for subsequent highlighted text (e.g. CSS classes +in the HTMLFormatter).

+

The optional argument arg can be used to modify the generation and +is formatter dependent (it is standardized because it can be given on +the command line).

+

This method is called by the -S command-line option, +the arg is then given by the -a option.

+
+ +
+
+format(tokensource, outfile)¶
+

This method must format the tokens from the tokensource iterable and +write the formatted version to the file object outfile.

+

Formatter options can control how exactly the tokens are converted.

+
+ +
+

New in version 0.7: A formatter must have the following attributes that are used by the +builtin lookup mechanism.

+
+
+
+name¶
+

Full name for the formatter, in human-readable form.

+
+ +
+
+aliases¶
+

A list of short, unique identifiers that can be used to lookup +the formatter from a list, e.g. using get_formatter_by_name().

+
+ +
+
+filenames¶
+

A list of fnmatch patterns that match filenames for which this +formatter can produce output. The patterns in this list should be unique +among all formatters.

+
+ +
+ +
+
+

Option processing¶

+

The pygments.util module has some utility functions usable for option +processing:

+
+
+exception pygments.util.OptionError¶
+

This exception will be raised by all option processing functions if +the type or value of the argument is not correct.

+
+ +
+
+pygments.util.get_bool_opt(options, optname, default=None)¶
+

Interpret the key optname from the dictionary options as a boolean and +return it. Return default if optname is not in options.

+

The valid string values for True are 1, yes, true and +on, the ones for False are 0, no, false and off +(matched case-insensitively).

+
+ +
+
+pygments.util.get_int_opt(options, optname, default=None)¶
+

As get_bool_opt(), but interpret the value as an integer.

+
+ +
+
+pygments.util.get_list_opt(options, optname, default=None)¶
+

If the key optname from the dictionary options is a string, +split it at whitespace and return it. If it is already a list +or a tuple, it is returned as a list.

+
+ +
+
+pygments.util.get_choice_opt(options, optname, allowed, default=None)¶
+

If the key optname from the dictionary is not in the sequence +allowed, raise an error, otherwise return it.

+
+

New in version 0.8.

+
+
+ +
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/authors.html b/doc/_build/html/docs/authors.html new file mode 100644 index 0000000..07824e1 --- /dev/null +++ b/doc/_build/html/docs/authors.html @@ -0,0 +1,340 @@ + + + + + + + + Full contributor list — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Full contributor list¶

+

Pygments is written and maintained by Georg Brandl <georg@python.org>.

+

Major developers are Tim Hatch <tim@timhatch.com> and Armin Ronacher +<armin.ronacher@active-4.com>.

+

Other contributors, listed alphabetically, are:

+
    +
  • Sam Aaron – Ioke lexer
  • +
  • Ali Afshar – image formatter
  • +
  • Thomas Aglassinger – Easytrieve, JCL, Rexx and Transact-SQL lexers
  • +
  • Muthiah Annamalai – Ezhil lexer
  • +
  • Kumar Appaiah – Debian control lexer
  • +
  • Andreas Amann – AppleScript lexer
  • +
  • Timothy Armstrong – Dart lexer fixes
  • +
  • Jeffrey Arnold – R/S, Rd, BUGS, Jags, and Stan lexers
  • +
  • Jeremy Ashkenas – CoffeeScript lexer
  • +
  • José Joaquín Atria – Praat lexer
  • +
  • Stefan Matthias Aust – Smalltalk lexer
  • +
  • Lucas Bajolet – Nit lexer
  • +
  • Ben Bangert – Mako lexers
  • +
  • Max Battcher – Darcs patch lexer
  • +
  • Thomas Baruchel – APL lexer
  • +
  • Tim Baumann – (Literate) Agda lexer
  • +
  • Paul Baumgart, 280 North, Inc. – Objective-J lexer
  • +
  • Michael Bayer – Myghty lexers
  • +
  • Thomas Beale – Archetype lexers
  • +
  • John Benediktsson – Factor lexer
  • +
  • Trevor Bergeron – mIRC formatter
  • +
  • Vincent Bernat – LessCSS lexer
  • +
  • Christopher Bertels – Fancy lexer
  • +
  • Sébastien Bigaret – QVT Operational lexer
  • +
  • Jarrett Billingsley – MiniD lexer
  • +
  • Adam Blinkinsop – Haskell, Redcode lexers
  • +
  • Frits van Bommel – assembler lexers
  • +
  • Pierre Bourdon – bugfixes
  • +
  • Matthias Bussonnier – ANSI style handling for terminal-256 formatter
  • +
  • chebee7i – Python traceback lexer improvements
  • +
  • Hiram Chirino – Scaml and Jade lexers
  • +
  • Mauricio Caceres – SAS and Stata lexers.
  • +
  • Ian Cooper – VGL lexer
  • +
  • David Corbett – Inform, Jasmin, JSGF, Snowball, and TADS 3 lexers
  • +
  • Leaf Corcoran – MoonScript lexer
  • +
  • Christopher Creutzig – MuPAD lexer
  • +
  • Daniël W. Crompton – Pike lexer
  • +
  • Pete Curry – bugfixes
  • +
  • Bryan Davis – EBNF lexer
  • +
  • Bruno Deferrari – Shen lexer
  • +
  • Giedrius Dubinskas – HTML formatter improvements
  • +
  • Owen Durni – Haxe lexer
  • +
  • Alexander Dutton, Oxford University Computing Services – SPARQL lexer
  • +
  • James Edwards – Terraform lexer
  • +
  • Nick Efford – Python 3 lexer
  • +
  • Sven Efftinge – Xtend lexer
  • +
  • Artem Egorkine – terminal256 formatter
  • +
  • Matthew Fernandez – CAmkES lexer
  • +
  • Michael Ficarra – CPSA lexer
  • +
  • James H. Fisher – PostScript lexer
  • +
  • William S. Fulton – SWIG lexer
  • +
  • Carlos Galdino – Elixir and Elixir Console lexers
  • +
  • Michael Galloy – IDL lexer
  • +
  • Naveen Garg – Autohotkey lexer
  • +
  • Laurent Gautier – R/S lexer
  • +
  • Alex Gaynor – PyPy log lexer
  • +
  • Richard Gerkin – Igor Pro lexer
  • +
  • Alain Gilbert – TypeScript lexer
  • +
  • Alex Gilding – BlitzBasic lexer
  • +
  • Bertrand Goetzmann – Groovy lexer
  • +
  • Krzysiek Goj – Scala lexer
  • +
  • Andrey Golovizin – BibTeX lexers
  • +
  • Matt Good – Genshi, Cheetah lexers
  • +
  • Michał Górny – vim modeline support
  • +
  • Alex Gosse – TrafficScript lexer
  • +
  • Patrick Gotthardt – PHP namespaces support
  • +
  • Olivier Guibe – Asymptote lexer
  • +
  • Phil Hagelberg – Fennel lexer
  • +
  • Florian Hahn – Boogie lexer
  • +
  • Martin Harriman – SNOBOL lexer
  • +
  • Matthew Harrison – SVG formatter
  • +
  • Steven Hazel – Tcl lexer
  • +
  • Dan Michael Heggø – Turtle lexer
  • +
  • Aslak Hellesøy – Gherkin lexer
  • +
  • Greg Hendershott – Racket lexer
  • +
  • Justin Hendrick – ParaSail lexer
  • +
  • Jordi Gutiérrez Hermoso – Octave lexer
  • +
  • David Hess, Fish Software, Inc. – Objective-J lexer
  • +
  • Varun Hiremath – Debian control lexer
  • +
  • Rob Hoelz – Perl 6 lexer
  • +
  • Doug Hogan – Mscgen lexer
  • +
  • Ben Hollis – Mason lexer
  • +
  • Max Horn – GAP lexer
  • +
  • Alastair Houghton – Lexer inheritance facility
  • +
  • Tim Howard – BlitzMax lexer
  • +
  • Dustin Howett – Logos lexer
  • +
  • Ivan Inozemtsev – Fantom lexer
  • +
  • Hiroaki Itoh – Shell console rewrite, Lexers for PowerShell session, +MSDOS session, BC, WDiff
  • +
  • Brian R. Jackson – Tea lexer
  • +
  • Christian Jann – ShellSession lexer
  • +
  • Dennis Kaarsemaker – sources.list lexer
  • +
  • Dmitri Kabak – Inferno Limbo lexer
  • +
  • Igor Kalnitsky – vhdl lexer
  • +
  • Alexander Kit – MaskJS lexer
  • +
  • Pekka Klärck – Robot Framework lexer
  • +
  • Gerwin Klein – Isabelle lexer
  • +
  • Eric Knibbe – Lasso lexer
  • +
  • Stepan Koltsov – Clay lexer
  • +
  • Adam Koprowski – Opa lexer
  • +
  • Benjamin Kowarsch – Modula-2 lexer
  • +
  • Domen Kožar – Nix lexer
  • +
  • Oleh Krekel – Emacs Lisp lexer
  • +
  • Alexander Kriegisch – Kconfig and AspectJ lexers
  • +
  • Marek Kubica – Scheme lexer
  • +
  • Jochen Kupperschmidt – Markdown processor
  • +
  • Gerd Kurzbach – Modelica lexer
  • +
  • Jon Larimer, Google Inc. – Smali lexer
  • +
  • Olov Lassus – Dart lexer
  • +
  • Matt Layman – TAP lexer
  • +
  • Kristian Lyngstøl – Varnish lexers
  • +
  • Sylvestre Ledru – Scilab lexer
  • +
  • Chee Sing Lee – Flatline lexer
  • +
  • Mark Lee – Vala lexer
  • +
  • Valentin Lorentz – C++ lexer improvements
  • +
  • Ben Mabey – Gherkin lexer
  • +
  • Angus MacArthur – QML lexer
  • +
  • Louis Mandel – X10 lexer
  • +
  • Louis Marchand – Eiffel lexer
  • +
  • Simone Margaritelli – Hybris lexer
  • +
  • Kirk McDonald – D lexer
  • +
  • Gordon McGregor – SystemVerilog lexer
  • +
  • Stephen McKamey – Duel/JBST lexer
  • +
  • Brian McKenna – F# lexer
  • +
  • Charles McLaughlin – Puppet lexer
  • +
  • Lukas Meuser – BBCode formatter, Lua lexer
  • +
  • Cat Miller – Pig lexer
  • +
  • Paul Miller – LiveScript lexer
  • +
  • Hong Minhee – HTTP lexer
  • +
  • Michael Mior – Awk lexer
  • +
  • Bruce Mitchener – Dylan lexer rewrite
  • +
  • Reuben Morais – SourcePawn lexer
  • +
  • Jon Morton – Rust lexer
  • +
  • Paulo Moura – Logtalk lexer
  • +
  • Mher Movsisyan – DTD lexer
  • +
  • Dejan Muhamedagic – Crmsh lexer
  • +
  • Ana Nelson – Ragel, ANTLR, R console lexers
  • +
  • Kurt Neufeld – Markdown lexer
  • +
  • Nam T. Nguyen – Monokai style
  • +
  • Jesper Noehr – HTML formatter “anchorlinenos”
  • +
  • Mike Nolta – Julia lexer
  • +
  • Jonas Obrist – BBCode lexer
  • +
  • Edward O’Callaghan – Cryptol lexer
  • +
  • David Oliva – Rebol lexer
  • +
  • Pat Pannuto – nesC lexer
  • +
  • Jon Parise – Protocol buffers and Thrift lexers
  • +
  • Benjamin Peterson – Test suite refactoring
  • +
  • Ronny Pfannschmidt – BBCode lexer
  • +
  • Dominik Picheta – Nimrod lexer
  • +
  • Andrew Pinkham – RTF Formatter Refactoring
  • +
  • Clément Prévost – UrbiScript lexer
  • +
  • Tanner Prynn – cmdline -x option and loading lexers from files
  • +
  • Oleh Prypin – Crystal lexer (based on Ruby lexer)
  • +
  • Elias Rabel – Fortran fixed form lexer
  • +
  • raichoo – Idris lexer
  • +
  • Kashif Rasul – CUDA lexer
  • +
  • Nathan Reed – HLSL lexer
  • +
  • Justin Reidy – MXML lexer
  • +
  • Norman Richards – JSON lexer
  • +
  • Corey Richardson – Rust lexer updates
  • +
  • Lubomir Rintel – GoodData MAQL and CL lexers
  • +
  • Andre Roberge – Tango style
  • +
  • Georg Rollinger – HSAIL lexer
  • +
  • Michiel Roos – TypoScript lexer
  • +
  • Konrad Rudolph – LaTeX formatter enhancements
  • +
  • Mario Ruggier – Evoque lexers
  • +
  • Miikka Salminen – Lovelace style, Hexdump lexer, lexer enhancements
  • +
  • Stou Sandalski – NumPy, FORTRAN, tcsh and XSLT lexers
  • +
  • Matteo Sasso – Common Lisp lexer
  • +
  • Joe Schafer – Ada lexer
  • +
  • Ken Schutte – Matlab lexers
  • +
  • René Schwaiger – Rainbow Dash style
  • +
  • Sebastian Schweizer – Whiley lexer
  • +
  • Tassilo Schweyer – Io, MOOCode lexers
  • +
  • Ted Shaw – AutoIt lexer
  • +
  • Joerg Sieker – ABAP lexer
  • +
  • Robert Simmons – Standard ML lexer
  • +
  • Kirill Simonov – YAML lexer
  • +
  • Corbin Simpson – Monte lexer
  • +
  • Alexander Smishlajev – Visual FoxPro lexer
  • +
  • Steve Spigarelli – XQuery lexer
  • +
  • Jerome St-Louis – eC lexer
  • +
  • Camil Staps – Clean and NuSMV lexers
  • +
  • James Strachan – Kotlin lexer
  • +
  • Tom Stuart – Treetop lexer
  • +
  • Colin Sullivan – SuperCollider lexer
  • +
  • Ben Swift – Extempore lexer
  • +
  • Edoardo Tenani – Arduino lexer
  • +
  • Tiberius Teng – default style overhaul
  • +
  • Jeremy Thurgood – Erlang, Squid config lexers
  • +
  • Brian Tiffin – OpenCOBOL lexer
  • +
  • Bob Tolbert – Hy lexer
  • +
  • Matthias Trute – Forth lexer
  • +
  • Erick Tryzelaar – Felix lexer
  • +
  • Alexander Udalov – Kotlin lexer improvements
  • +
  • Thomas Van Doren – Chapel lexer
  • +
  • Daniele Varrazzo – PostgreSQL lexers
  • +
  • Abe Voelker – OpenEdge ABL lexer
  • +
  • Pepijn de Vos – HTML formatter CTags support
  • +
  • Matthias Vallentin – Bro lexer
  • +
  • Benoît Vinot – AMPL lexer
  • +
  • Linh Vu Hong – RSL lexer
  • +
  • Nathan Weizenbaum – Haml and Sass lexers
  • +
  • Nathan Whetsell – Csound lexers
  • +
  • Dietmar Winkler – Modelica lexer
  • +
  • Nils Winter – Smalltalk lexer
  • +
  • Davy Wybiral – Clojure lexer
  • +
  • Whitney Young – ObjectiveC lexer
  • +
  • Diego Zamboni – CFengine3 lexer
  • +
  • Enrique Zamudio – Ceylon lexer
  • +
  • Alex Zimin – Nemerle lexer
  • +
  • Rob Zimmerman – Kal lexer
  • +
  • Vincent Zurczak – Roboconf lexer
  • +
+

Many thanks for all contributions!

+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/changelog.html b/doc/_build/html/docs/changelog.html new file mode 100644 index 0000000..6cfd83f --- /dev/null +++ b/doc/_build/html/docs/changelog.html @@ -0,0 +1,1138 @@ + + + + + + + + Pygments changelog — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Pygments changelog¶

+

Issue numbers refer to the tracker at +<https://bitbucket.org/birkenfeld/pygments-main/issues>, +pull request numbers to the requests at +<https://bitbucket.org/birkenfeld/pygments-main/pull-requests/merged>.

+
+

Version 2.3.0¶

+

(not released yet)

+
    +
  • Added lexers:
      +
    • Fennel (PR#783)
    • +
    • HLSL (PR#675)
    • +
    +
  • +
  • Added Python 3.7 support (PR#772)
  • +
  • Fix incorrect token type in SCSS for single-quote strings (#1322)
  • +
  • Use terminal256 formatter if TERM contains 256 (PR#666)
  • +
+
+
+

Version 2.2.0¶

+

(release Jan 22, 2017)

+
    +
  • Added lexers:
      +
    • AMPL
    • +
    • TypoScript (#1173)
    • +
    • Varnish config (PR#554)
    • +
    • Clean (PR#503)
    • +
    • WDiff (PR#513)
    • +
    • Flatline (PR#551)
    • +
    • Silver (PR#537)
    • +
    • HSAIL (PR#518)
    • +
    • JSGF (PR#546)
    • +
    • NCAR command language (PR#536)
    • +
    • Extempore (PR#530)
    • +
    • Cap’n Proto (PR#595)
    • +
    • Whiley (PR#573)
    • +
    • Monte (PR#592)
    • +
    • Crystal (PR#576)
    • +
    • Snowball (PR#589)
    • +
    • CapDL (PR#579)
    • +
    • NuSMV (PR#564)
    • +
    • SAS, Stata (PR#593)
    • +
    +
  • +
  • Added the ability to load lexer and formatter classes directly from files +with the -x command line option and the lexers.load_lexer_from_file() +and formatters.load_formatter_from_file() functions. (PR#559)
  • +
  • Added lexers.find_lexer_class_by_name(). (#1203)
  • +
  • Added new token types and lexing for magic methods and variables in Python +and PHP.
  • +
  • Added a new token type for string affixes and lexing for them in Python, C++ +and Postgresql lexers.
  • +
  • Added a new token type for heredoc (and similar) string delimiters and +lexing for them in C++, Perl, PHP, Postgresql and Ruby lexers.
  • +
  • Styles can now define colors with ANSI colors for use in the 256-color +terminal formatter. (PR#531)
  • +
  • Improved the CSS lexer. (#1083, #1130)
  • +
  • Added “Rainbow Dash” style. (PR#623)
  • +
  • Delay loading pkg_resources, which takes a long while to import. (PR#690)
  • +
+
+
+

Version 2.1.3¶

+

(released Mar 2, 2016)

+
    +
  • Fixed regression in Bash lexer (PR#563)
  • +
+
+
+

Version 2.1.2¶

+

(released Feb 29, 2016)

+
    +
  • Fixed Python 3 regression in image formatter (#1215)
  • +
  • Fixed regression in Bash lexer (PR#562)
  • +
+
+
+

Version 2.1.1¶

+

(relased Feb 14, 2016)

+
    +
  • Fixed Jython compatibility (#1205)
  • +
  • Fixed HTML formatter output with leading empty lines (#1111)
  • +
  • Added a mapping table for LaTeX encodings and added utf8 (#1152)
  • +
  • Fixed image formatter font searching on Macs (#1188)
  • +
  • Fixed deepcopy-ing of Token instances (#1168)
  • +
  • Fixed Julia string interpolation (#1170)
  • +
  • Fixed statefulness of HttpLexer between get_tokens calls
  • +
  • Many smaller fixes to various lexers
  • +
+
+
+

Version 2.1¶

+

(released Jan 17, 2016)

+
    +
  • Added lexers:
      +
    • Emacs Lisp (PR#431)
    • +
    • Arduino (PR#442)
    • +
    • Modula-2 with multi-dialect support (#1090)
    • +
    • Fortran fixed format (PR#213)
    • +
    • Archetype Definition language (PR#483)
    • +
    • Terraform (PR#432)
    • +
    • Jcl, Easytrieve (PR#208)
    • +
    • ParaSail (PR#381)
    • +
    • Boogie (PR#420)
    • +
    • Turtle (PR#425)
    • +
    • Fish Shell (PR#422)
    • +
    • Roboconf (PR#449)
    • +
    • Test Anything Protocol (PR#428)
    • +
    • Shen (PR#385)
    • +
    • Component Pascal (PR#437)
    • +
    • SuperCollider (PR#472)
    • +
    • Shell consoles (Tcsh, PowerShell, MSDOS) (PR#479)
    • +
    • Elm and J (PR#452)
    • +
    • Crmsh (PR#440)
    • +
    • Praat (PR#492)
    • +
    • CSound (PR#494)
    • +
    • Ezhil (PR#443)
    • +
    • Thrift (PR#469)
    • +
    • QVT Operational (PR#204)
    • +
    • Hexdump (PR#508)
    • +
    • CAmkES Configuration (PR#462)
    • +
    +
  • +
  • Added styles:
      +
    • Lovelace (PR#456)
    • +
    • Algol and Algol-nu (#1090)
    • +
    +
  • +
  • Added formatters:
      +
    • IRC (PR#458)
    • +
    • True color (24-bit) terminal ANSI sequences (#1142) +(formatter alias: “16m”)
    • +
    +
  • +
  • New “filename” option for HTML formatter (PR#527).
  • +
  • Improved performance of the HTML formatter for long lines (PR#504).
  • +
  • Updated autopygmentize script (PR#445).
  • +
  • Fixed style inheritance for non-standard token types in HTML output.
  • +
  • Added support for async/await to Python 3 lexer.
  • +
  • Rewrote linenos option for TerminalFormatter (it’s better, but slightly +different output than before) (#1147).
  • +
  • Javascript lexer now supports most of ES6 (#1100).
  • +
  • Cocoa builtins updated for iOS 8.1 (PR#433).
  • +
  • Combined BashSessionLexer and ShellSessionLexer, new version should support +the prompt styles of either.
  • +
  • Added option to pygmentize to show a full traceback on exceptions.
  • +
  • Fixed incomplete output on Windows and Python 3 (e.g. when using iPython +Notebook) (#1153).
  • +
  • Allowed more traceback styles in Python console lexer (PR#253).
  • +
  • Added decorators to TypeScript (PR#509).
  • +
  • Fix highlighting of certain IRC logs formats (#1076).
  • +
+
+
+

Version 2.0.2¶

+

(released Jan 20, 2015)

+
    +
  • Fix Python tracebacks getting duplicated in the console lexer (#1068).
  • +
  • Backquote-delimited identifiers are now recognized in F# (#1062).
  • +
+
+
+

Version 2.0.1¶

+

(released Nov 10, 2014)

+
    +
  • Fix an encoding issue when using pygmentize with the -o option.
  • +
+
+
+

Version 2.0¶

+

(released Nov 9, 2014)

+
    +
  • Default lexer encoding is now “guess”, i.e. UTF-8 / Locale / Latin1 is +tried in that order.
  • +
  • Major update to Swift lexer (PR#410).
  • +
  • Multiple fixes to lexer guessing in conflicting cases:
      +
    • recognize HTML5 by doctype
    • +
    • recognize XML by XML declaration
    • +
    • don’t recognize C/C++ as SystemVerilog
    • +
    +
  • +
  • Simplified regexes and builtin lists.
  • +
+
+
+

Version 2.0rc1¶

+

(released Oct 16, 2014)

+
    +
  • Dropped Python 2.4 and 2.5 compatibility. This is in favor of single-source +compatibility between Python 2.6, 2.7 and 3.3+.
  • +
  • New website and documentation based on Sphinx (finally!)
  • +
  • Lexers added:
      +
    • APL (#969)
    • +
    • Agda and Literate Agda (PR#203)
    • +
    • Alloy (PR#355)
    • +
    • AmbientTalk
    • +
    • BlitzBasic (PR#197)
    • +
    • ChaiScript (PR#24)
    • +
    • Chapel (PR#256)
    • +
    • Cirru (PR#275)
    • +
    • Clay (PR#184)
    • +
    • ColdFusion CFC (PR#283)
    • +
    • Cryptol and Literate Cryptol (PR#344)
    • +
    • Cypher (PR#257)
    • +
    • Docker config files
    • +
    • EBNF (PR#193)
    • +
    • Eiffel (PR#273)
    • +
    • GAP (PR#311)
    • +
    • Golo (PR#309)
    • +
    • Handlebars (PR#186)
    • +
    • Hy (PR#238)
    • +
    • Idris and Literate Idris (PR#210)
    • +
    • Igor Pro (PR#172)
    • +
    • Inform 6/7 (PR#281)
    • +
    • Intel objdump (PR#279)
    • +
    • Isabelle (PR#386)
    • +
    • Jasmin (PR#349)
    • +
    • JSON-LD (PR#289)
    • +
    • Kal (PR#233)
    • +
    • Lean (PR#399)
    • +
    • LSL (PR#296)
    • +
    • Limbo (PR#291)
    • +
    • Liquid (#977)
    • +
    • MQL (PR#285)
    • +
    • MaskJS (PR#280)
    • +
    • Mozilla preprocessors
    • +
    • Mathematica (PR#245)
    • +
    • NesC (PR#166)
    • +
    • Nit (PR#375)
    • +
    • Nix (PR#267)
    • +
    • Pan
    • +
    • Pawn (PR#211)
    • +
    • Perl 6 (PR#181)
    • +
    • Pig (PR#304)
    • +
    • Pike (PR#237)
    • +
    • QBasic (PR#182)
    • +
    • Red (PR#341)
    • +
    • ResourceBundle (#1038)
    • +
    • Rexx (PR#199)
    • +
    • Rql (PR#251)
    • +
    • Rsl
    • +
    • SPARQL (PR#78)
    • +
    • Slim (PR#366)
    • +
    • Swift (PR#371)
    • +
    • Swig (PR#168)
    • +
    • TADS 3 (PR#407)
    • +
    • Todo.txt todo lists
    • +
    • Twig (PR#404)
    • +
    +
  • +
  • Added a helper to “optimize” regular expressions that match one of many +literal words; this can save 20% and more lexing time with lexers that +highlight many keywords or builtins.
  • +
  • New styles: “xcode” and “igor”, similar to the default highlighting of +the respective IDEs.
  • +
  • The command-line “pygmentize” tool now tries a little harder to find the +correct encoding for files and the terminal (#979).
  • +
  • Added “inencoding” option for lexers to override “encoding” analogous +to “outencoding” (#800).
  • +
  • Added line-by-line “streaming” mode for pygmentize with the “-s” option. +(PR#165) Only fully works for lexers that have no constructs spanning +lines!
  • +
  • Added an “envname” option to the LaTeX formatter to select a replacement +verbatim environment (PR#235).
  • +
  • Updated the Makefile lexer to yield a little more useful highlighting.
  • +
  • Lexer aliases passed to get_lexer_by_name() are now case-insensitive.
  • +
  • File name matching in lexers and formatters will now use a regex cache +for speed (PR#205).
  • +
  • Pygments will now recognize “vim” modelines when guessing the lexer for +a file based on content (PR#118).
  • +
  • Major restructure of the pygments.lexers module namespace. There are now +many more modules with less lexers per module. Old modules are still around +and re-export the lexers they previously contained.
  • +
  • The NameHighlightFilter now works with any Name.* token type (#790).
  • +
  • Python 3 lexer: add new exceptions from PEP 3151.
  • +
  • Opa lexer: add new keywords (PR#170).
  • +
  • Julia lexer: add keywords and underscore-separated number +literals (PR#176).
  • +
  • Lasso lexer: fix method highlighting, update builtins. Fix +guessing so that plain XML isn’t always taken as Lasso (PR#163).
  • +
  • Objective C/C++ lexers: allow “@” prefixing any expression (#871).
  • +
  • Ruby lexer: fix lexing of Name::Space tokens (#860) and of symbols +in hashes (#873).
  • +
  • Stan lexer: update for version 2.4.0 of the language (PR#162, PR#255, PR#377).
  • +
  • JavaScript lexer: add the “yield” keyword (PR#196).
  • +
  • HTTP lexer: support for PATCH method (PR#190).
  • +
  • Koka lexer: update to newest language spec (PR#201).
  • +
  • Haxe lexer: rewrite and support for Haxe 3 (PR#174).
  • +
  • Prolog lexer: add different kinds of numeric literals (#864).
  • +
  • F# lexer: rewrite with newest spec for F# 3.0 (#842), fix a bug with +dotted chains (#948).
  • +
  • Kotlin lexer: general update (PR#271).
  • +
  • Rebol lexer: fix comment detection and analyse_text (PR#261).
  • +
  • LLVM lexer: update keywords to v3.4 (PR#258).
  • +
  • PHP lexer: add new keywords and binary literals (PR#222).
  • +
  • external/markdown-processor.py updated to newest python-markdown (PR#221).
  • +
  • CSS lexer: some highlighting order fixes (PR#231).
  • +
  • Ceylon lexer: fix parsing of nested multiline comments (#915).
  • +
  • C family lexers: fix parsing of indented preprocessor directives (#944).
  • +
  • Rust lexer: update to 0.9 language version (PR#270, PR#388).
  • +
  • Elixir lexer: update to 0.15 language version (PR#392).
  • +
  • Fix swallowing incomplete tracebacks in Python console lexer (#874).
  • +
+
+
+

Version 1.6¶

+

(released Feb 3, 2013)

+
    +
  • Lexers added:
      +
    • Dylan console (PR#149)
    • +
    • Logos (PR#150)
    • +
    • Shell sessions (PR#158)
    • +
    +
  • +
  • Fix guessed lexers not receiving lexer options (#838).
  • +
  • Fix unquoted HTML attribute lexing in Opa (#841).
  • +
  • Fixes to the Dart lexer (PR#160).
  • +
+
+
+

Version 1.6rc1¶

+

(released Jan 9, 2013)

+
    +
  • Lexers added:
      +
    • AspectJ (PR#90)
    • +
    • AutoIt (PR#122)
    • +
    • BUGS-like languages (PR#89)
    • +
    • Ceylon (PR#86)
    • +
    • Croc (new name for MiniD)
    • +
    • CUDA (PR#75)
    • +
    • Dg (PR#116)
    • +
    • IDL (PR#115)
    • +
    • Jags (PR#89)
    • +
    • Julia (PR#61)
    • +
    • Kconfig (#711)
    • +
    • Lasso (PR#95, PR#113)
    • +
    • LiveScript (PR#84)
    • +
    • Monkey (PR#117)
    • +
    • Mscgen (PR#80)
    • +
    • NSIS scripts (PR#136)
    • +
    • OpenCOBOL (PR#72)
    • +
    • QML (PR#123)
    • +
    • Puppet (PR#133)
    • +
    • Racket (PR#94)
    • +
    • Rdoc (PR#99)
    • +
    • Robot Framework (PR#137)
    • +
    • RPM spec files (PR#124)
    • +
    • Rust (PR#67)
    • +
    • Smali (Dalvik assembly)
    • +
    • SourcePawn (PR#39)
    • +
    • Stan (PR#89)
    • +
    • Treetop (PR#125)
    • +
    • TypeScript (PR#114)
    • +
    • VGL (PR#12)
    • +
    • Visual FoxPro (#762)
    • +
    • Windows Registry (#819)
    • +
    • Xtend (PR#68)
    • +
    +
  • +
  • The HTML formatter now supports linking to tags using CTags files, when the +python-ctags package is installed (PR#87).
  • +
  • The HTML formatter now has a “linespans” option that wraps every line in a +<span> tag with a specific id (PR#82).
  • +
  • When deriving a lexer from another lexer with token definitions, definitions +for states not in the child lexer are now inherited. If you override a state +in the child lexer, an “inherit” keyword has been added to insert the base +state at that position (PR#141).
  • +
  • The C family lexers now inherit token definitions from a common base class, +removing code duplication (PR#141).
  • +
  • Use “colorama” on Windows for console color output (PR#142).
  • +
  • Fix Template Haskell highlighting (PR#63).
  • +
  • Fix some S/R lexer errors (PR#91).
  • +
  • Fix a bug in the Prolog lexer with names that start with ‘is’ (#810).
  • +
  • Rewrite Dylan lexer, add Dylan LID lexer (PR#147).
  • +
  • Add a Java quickstart document (PR#146).
  • +
  • Add a “external/autopygmentize” file that can be used as .lessfilter (#802).
  • +
+
+
+

Version 1.5¶

+

(codename Zeitdilatation, released Mar 10, 2012)

+
    +
  • Lexers added:
      +
    • Awk (#630)
    • +
    • Fancy (#633)
    • +
    • PyPy Log
    • +
    • eC
    • +
    • Nimrod
    • +
    • Nemerle (#667)
    • +
    • F# (#353)
    • +
    • Groovy (#501)
    • +
    • PostgreSQL (#660)
    • +
    • DTD
    • +
    • Gosu (#634)
    • +
    • Octave (PR#22)
    • +
    • Standard ML (PR#14)
    • +
    • CFengine3 (#601)
    • +
    • Opa (PR#37)
    • +
    • HTTP sessions (PR#42)
    • +
    • JSON (PR#31)
    • +
    • SNOBOL (PR#30)
    • +
    • MoonScript (PR#43)
    • +
    • ECL (PR#29)
    • +
    • Urbiscript (PR#17)
    • +
    • OpenEdge ABL (PR#27)
    • +
    • SystemVerilog (PR#35)
    • +
    • Coq (#734)
    • +
    • PowerShell (#654)
    • +
    • Dart (#715)
    • +
    • Fantom (PR#36)
    • +
    • Bro (PR#5)
    • +
    • NewLISP (PR#26)
    • +
    • VHDL (PR#45)
    • +
    • Scilab (#740)
    • +
    • Elixir (PR#57)
    • +
    • Tea (PR#56)
    • +
    • Kotlin (PR#58)
    • +
    +
  • +
  • Fix Python 3 terminal highlighting with pygmentize (#691).
  • +
  • In the LaTeX formatter, escape special &, < and > chars (#648).
  • +
  • In the LaTeX formatter, fix display problems for styles with token +background colors (#670).
  • +
  • Enhancements to the Squid conf lexer (#664).
  • +
  • Several fixes to the reStructuredText lexer (#636).
  • +
  • Recognize methods in the ObjC lexer (#638).
  • +
  • Fix Lua “class” highlighting: it does not have classes (#665).
  • +
  • Fix degenerate regex in Scala lexer (#671) and highlighting bugs (#713, 708).
  • +
  • Fix number pattern order in Ocaml lexer (#647).
  • +
  • Fix generic type highlighting in ActionScript 3 (#666).
  • +
  • Fixes to the Clojure lexer (PR#9).
  • +
  • Fix degenerate regex in Nemerle lexer (#706).
  • +
  • Fix infinite looping in CoffeeScript lexer (#729).
  • +
  • Fix crashes and analysis with ObjectiveC lexer (#693, #696).
  • +
  • Add some Fortran 2003 keywords.
  • +
  • Fix Boo string regexes (#679).
  • +
  • Add “rrt” style (#727).
  • +
  • Fix infinite looping in Darcs Patch lexer.
  • +
  • Lots of misc fixes to character-eating bugs and ordering problems in many +different lexers.
  • +
+
+
+

Version 1.4¶

+

(codename Unschärfe, released Jan 03, 2011)

+
    +
  • Lexers added:
      +
    • Factor (#520)
    • +
    • PostScript (#486)
    • +
    • Verilog (#491)
    • +
    • BlitzMax Basic (#478)
    • +
    • Ioke (#465)
    • +
    • Java properties, split out of the INI lexer (#445)
    • +
    • Scss (#509)
    • +
    • Duel/JBST
    • +
    • XQuery (#617)
    • +
    • Mason (#615)
    • +
    • GoodData (#609)
    • +
    • SSP (#473)
    • +
    • Autohotkey (#417)
    • +
    • Google Protocol Buffers
    • +
    • Hybris (#506)
    • +
    +
  • +
  • Do not fail in analyse_text methods (#618).
  • +
  • Performance improvements in the HTML formatter (#523).
  • +
  • With the noclasses option in the HTML formatter, some styles +present in the stylesheet were not added as inline styles.
  • +
  • Four fixes to the Lua lexer (#480, #481, #482, #497).
  • +
  • More context-sensitive Gherkin lexer with support for more i18n translations.
  • +
  • Support new OO keywords in Matlab lexer (#521).
  • +
  • Small fix in the CoffeeScript lexer (#519).
  • +
  • A bugfix for backslashes in ocaml strings (#499).
  • +
  • Fix unicode/raw docstrings in the Python lexer (#489).
  • +
  • Allow PIL to work without PIL.pth (#502).
  • +
  • Allow seconds as a unit in CSS (#496).
  • +
  • Support application/javascript as a JavaScript mime type (#504).
  • +
  • Support Offload C++ Extensions as +keywords in the C++ lexer (#484).
  • +
  • Escape more characters in LaTeX output (#505).
  • +
  • Update Haml/Sass lexers to version 3 (#509).
  • +
  • Small PHP lexer string escaping fix (#515).
  • +
  • Support comments before preprocessor directives, and unsigned/ +long long literals in C/C++ (#613, #616).
  • +
  • Support line continuations in the INI lexer (#494).
  • +
  • Fix lexing of Dylan string and char literals (#628).
  • +
  • Fix class/procedure name highlighting in VB.NET lexer (#624).
  • +
+
+
+

Version 1.3.1¶

+

(bugfix release, released Mar 05, 2010)

+
    +
  • The pygmentize script was missing from the distribution.
  • +
+
+
+

Version 1.3¶

+

(codename Schneeglöckchen, released Mar 01, 2010)

+
    +
  • Added the ensurenl lexer option, which can be used to suppress the +automatic addition of a newline to the lexer input.
  • +
  • Lexers added:
      +
    • Ada
    • +
    • Coldfusion
    • +
    • Modula-2
    • +
    • Haxe
    • +
    • R console
    • +
    • Objective-J
    • +
    • Haml and Sass
    • +
    • CoffeeScript
    • +
    +
  • +
  • Enhanced reStructuredText highlighting.
  • +
  • Added support for PHP 5.3 namespaces in the PHP lexer.
  • +
  • Added a bash completion script for pygmentize, to the external/ +directory (#466).
  • +
  • Fixed a bug in do_insertions() used for multi-lexer languages.
  • +
  • Fixed a Ruby regex highlighting bug (#476).
  • +
  • Fixed regex highlighting bugs in Perl lexer (#258).
  • +
  • Add small enhancements to the C lexer (#467) and Bash lexer (#469).
  • +
  • Small fixes for the Tcl, Debian control file, Nginx config, +Smalltalk, Objective-C, Clojure, Lua lexers.
  • +
  • Gherkin lexer: Fixed single apostrophe bug and added new i18n keywords.
  • +
+
+
+

Version 1.2.2¶

+

(bugfix release, released Jan 02, 2010)

+
    +
  • Removed a backwards incompatibility in the LaTeX formatter that caused +Sphinx to produce invalid commands when writing LaTeX output (#463).
  • +
  • Fixed a forever-backtracking regex in the BashLexer (#462).
  • +
+
+
+

Version 1.2.1¶

+

(bugfix release, released Jan 02, 2010)

+
    +
  • Fixed mishandling of an ellipsis in place of the frames in a Python +console traceback, resulting in clobbered output.
  • +
+
+
+

Version 1.2¶

+

(codename Neujahr, released Jan 01, 2010)

+
    +
  • Dropped Python 2.3 compatibility.
  • +
  • Lexers added:
      +
    • Asymptote
    • +
    • Go
    • +
    • Gherkin (Cucumber)
    • +
    • CMake
    • +
    • Ooc
    • +
    • Coldfusion
    • +
    • Haxe
    • +
    • R console
    • +
    +
  • +
  • Added options for rendering LaTeX in source code comments in the +LaTeX formatter (#461).
  • +
  • Updated the Logtalk lexer.
  • +
  • Added line_number_start option to image formatter (#456).
  • +
  • Added hl_lines and hl_color options to image formatter (#457).
  • +
  • Fixed the HtmlFormatter’s handling of noclasses=True to not output any +classes (#427).
  • +
  • Added the Monokai style (#453).
  • +
  • Fixed LLVM lexer identifier syntax and added new keywords (#442).
  • +
  • Fixed the PythonTracebackLexer to handle non-traceback data in header or +trailer, and support more partial tracebacks that start on line 2 (#437).
  • +
  • Fixed the CLexer to not highlight ternary statements as labels.
  • +
  • Fixed lexing of some Ruby quoting peculiarities (#460).
  • +
  • A few ASM lexer fixes (#450).
  • +
+
+
+

Version 1.1.1¶

+

(bugfix release, released Sep 15, 2009)

+
    +
  • Fixed the BBCode lexer (#435).
  • +
  • Added support for new Jinja2 keywords.
  • +
  • Fixed test suite failures.
  • +
  • Added Gentoo-specific suffixes to Bash lexer.
  • +
+
+
+

Version 1.1¶

+

(codename Brillouin, released Sep 11, 2009)

+
    +
  • Ported Pygments to Python 3. This needed a few changes in the way +encodings are handled; they may affect corner cases when used with +Python 2 as well.
  • +
  • Lexers added:
      +
    • Antlr/Ragel, thanks to Ana Nelson
    • +
    • (Ba)sh shell
    • +
    • Erlang shell
    • +
    • GLSL
    • +
    • Prolog
    • +
    • Evoque
    • +
    • Modelica
    • +
    • Rebol
    • +
    • MXML
    • +
    • Cython
    • +
    • ABAP
    • +
    • ASP.net (VB/C#)
    • +
    • Vala
    • +
    • Newspeak
    • +
    +
  • +
  • Fixed the LaTeX formatter’s output so that output generated for one style +can be used with the style definitions of another (#384).
  • +
  • Added “anchorlinenos” and “noclobber_cssfile” (#396) options to HTML +formatter.
  • +
  • Support multiline strings in Lua lexer.
  • +
  • Rewrite of the JavaScript lexer by Pumbaa80 to better support regular +expression literals (#403).
  • +
  • When pygmentize is asked to highlight a file for which multiple lexers +match the filename, use the analyse_text guessing engine to determine the +winner (#355).
  • +
  • Fixed minor bugs in the JavaScript lexer (#383), the Matlab lexer (#378), +the Scala lexer (#392), the INI lexer (#391), the Clojure lexer (#387) +and the AS3 lexer (#389).
  • +
  • Fixed three Perl heredoc lexing bugs (#379, #400, #422).
  • +
  • Fixed a bug in the image formatter which misdetected lines (#380).
  • +
  • Fixed bugs lexing extended Ruby strings and regexes.
  • +
  • Fixed a bug when lexing git diffs.
  • +
  • Fixed a bug lexing the empty commit in the PHP lexer (#405).
  • +
  • Fixed a bug causing Python numbers to be mishighlighted as floats (#397).
  • +
  • Fixed a bug when backslashes are used in odd locations in Python (#395).
  • +
  • Fixed various bugs in Matlab and S-Plus lexers, thanks to Winston Chang (#410, +#411, #413, #414) and fmarc (#419).
  • +
  • Fixed a bug in Haskell single-line comment detection (#426).
  • +
  • Added new-style reStructuredText directive for docutils 0.5+ (#428).
  • +
+
+
+

Version 1.0¶

+

(codename Dreiundzwanzig, released Nov 23, 2008)

+
    +
  • Don’t use join(splitlines()) when converting newlines to \n, +because that doesn’t keep all newlines at the end when the +stripnl lexer option is False.

    +
  • +
  • Added -N option to command-line interface to get a lexer name +for a given filename.

    +
  • +
  • Added Tango style, written by Andre Roberge for the Crunchy project.

    +
  • +
  • Added Python3TracebackLexer and python3 option to +PythonConsoleLexer.

    +
  • +
  • Fixed a few bugs in the Haskell lexer.

    +
  • +
  • Fixed PythonTracebackLexer to be able to recognize SyntaxError and +KeyboardInterrupt (#360).

    +
  • +
  • Provide one formatter class per image format, so that surprises like:

    +
    pygmentize -f gif -o foo.gif foo.py
    +
    +
    +

    creating a PNG file are avoided.

    +
  • +
  • Actually use the font_size option of the image formatter.

    +
  • +
  • Fixed numpy lexer that it doesn’t listen for *.py any longer.

    +
  • +
  • Fixed HTML formatter so that text options can be Unicode +strings (#371).

    +
  • +
  • Unified Diff lexer supports the “udiff” alias now.

    +
  • +
  • Fixed a few issues in Scala lexer (#367).

    +
  • +
  • RubyConsoleLexer now supports simple prompt mode (#363).

    +
  • +
  • JavascriptLexer is smarter about what constitutes a regex (#356).

    +
  • +
  • Add Applescript lexer, thanks to Andreas Amann (#330).

    +
  • +
  • Make the codetags more strict about matching words (#368).

    +
  • +
  • NginxConfLexer is a little more accurate on mimetypes and +variables (#370).

    +
  • +
+
+
+

Version 0.11.1¶

+

(released Aug 24, 2008)

+
    +
  • Fixed a Jython compatibility issue in pygments.unistring (#358).
  • +
+
+
+

Version 0.11¶

+

(codename Straußenei, released Aug 23, 2008)

+

Many thanks go to Tim Hatch for writing or integrating most of the bug +fixes and new features.

+
    +
  • Lexers added:
      +
    • Nasm-style assembly language, thanks to delroth
    • +
    • YAML, thanks to Kirill Simonov
    • +
    • ActionScript 3, thanks to Pierre Bourdon
    • +
    • Cheetah/Spitfire templates, thanks to Matt Good
    • +
    • Lighttpd config files
    • +
    • Nginx config files
    • +
    • Gnuplot plotting scripts
    • +
    • Clojure
    • +
    • POV-Ray scene files
    • +
    • Sqlite3 interactive console sessions
    • +
    • Scala source files, thanks to Krzysiek Goj
    • +
    +
  • +
  • Lexers improved:
      +
    • C lexer highlights standard library functions now and supports C99 +types.
    • +
    • Bash lexer now correctly highlights heredocs without preceding +whitespace.
    • +
    • Vim lexer now highlights hex colors properly and knows a couple +more keywords.
    • +
    • Irc logs lexer now handles xchat’s default time format (#340) and +correctly highlights lines ending in >.
    • +
    • Support more delimiters for perl regular expressions (#258).
    • +
    • ObjectiveC lexer now supports 2.0 features.
    • +
    +
  • +
  • Added “Visual Studio” style.
  • +
  • Updated markdown processor to Markdown 1.7.
  • +
  • Support roman/sans/mono style defs and use them in the LaTeX +formatter.
  • +
  • The RawTokenFormatter is no longer registered to *.raw and it’s +documented that tokenization with this lexer may raise exceptions.
  • +
  • New option hl_lines to HTML formatter, to highlight certain +lines.
  • +
  • New option prestyles to HTML formatter.
  • +
  • New option -g to pygmentize, to allow lexer guessing based on +filetext (can be slowish, so file extensions are still checked +first).
  • +
  • guess_lexer() now makes its decision much faster due to a cache +of whether data is xml-like (a check which is used in several +versions of analyse_text(). Several lexers also have more +accurate analyse_text() now.
  • +
+
+
+

Version 0.10¶

+

(codename Malzeug, released May 06, 2008)

+
    +
  • Lexers added:
      +
    • Io
    • +
    • Smalltalk
    • +
    • Darcs patches
    • +
    • Tcl
    • +
    • Matlab
    • +
    • Matlab sessions
    • +
    • FORTRAN
    • +
    • XSLT
    • +
    • tcsh
    • +
    • NumPy
    • +
    • Python 3
    • +
    • S, S-plus, R statistics languages
    • +
    • Logtalk
    • +
    +
  • +
  • In the LatexFormatter, the commandprefix option is now by default +‘PY’ instead of ‘C’, since the latter resulted in several collisions +with other packages. Also, the special meaning of the arg +argument to get_style_defs() was removed.
  • +
  • Added ImageFormatter, to format code as PNG, JPG, GIF or BMP. +(Needs the Python Imaging Library.)
  • +
  • Support doc comments in the PHP lexer.
  • +
  • Handle format specifications in the Perl lexer.
  • +
  • Fix comment handling in the Batch lexer.
  • +
  • Add more file name extensions for the C++, INI and XML lexers.
  • +
  • Fixes in the IRC and MuPad lexers.
  • +
  • Fix function and interface name highlighting in the Java lexer.
  • +
  • Fix at-rule handling in the CSS lexer.
  • +
  • Handle KeyboardInterrupts gracefully in pygmentize.
  • +
  • Added BlackWhiteStyle.
  • +
  • Bash lexer now correctly highlights math, does not require +whitespace after semicolons, and correctly highlights boolean +operators.
  • +
  • Makefile lexer is now capable of handling BSD and GNU make syntax.
  • +
+
+
+

Version 0.9¶

+

(codename Herbstzeitlose, released Oct 14, 2007)

+
    +
  • Lexers added:
      +
    • Erlang
    • +
    • ActionScript
    • +
    • Literate Haskell
    • +
    • Common Lisp
    • +
    • Various assembly languages
    • +
    • Gettext catalogs
    • +
    • Squid configuration
    • +
    • Debian control files
    • +
    • MySQL-style SQL
    • +
    • MOOCode
    • +
    +
  • +
  • Lexers improved:
      +
    • Greatly improved the Haskell and OCaml lexers.
    • +
    • Improved the Bash lexer’s handling of nested constructs.
    • +
    • The C# and Java lexers exhibited abysmal performance with some +input code; this should now be fixed.
    • +
    • The IRC logs lexer is now able to colorize weechat logs too.
    • +
    • The Lua lexer now recognizes multi-line comments.
    • +
    • Fixed bugs in the D and MiniD lexer.
    • +
    +
  • +
  • The encoding handling of the command line mode (pygmentize) was +enhanced. You shouldn’t get UnicodeErrors from it anymore if you +don’t give an encoding option.
  • +
  • Added a -P option to the command line mode which can be used to +give options whose values contain commas or equals signs.
  • +
  • Added 256-color terminal formatter.
  • +
  • Added an experimental SVG formatter.
  • +
  • Added the lineanchors option to the HTML formatter, thanks to +Ian Charnas for the idea.
  • +
  • Gave the line numbers table a CSS class in the HTML formatter.
  • +
  • Added a Vim 7-like style.
  • +
+
+
+

Version 0.8.1¶

+

(released Jun 27, 2007)

+
    +
  • Fixed POD highlighting in the Ruby lexer.
  • +
  • Fixed Unicode class and namespace name highlighting in the C# lexer.
  • +
  • Fixed Unicode string prefix highlighting in the Python lexer.
  • +
  • Fixed a bug in the D and MiniD lexers.
  • +
  • Fixed the included MoinMoin parser.
  • +
+
+
+

Version 0.8¶

+

(codename Maikäfer, released May 30, 2007)

+
    +
  • Lexers added:
      +
    • Haskell, thanks to Adam Blinkinsop
    • +
    • Redcode, thanks to Adam Blinkinsop
    • +
    • D, thanks to Kirk McDonald
    • +
    • MuPad, thanks to Christopher Creutzig
    • +
    • MiniD, thanks to Jarrett Billingsley
    • +
    • Vim Script, by Tim Hatch
    • +
    +
  • +
  • The HTML formatter now has a second line-numbers mode in which it +will just integrate the numbers in the same <pre> tag as the +code.
  • +
  • The CSharpLexer now is Unicode-aware, which means that it has an +option that can be set so that it correctly lexes Unicode +identifiers allowed by the C# specs.
  • +
  • Added a RaiseOnErrorTokenFilter that raises an exception when the +lexer generates an error token, and a VisibleWhitespaceFilter that +converts whitespace (spaces, tabs, newlines) into visible +characters.
  • +
  • Fixed the do_insertions() helper function to yield correct +indices.
  • +
  • The ReST lexer now automatically highlights source code blocks in +“.. sourcecode:: language” and “.. code:: language” directive +blocks.
  • +
  • Improved the default style (thanks to Tiberius Teng). The old +default is still available as the “emacs” style (which was an alias +before).
  • +
  • The get_style_defs method of HTML formatters now uses the +cssclass option as the default selector if it was given.
  • +
  • Improved the ReST and Bash lexers a bit.
  • +
  • Fixed a few bugs in the Makefile and Bash lexers, thanks to Tim +Hatch.
  • +
  • Fixed a bug in the command line code that disallowed -O options +when using the -S option.
  • +
  • Fixed a bug in the RawTokenFormatter.
  • +
+
+
+

Version 0.7.1¶

+

(released Feb 15, 2007)

+
    +
  • Fixed little highlighting bugs in the Python, Java, Scheme and +Apache Config lexers.
  • +
  • Updated the included manpage.
  • +
  • Included a built version of the documentation in the source tarball.
  • +
+
+
+

Version 0.7¶

+

(codename Faschingskrapfn, released Feb 14, 2007)

+
    +
  • Added a MoinMoin parser that uses Pygments. With it, you get +Pygments highlighting in Moin Wiki pages.
  • +
  • Changed the exception raised if no suitable lexer, formatter etc. is +found in one of the get_*_by_* functions to a custom exception, +pygments.util.ClassNotFound. It is, however, a subclass of +ValueError in order to retain backwards compatibility.
  • +
  • Added a -H command line option which can be used to get the +docstring of a lexer, formatter or filter.
  • +
  • Made the handling of lexers and formatters more consistent. The +aliases and filename patterns of formatters are now attributes on +them.
  • +
  • Added an OCaml lexer, thanks to Adam Blinkinsop.
  • +
  • Made the HTML formatter more flexible, and easily subclassable in +order to make it easy to implement custom wrappers, e.g. alternate +line number markup. See the documentation.
  • +
  • Added an outencoding option to all formatters, making it possible +to override the encoding (which is used by lexers and formatters) +when using the command line interface. Also, if using the terminal +formatter and the output file is a terminal and has an encoding +attribute, use it if no encoding is given.
  • +
  • Made it possible to just drop style modules into the styles +subpackage of the Pygments installation.
  • +
  • Added a “state” keyword argument to the using helper.
  • +
  • Added a commandprefix option to the LatexFormatter which allows +to control how the command names are constructed.
  • +
  • Added quite a few new lexers, thanks to Tim Hatch:
      +
    • Java Server Pages
    • +
    • Windows batch files
    • +
    • Trac Wiki markup
    • +
    • Python tracebacks
    • +
    • ReStructuredText
    • +
    • Dylan
    • +
    • and the Befunge esoteric programming language (yay!)
    • +
    +
  • +
  • Added Mako lexers by Ben Bangert.
  • +
  • Added “fruity” style, another dark background originally vim-based +theme.
  • +
  • Added sources.list lexer by Dennis Kaarsemaker.
  • +
  • Added token stream filters, and a pygmentize option to use them.
  • +
  • Changed behavior of in Operator for tokens.
  • +
  • Added mimetypes for all lexers.
  • +
  • Fixed some problems lexing Python strings.
  • +
  • Fixed tickets: #167, #178, #179, #180, #185, #201.
  • +
+
+
+

Version 0.6¶

+

(codename Zimtstern, released Dec 20, 2006)

+
    +
  • Added option for the HTML formatter to write the CSS to an external +file in “full document” mode.
  • +
  • Added RTF formatter.
  • +
  • Added Bash and Apache configuration lexers (thanks to Tim Hatch).
  • +
  • Improved guessing methods for various lexers.
  • +
  • Added @media support to CSS lexer (thanks to Tim Hatch).
  • +
  • Added a Groff lexer (thanks to Tim Hatch).
  • +
  • License change to BSD.
  • +
  • Added lexers for the Myghty template language.
  • +
  • Added a Scheme lexer (thanks to Marek Kubica).
  • +
  • Added some functions to iterate over existing lexers, formatters and +lexers.
  • +
  • The HtmlFormatter’s get_style_defs() can now take a list as an +argument to generate CSS with multiple prefixes.
  • +
  • Support for guessing input encoding added.
  • +
  • Encoding support added: all processing is now done with Unicode +strings, input and output are converted from and optionally to byte +strings (see the encoding option of lexers and formatters).
  • +
  • Some improvements in the C(++) lexers handling comments and line +continuations.
  • +
+
+
+

Version 0.5.1¶

+

(released Oct 30, 2006)

+
    +
  • Fixed traceback in pygmentize -L (thanks to Piotr Ozarowski).
  • +
+
+
+

Version 0.5¶

+

(codename PyKleur, released Oct 30, 2006)

+
    +
  • Initial public release.
  • +
+
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/cmdline.html b/doc/_build/html/docs/cmdline.html new file mode 100644 index 0000000..7ab0330 --- /dev/null +++ b/doc/_build/html/docs/cmdline.html @@ -0,0 +1,276 @@ + + + + + + + + Command Line Interface — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Command Line Interface¶

+

You can use Pygments from the shell, provided you installed the +pygmentize script:

+
$ pygmentize test.py
+print "Hello World"
+
+
+

will print the file test.py to standard output, using the Python lexer +(inferred from the file name extension) and the terminal formatter (because +you didn’t give an explicit formatter name).

+

If you want HTML output:

+
$ pygmentize -f html -l python -o test.html test.py
+
+
+

As you can see, the -l option explicitly selects a lexer. As seen above, if you +give an input file name and it has an extension that Pygments recognizes, you can +omit this option.

+

The -o option gives an output file name. If it is not given, output is +written to stdout.

+

The -f option selects a formatter (as with -l, it can also be omitted +if an output file name is given and has a supported extension). +If no output file name is given and -f is omitted, the +TerminalFormatter is used.

+

The above command could therefore also be given as:

+
$ pygmentize -o test.html test.py
+
+
+

To create a full HTML document, including line numbers and stylesheet (using the +“emacs” style), highlighting the Python file test.py to test.html:

+
$ pygmentize -O full,style=emacs -o test.html test.py
+
+
+
+

Options and filters¶

+

Lexer and formatter options can be given using the -O option:

+
$ pygmentize -f html -O style=colorful,linenos=1 -l python test.py
+
+
+

Be sure to enclose the option string in quotes if it contains any special shell +characters, such as spaces or expansion wildcards like *. If an option +expects a list value, separate the list entries with spaces (you’ll have to +quote the option value in this case too, so that the shell doesn’t split it).

+

Since the -O option argument is split at commas and expects the split values +to be of the form name=value, you can’t give an option value that contains +commas or equals signs. Therefore, an option -P is provided (as of Pygments +0.9) that works like -O but can only pass one option per -P. Its value +can then contain all characters:

+
$ pygmentize -P "heading=Pygments, the Python highlighter" ...
+
+
+

Filters are added to the token stream using the -F option:

+
$ pygmentize -f html -l pascal -F keywordcase:case=upper main.pas
+
+
+

As you see, options for the filter are given after a colon. As for -O, the +filter name and options must be one shell word, so there may not be any spaces +around the colon.

+
+
+

Generating styles¶

+

Formatters normally don’t output full style information. For example, the HTML +formatter by default only outputs <span> tags with class attributes. +Therefore, there’s a special -S option for generating style definitions. +Usage is as follows:

+
$ pygmentize -f html -S colorful -a .syntax
+
+
+

generates a CSS style sheet (because you selected the HTML formatter) for +the “colorful” style prepending a “.syntax” selector to all style rules.

+

For an explanation what -a means for a particular formatter, look for the arg argument for the formatter’s +get_style_defs() method.

+
+
+

Getting lexer names¶

+
+

New in version 1.0.

+
+

The -N option guesses a lexer name for a given filename, so that

+
$ pygmentize -N setup.py
+
+
+

will print out python. It won’t highlight anything yet. If no specific +lexer is known for that filename, text is printed.

+
+
+

Custom Lexers and Formatters¶

+
+

New in version 2.2.

+
+

The -x flag enables custom lexers and formatters to be loaded +from files relative to the current directory. Create a file with a class named +CustomLexer or CustomFormatter, then specify it on the command line:

+
$ pygmentize -l your_lexer.py -f your_formatter.py -x
+
+
+

You can also specify the name of your class with a colon:

+
$ pygmentize -l your_lexer.py:SomeLexer -x
+
+
+

For more information, see the Pygments documentation on Lexer development.

+
+
+

Getting help¶

+

The -L option lists lexers, formatters, along with their short +names and supported file name extensions, styles and filters. If you want to see +only one category, give it as an argument:

+
$ pygmentize -L filters
+
+
+

will list only all installed filters.

+

The -H option will give you detailed information (the same that can be found +in this documentation) about a lexer, formatter or filter. Usage is as follows:

+
$ pygmentize -H formatter html
+
+
+

will print the help for the HTML formatter, while

+
$ pygmentize -H lexer python
+
+
+

will print the help for the Python lexer, etc.

+
+
+

A note on encodings¶

+
+

New in version 0.9.

+
+

Pygments tries to be smart regarding encodings in the formatting process:

+
    +
  • If you give an encoding option, it will be used as the input and +output encoding.
  • +
  • If you give an outencoding option, it will override encoding +as the output encoding.
  • +
  • If you give an inencoding option, it will override encoding +as the input encoding.
  • +
  • If you don’t give an encoding and have given an output file, the default +encoding for lexer and formatter is the terminal encoding or the default +locale encoding of the system. As a last resort, latin1 is used (which +will pass through all non-ASCII characters).
  • +
  • If you don’t give an encoding and haven’t given an output file (that means +output is written to the console), the default encoding for lexer and +formatter is the terminal encoding (sys.stdout.encoding).
  • +
+
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/filterdevelopment.html b/doc/_build/html/docs/filterdevelopment.html new file mode 100644 index 0000000..d424713 --- /dev/null +++ b/doc/_build/html/docs/filterdevelopment.html @@ -0,0 +1,188 @@ + + + + + + + + Write your own filter — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Write your own filter¶

+
+

New in version 0.7.

+
+

Writing own filters is very easy. All you have to do is to subclass +the Filter class and override the filter method. Additionally a +filter is instantiated with some keyword arguments you can use to +adjust the behavior of your filter.

+
+

Subclassing Filters¶

+

As an example, we write a filter that converts all Name.Function tokens +to normal Name tokens to make the output less colorful.

+
from pygments.util import get_bool_opt
+from pygments.token import Name
+from pygments.filter import Filter
+
+class UncolorFilter(Filter):
+
+    def __init__(self, **options):
+        Filter.__init__(self, **options)
+        self.class_too = get_bool_opt(options, 'classtoo')
+
+    def filter(self, lexer, stream):
+        for ttype, value in stream:
+            if ttype is Name.Function or (self.class_too and
+                                          ttype is Name.Class):
+                ttype = Name
+            yield ttype, value
+
+
+

Some notes on the lexer argument: that can be quite confusing since it doesn’t +need to be a lexer instance. If a filter was added by using the add_filter() +function of lexers, that lexer is registered for the filter. In that case +lexer will refer to the lexer that has registered the filter. It can be used +to access options passed to a lexer. Because it could be None you always have +to check for that case if you access it.

+
+
+

Using a decorator¶

+

You can also use the simplefilter decorator from the pygments.filter module:

+
from pygments.util import get_bool_opt
+from pygments.token import Name
+from pygments.filter import simplefilter
+
+
+@simplefilter
+def uncolor(self, lexer, stream, options):
+    class_too = get_bool_opt(options, 'classtoo')
+    for ttype, value in stream:
+        if ttype is Name.Function or (class_too and
+                                      ttype is Name.Class):
+            ttype = Name
+        yield ttype, value
+
+
+

The decorator automatically subclasses an internal filter class and uses the +decorated function as a method for filtering. (That’s why there is a self +argument that you probably won’t end up using in the method.)

+
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/filters.html b/doc/_build/html/docs/filters.html new file mode 100644 index 0000000..b157859 --- /dev/null +++ b/doc/_build/html/docs/filters.html @@ -0,0 +1,339 @@ + + + + + + + + Filters — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Filters¶

+
+

New in version 0.7.

+
+

You can filter token streams coming from lexers to improve or annotate the +output. For example, you can highlight special words in comments, convert +keywords to upper or lowercase to enforce a style guide etc.

+

To apply a filter, you can use the add_filter() method of a lexer:

+
>>> from pygments.lexers import PythonLexer
+>>> l = PythonLexer()
+>>> # add a filter given by a string and options
+>>> l.add_filter('codetagify', case='lower')
+>>> l.filters
+[<pygments.filters.CodeTagFilter object at 0xb785decc>]
+>>> from pygments.filters import KeywordCaseFilter
+>>> # or give an instance
+>>> l.add_filter(KeywordCaseFilter(case='lower'))
+
+
+

The add_filter() method takes keyword arguments which are forwarded to +the constructor of the filter.

+

To get a list of all registered filters by name, you can use the +get_all_filters() function from the pygments.filters module that returns an +iterable for all known filters.

+

If you want to write your own filter, have a look at Write your own filter.

+
+

Builtin Filters¶

+
+
+class CodeTagFilter¶
+
+++ + + + +
Name:codetagify
+

Highlight special code tags in comments and docstrings.

+

Options accepted:

+
+
codetags : list of strings
+
A list of strings that are flagged as code tags. The default is to +highlight XXX, TODO, BUG and NOTE.
+
+
+ +
+
+class KeywordCaseFilter¶
+
+++ + + + +
Name:keywordcase
+

Convert keywords to lowercase or uppercase or capitalize them, which +means first letter uppercase, rest lowercase.

+

This can be useful e.g. if you highlight Pascal code and want to adapt the +code to your styleguide.

+

Options accepted:

+
+
case : string
+
The casing to convert keywords to. Must be one of 'lower', +'upper' or 'capitalize'. The default is 'lower'.
+
+
+ +
+
+class NameHighlightFilter¶
+
+++ + + + +
Name:highlight
+

Highlight a normal Name (and Name.*) token with a different token type.

+

Example:

+
filter = NameHighlightFilter(
+    names=['foo', 'bar', 'baz'],
+    tokentype=Name.Function,
+)
+
+
+

This would highlight the names “foo”, “bar” and “baz” +as functions. Name.Function is the default token type.

+

Options accepted:

+
+
names : list of strings
+
A list of names that should be given the different token type. +There is no default.
+
tokentype : TokenType or string
+
A token type or a string containing a token type name that is +used for highlighting the strings in names. The default is +Name.Function.
+
+
+ +
+
+class RaiseOnErrorTokenFilter¶
+
+++ + + + +
Name:raiseonerror
+

Raise an exception when the lexer generates an error token.

+

Options accepted:

+
+
excclass : Exception class
+
The exception class to raise. +The default is pygments.filters.ErrorToken.
+
+
+

New in version 0.8.

+
+
+ +
+
+class VisibleWhitespaceFilter¶
+
+++ + + + +
Name:whitespace
+

Convert tabs, newlines and/or spaces to visible characters.

+

Options accepted:

+
+
spaces : string or bool
+
If this is a one-character string, spaces will be replaces by this string. +If it is another true value, spaces will be replaced by · (unicode +MIDDLE DOT). If it is a false value, spaces will not be replaced. The +default is False.
+
tabs : string or bool
+
The same as for spaces, but the default replacement character is » +(unicode RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK). The default value +is False. Note: this will not work if the tabsize option for the +lexer is nonzero, as tabs will already have been expanded then.
+
tabsize : int
+
If tabs are to be replaced by this filter (see the tabs option), this +is the total number of characters that a tab should be expanded to. +The default is 8.
+
newlines : string or bool
+
The same as for spaces, but the default replacement character is ¶ +(unicode PILCROW SIGN). The default value is False.
+
wstokentype : bool
+
If true, give whitespace the special Whitespace token type. This allows +styling the visible whitespace differently (e.g. greyed out), but it can +disrupt background colors. The default is True.
+
+
+

New in version 0.8.

+
+
+ +
+
+class GobbleFilter¶
+
+++ + + + +
Name:gobble
+

Gobbles source code lines (eats initial characters).

+

This filter drops the first n characters off every line of code. This +may be useful when the source code fed to the lexer is indented by a fixed +amount of space that isn’t desired in the output.

+

Options accepted:

+
+
n : int
+
The number of characters to gobble.
+
+
+

New in version 1.2.

+
+
+ +
+
+class TokenMergeFilter¶
+
+++ + + + +
Name:tokenmerge
+

Merges consecutive tokens with the same token type in the output +stream of a lexer.

+
+

New in version 1.2.

+
+
+ +
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/formatterdevelopment.html b/doc/_build/html/docs/formatterdevelopment.html new file mode 100644 index 0000000..98a79f8 --- /dev/null +++ b/doc/_build/html/docs/formatterdevelopment.html @@ -0,0 +1,275 @@ + + + + + + + + Write your own formatter — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Write your own formatter¶

+

As well as creating your own lexer, writing a new +formatter for Pygments is easy and straightforward.

+

A formatter is a class that is initialized with some keyword arguments (the +formatter options) and that must provides a format() method. +Additionally a formatter should provide a get_style_defs() method that +returns the style definitions from the style in a form usable for the +formatter’s output format.

+
+

Quickstart¶

+

The most basic formatter shipped with Pygments is the NullFormatter. It just +sends the value of a token to the output stream:

+
from pygments.formatter import Formatter
+
+class NullFormatter(Formatter):
+    def format(self, tokensource, outfile):
+        for ttype, value in tokensource:
+            outfile.write(value)
+
+
+

As you can see, the format() method is passed two parameters: tokensource +and outfile. The first is an iterable of (token_type, value) tuples, +the latter a file like object with a write() method.

+

Because the formatter is that basic it doesn’t overwrite the get_style_defs() +method.

+
+
+

Styles¶

+

Styles aren’t instantiated but their metaclass provides some class functions +so that you can access the style definitions easily.

+

Styles are iterable and yield tuples in the form (ttype, d) where ttype +is a token and d is a dict with the following keys:

+
+
'color'
+
Hexadecimal color value (eg: 'ff0000' for red) or None if not +defined.
+
'bold'
+
True if the value should be bold
+
'italic'
+
True if the value should be italic
+
'underline'
+
True if the value should be underlined
+
'bgcolor'
+
Hexadecimal color value for the background (eg: 'eeeeeee' for light +gray) or None if not defined.
+
'border'
+
Hexadecimal color value for the border (eg: '0000aa' for a dark +blue) or None for no border.
+
+

Additional keys might appear in the future, formatters should ignore all keys +they don’t support.

+
+
+

HTML 3.2 Formatter¶

+

For an more complex example, let’s implement a HTML 3.2 Formatter. We don’t +use CSS but inline markup (<u>, <font>, etc). Because this isn’t good +style this formatter isn’t in the standard library ;-)

+
from pygments.formatter import Formatter
+
+class OldHtmlFormatter(Formatter):
+
+    def __init__(self, **options):
+        Formatter.__init__(self, **options)
+
+        # create a dict of (start, end) tuples that wrap the
+        # value of a token so that we can use it in the format
+        # method later
+        self.styles = {}
+
+        # we iterate over the `_styles` attribute of a style item
+        # that contains the parsed style values.
+        for token, style in self.style:
+            start = end = ''
+            # a style item is a tuple in the following form:
+            # colors are readily specified in hex: 'RRGGBB'
+            if style['color']:
+                start += '<font color="#%s">' % style['color']
+                end = '</font>' + end
+            if style['bold']:
+                start += '<b>'
+                end = '</b>' + end
+            if style['italic']:
+                start += '<i>'
+                end = '</i>' + end
+            if style['underline']:
+                start += '<u>'
+                end = '</u>' + end
+            self.styles[token] = (start, end)
+
+    def format(self, tokensource, outfile):
+        # lastval is a string we use for caching
+        # because it's possible that an lexer yields a number
+        # of consecutive tokens with the same token type.
+        # to minimize the size of the generated html markup we
+        # try to join the values of same-type tokens here
+        lastval = ''
+        lasttype = None
+
+        # wrap the whole output with <pre>
+        outfile.write('<pre>')
+
+        for ttype, value in tokensource:
+            # if the token type doesn't exist in the stylemap
+            # we try it with the parent of the token type
+            # eg: parent of Token.Literal.String.Double is
+            # Token.Literal.String
+            while ttype not in self.styles:
+                ttype = ttype.parent
+            if ttype == lasttype:
+                # the current token type is the same of the last
+                # iteration. cache it
+                lastval += value
+            else:
+                # not the same token as last iteration, but we
+                # have some data in the buffer. wrap it with the
+                # defined style and write it to the output file
+                if lastval:
+                    stylebegin, styleend = self.styles[lasttype]
+                    outfile.write(stylebegin + lastval + styleend)
+                # set lastval/lasttype to current values
+                lastval = value
+                lasttype = ttype
+
+        # if something is left in the buffer, write it to the
+        # output file, then close the opened <pre> tag
+        if lastval:
+            stylebegin, styleend = self.styles[lasttype]
+            outfile.write(stylebegin + lastval + styleend)
+        outfile.write('</pre>\n')
+
+
+

The comments should explain it. Again, this formatter doesn’t override the +get_style_defs() method. If we would have used CSS classes instead of +inline HTML markup, we would need to generate the CSS first. For that +purpose the get_style_defs() method exists:

+
+
+

Generating Style Definitions¶

+

Some formatters like the LatexFormatter and the HtmlFormatter don’t +output inline markup but reference either macros or css classes. Because +the definitions of those are not part of the output, the get_style_defs() +method exists. It is passed one parameter (if it’s used and how it’s used +is up to the formatter) and has to return a string or None.

+
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/formatters.html b/doc/_build/html/docs/formatters.html new file mode 100644 index 0000000..39d4765 --- /dev/null +++ b/doc/_build/html/docs/formatters.html @@ -0,0 +1,1027 @@ + + + + + + + + Available formatters — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

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.

+
+

New in version 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.

+
+

New in version 0.7.

+
+
+
+
+
+

Formatter classes¶

+

All these classes are importable from pygments.formatters.

+
+
+class BBCodeFormatter¶
+
+++ + + + + + +
Short names:bbcode, bb
Filenames:None
+

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.

+

This formatter has no support for background colors and borders, as there +are no common BBcode tags for that.

+

Some board systems (e.g. phpBB) don’t support colors in their [code] tag, +so you can’t use the highlighting together with that tag. +Text in a [code] tag usually is shown with a monospace font (which this +formatter can do with the monofont option) and no spaces (which you +need for indentation) are removed.

+

Additional options accepted:

+
+
style
+
The style to use, can be a string or a Style subclass (default: +'default').
+
codetag
+
If set to true, put the output into [code] tags (default: +false)
+
monofont
+
If set to true, add a tag to show the code with a monospace font +(default: false).
+
+
+ +
+
+class BmpImageFormatter¶
+
+++ + + + + + +
Short names:bmp, bitmap
Filenames:*.bmp
+

Create a bitmap image from source code. This uses the Python Imaging Library to +generate a pixmap from the source code.

+
+

New in version 1.0.

+
+
+ +
+
+class GifImageFormatter¶
+
+++ + + + + + +
Short names:gif
Filenames:*.gif
+

Create a GIF image from source code. This uses the Python Imaging Library to +generate a pixmap from the source code.

+
+

New in version 1.0.

+
+
+ +
+
+class HtmlFormatter¶
+
+++ + + + + + +
Short names:html
Filenames:*.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.

+

If the linenos option is set to "table", the <pre> is +additionally wrapped inside a <table> which has one row and two +cells: one containing the line numbers and one containing the code. +Example:

+
<div class="highlight" >
+<table><tr>
+  <td class="linenos" title="click to toggle"
+    onclick="with (this.firstChild.style)
+             { display = (display == '') ? 'none' : '' }">
+    <pre>1
+    2</pre>
+  </td>
+  <td class="code">
+    <pre><span class="Ke">def </span><span class="NaFu">foo</span>(bar):
+      <span class="Ke">pass</span>
+    </pre>
+  </td>
+</tr></table></div>
+
+
+

(whitespace added to improve clarity).

+

Wrapping can be disabled using the nowrap option.

+

A list of lines can be specified using the hl_lines option to make these +lines highlighted (as of Pygments 0.11).

+

With the full option, a complete HTML 4 document is output, including +the style definitions inside a <style> tag, or in a separate file if +the cssfile option is given.

+

When tagsfile is set to the path of a ctags index file, it is used to +generate hyperlinks from names to their definition. You must enable +lineanchors and run ctags with the -n option for this to work. The +python-ctags module from PyPI must be installed to use this feature; +otherwise a RuntimeError will be raised.

+

The get_style_defs(arg=’‘) method of a HtmlFormatter returns a string +containing CSS rules for the CSS classes used by the formatter. The +argument arg can be used to specify additional CSS selectors that +are prepended to the classes. A call fmter.get_style_defs(‘td .code’) +would result in the following CSS classes:

+
td .code .kw { font-weight: bold; color: #00FF00 }
+td .code .cm { color: #999999 }
+...
+
+
+

If you have Pygments 0.6 or higher, you can also pass a list or tuple to the +get_style_defs() method to request multiple prefixes for the tokens:

+
formatter.get_style_defs(['div.syntax pre', 'pre.syntax'])
+
+
+

The output would then look like this:

+
div.syntax pre .kw,
+pre.syntax .kw { font-weight: bold; color: #00FF00 }
+div.syntax pre .cm,
+pre.syntax .cm { color: #999999 }
+...
+
+
+

Additional options accepted:

+
+
nowrap
+
If set to True, don’t wrap the tokens at all, not even inside a <pre> +tag. This disables most other options (default: False).
+
full
+
Tells the formatter to output a “full” document, i.e. a complete +self-contained document (default: False).
+
title
+
If full is true, the title that should be used to caption the +document (default: '').
+
style
+
The style to use, can be a string or a Style subclass (default: +'default'). This option has no effect if the cssfile +and noclobber_cssfile option are given and the file specified in +cssfile exists.
+
noclasses
+
If set to true, token <span> tags will not use CSS classes, but +inline styles. This is not recommended for larger pieces of code since +it increases output size by quite a bit (default: False).
+
classprefix
+
Since the token types use relatively short class names, they may clash +with some of your own class names. In this case you can use the +classprefix option to give a string to prepend to all Pygments-generated +CSS class names for token types. +Note that this option also affects the output of get_style_defs().
+
cssclass
+

CSS class for the wrapping <div> tag (default: 'highlight'). +If you set this option, the default selector for get_style_defs() +will be this class.

+
+

New in version 0.9: If you select the 'table' line numbers, the wrapping table will +have a CSS class of this string plus 'table', the default is +accordingly 'highlighttable'.

+
+
+
cssstyles
+
Inline CSS styles for the wrapping <div> tag (default: '').
+
prestyles
+

Inline CSS styles for the <pre> tag (default: '').

+
+

New in version 0.11.

+
+
+
cssfile
+

If the full option is true and this option is given, it must be the +name of an external file. If the filename does not include an absolute +path, the file’s path will be assumed to be relative to the main output +file’s path, if the latter can be found. The stylesheet is then written +to this file instead of the HTML file.

+
+

New in version 0.6.

+
+
+
noclobber_cssfile
+

If cssfile is given and the specified file exists, the css file will +not be overwritten. This allows the use of the full option in +combination with a user specified css file. Default is False.

+
+

New in version 1.1.

+
+
+
linenos
+

If set to 'table', output line numbers as a table with two cells, +one containing the line numbers, the other the whole code. This is +copy-and-paste-friendly, but may cause alignment problems with some +browsers or fonts. If set to 'inline', the line numbers will be +integrated in the <pre> tag that contains the code (that setting +is new in Pygments 0.8).

+

For compatibility with Pygments 0.7 and earlier, every true value +except 'inline' means the same as 'table' (in particular, that +means also True).

+

The default value is False, which means no line numbers at all.

+

Note: with the default (“table”) line number mechanism, the line +numbers and code can have different line heights in Internet Explorer +unless you give the enclosing <pre> tags an explicit line-height +CSS property (you get the default line spacing with line-height: +125%).

+
+
hl_lines
+

Specify a list of lines to be highlighted.

+
+

New in version 0.11.

+
+
+
linenostart
+
The line number for the first line (default: 1).
+
linenostep
+
If set to a number n > 1, only every nth line number is printed.
+
linenospecial
+
If set to a number n > 0, every nth line number is given the CSS +class "special" (default: 0).
+
nobackground
+

If set to True, the formatter won’t output the background color +for the wrapping element (this automatically defaults to False +when there is no wrapping element [eg: no argument for the +get_syntax_defs method given]) (default: False).

+
+

New in version 0.6.

+
+
+
lineseparator
+

This string is output between lines of code. It defaults to "\n", +which is enough to break a line inside <pre> tags, but you can +e.g. set it to "<br>" to get HTML line breaks.

+
+

New in version 0.7.

+
+
+
lineanchors
+

If set to a nonempty string, e.g. foo, the formatter will wrap each +output line in an anchor tag with a name of foo-linenumber. +This allows easy linking to certain lines.

+
+

New in version 0.9.

+
+
+
linespans
+

If set to a nonempty string, e.g. foo, the formatter will wrap each +output line in a span tag with an id of foo-linenumber. +This allows easy access to lines via javascript.

+
+

New in version 1.6.

+
+
+
anchorlinenos
+
If set to True, will wrap line numbers in <a> tags. Used in +combination with linenos and lineanchors.
+
tagsfile
+

If set to the path of a ctags file, wrap names in anchor tags that +link to their definitions. lineanchors should be used, and the +tags file should specify line numbers (see the -n option to ctags).

+
+

New in version 1.6.

+
+
+
tagurlformat
+

A string formatting pattern used to generate links to ctags definitions. +Available variables are %(path)s, %(fname)s and %(fext)s. +Defaults to an empty string, resulting in just #prefix-number links.

+
+

New in version 1.6.

+
+
+
filename
+

A string used to generate a filename when rendering <pre> blocks, +for example if displaying source code.

+
+

New in version 2.1.

+
+
+
+

Subclassing the HTML formatter

+
+

New in version 0.7.

+
+

The HTML formatter is now built in a way that allows easy subclassing, thus +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 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.

+

A custom HtmlFormatter subclass could look like this:

+
class CodeHtmlFormatter(HtmlFormatter):
+
+    def wrap(self, source, outfile):
+        return self._wrap_code(source)
+
+    def _wrap_code(self, source):
+        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>'
+
+
+

This results in wrapping the formatted lines with a <code> tag, where the +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. Then, all +HTML yielded by the wrapped generator is output.

+
+ +
+
+class IRCFormatter¶
+
+++ + + + + + +
Short names:irc, IRC
Filenames:None
+

Format tokens with IRC color sequences

+

The get_style_defs() method doesn’t do anything special since there is +no support for common styles.

+

Options accepted:

+
+
bg
+
Set to "light" or "dark" depending on the terminal’s background +(default: "light").
+
colorscheme
+
A dictionary mapping token types to (lightbg, darkbg) color names or +None (default: None = use builtin colorscheme).
+
linenos
+
Set to True to have line numbers in the output as well +(default: False = no line numbers).
+
+
+ +
+
+class ImageFormatter¶
+
+++ + + + + + +
Short names:img, IMG, png
Filenames:*.png
+

Create a PNG image from source code. This uses the Python Imaging Library to +generate a pixmap from the source code.

+
+

New in version 0.10.

+
+

Additional options accepted:

+
+
image_format
+

An image format to output to that is recognised by PIL, these include:

+
    +
  • “PNG” (default)
  • +
  • “JPEG”
  • +
  • “BMP”
  • +
  • “GIF”
  • +
+
+
line_pad
+

The extra spacing (in pixels) between each line of text.

+

Default: 2

+
+
font_name
+

The font name to be used as the base font from which others, such as +bold and italic fonts will be generated. This really should be a +monospace font to look sane.

+

Default: “Bitstream Vera Sans Mono” on Windows, Courier New on *nix

+
+
font_size
+

The font size in points to be used.

+

Default: 14

+
+
image_pad
+

The padding, in pixels to be used at each edge of the resulting image.

+

Default: 10

+
+
line_numbers
+

Whether line numbers should be shown: True/False

+

Default: True

+
+
line_number_start
+

The line number of the first line.

+

Default: 1

+
+
line_number_step
+

The step used when printing line numbers.

+

Default: 1

+
+
line_number_bg
+

The background colour (in “#123456” format) of the line number bar, or +None to use the style background color.

+

Default: “#eed”

+
+
line_number_fg
+

The text color of the line numbers (in “#123456”-like format).

+

Default: “#886”

+
+
line_number_chars
+

The number of columns of line numbers allowable in the line number +margin.

+

Default: 2

+
+
line_number_bold
+

Whether line numbers will be bold: True/False

+

Default: False

+
+
line_number_italic
+

Whether line numbers will be italicized: True/False

+

Default: False

+
+
line_number_separator
+

Whether a line will be drawn between the line number area and the +source code area: True/False

+

Default: True

+
+
line_number_pad
+

The horizontal padding (in pixels) between the line number margin, and +the source code area.

+

Default: 6

+
+
hl_lines
+

Specify a list of lines to be highlighted.

+
+

New in version 1.2.

+
+

Default: empty list

+
+
hl_color
+

Specify the color for highlighting lines.

+
+

New in version 1.2.

+
+

Default: highlight color of the selected style

+
+
+
+ +
+
+class JpgImageFormatter¶
+
+++ + + + + + +
Short names:jpg, jpeg
Filenames:*.jpg
+

Create a JPEG image from source code. This uses the Python Imaging Library to +generate a pixmap from the source code.

+
+

New in version 1.0.

+
+
+ +
+
+class LatexFormatter¶
+
+++ + + + + + +
Short names:latex, tex
Filenames:*.tex
+

Format tokens as LaTeX code. This needs the fancyvrb and color +standard packages.

+

Without the full option, code is formatted as one Verbatim +environment, like this:

+
\begin{Verbatim}[commandchars=\\\{\}]
+\PY{k}{def }\PY{n+nf}{foo}(\PY{n}{bar}):
+    \PY{k}{pass}
+\end{Verbatim}
+
+
+

The special command used here (\PY) and all the other macros it needs +are output by the get_style_defs method.

+

With the full option, a complete LaTeX document is output, including +the command definitions in the preamble.

+

The get_style_defs() method of a LatexFormatter returns a string +containing \def commands defining the macros needed inside the +Verbatim environments.

+

Additional options accepted:

+
+
style
+
The style to use, can be a string or a Style subclass (default: +'default').
+
full
+
Tells the formatter to output a “full” document, i.e. a complete +self-contained document (default: False).
+
title
+
If full is true, the title that should be used to caption the +document (default: '').
+
docclass
+
If the full option is enabled, this is the document class to use +(default: 'article').
+
preamble
+
If the full option is enabled, this can be further preamble commands, +e.g. \usepackage (default: '').
+
linenos
+
If set to True, output line numbers (default: False).
+
linenostart
+
The line number for the first line (default: 1).
+
linenostep
+
If set to a number n > 1, only every nth line number is printed.
+
verboptions
+
Additional options given to the Verbatim environment (see the fancyvrb +docs for possible values) (default: '').
+
commandprefix
+

The LaTeX commands used to produce colored output are constructed +using this prefix and some letters (default: 'PY').

+
+

New in version 0.7.

+
+
+

Changed in version 0.10: The default is now 'PY' instead of 'C'.

+
+
+
texcomments
+

If set to True, enables LaTeX comment lines. That is, LaTex markup +in comment tokens is not escaped so that LaTeX can render it (default: +False).

+
+

New in version 1.2.

+
+
+
mathescape
+

If set to True, enables LaTeX math mode escape in comments. That +is, '$...$' inside a comment will trigger math mode (default: +False).

+
+

New in version 1.2.

+
+
+
escapeinside
+

If set to a string of length 2, enables escaping to LaTeX. Text +delimited by these 2 characters is read as LaTeX code and +typeset accordingly. It has no effect in string literals. It has +no effect in comments if texcomments or mathescape is +set. (default: '').

+
+

New in version 2.0.

+
+
+
envname
+

Allows you to pick an alternative environment name replacing Verbatim. +The alternate environment still has to support Verbatim’s option syntax. +(default: 'Verbatim').

+
+

New in version 2.0.

+
+
+
+
+ +
+
+class NullFormatter¶
+
+++ + + + + + +
Short names:text, null
Filenames:*.txt
+

Output the text unchanged without any formatting.

+
+ +
+
+class RawTokenFormatter¶
+
+++ + + + + + +
Short names:raw, tokens
Filenames:*.raw
+

Format tokens as a raw representation for storing token streams.

+

The format is tokentype<TAB>repr(tokenstring)\n. The output can later +be converted to a token stream with the RawTokenLexer, described in the +lexer list.

+

Only two options are accepted:

+
+
compress
+
If set to 'gz' or 'bz2', compress the output with the given +compression algorithm after encoding (default: '').
+
error_color
+

If set to a color name, highlight error tokens using that color. If +set but with no value, defaults to 'red'.

+
+

New in version 0.11.

+
+
+
+
+ +
+
+class RtfFormatter¶
+
+++ + + + + + +
Short names:rtf
Filenames:*.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.

+

Please note that encoding and outencoding options are ignored. +The RTF format is ASCII natively, but handles unicode characters correctly +thanks to escape sequences.

+
+

New in version 0.6.

+
+

Additional options accepted:

+
+
style
+
The style to use, can be a string or a Style subclass (default: +'default').
+
fontface
+
The used font famliy, for example Bitstream Vera Sans. Defaults to +some generic font which is supposed to have fixed width.
+
fontsize
+

Size of the font used. Size is specified in half points. The +default is 24 half-points, giving a size 12 font.

+
+

New in version 2.0.

+
+
+
+
+ +
+
+class SvgFormatter¶
+
+++ + + + + + +
Short names:svg
Filenames:*.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.

+

By default, this formatter outputs a full SVG document including doctype +declaration and the <svg> root element.

+
+

New in version 0.9.

+
+

Additional options accepted:

+
+
nowrap
+
Don’t wrap the SVG <text> elements in <svg><g> elements and +don’t add a XML declaration and a doctype. If true, the fontfamily +and fontsize options are ignored. Defaults to False.
+
fontfamily
+
The value to give the wrapping <g> element’s font-family +attribute, defaults to "monospace".
+
fontsize
+
The value to give the wrapping <g> element’s font-size +attribute, defaults to "14px".
+
xoffset
+
Starting offset in X direction, defaults to 0.
+
yoffset
+
Starting offset in Y direction, defaults to the font size if it is given +in pixels, or 20 else. (This is necessary since text coordinates +refer to the text baseline, not the top edge.)
+
ystep
+
Offset to add to the Y coordinate for each subsequent line. This should +roughly be the text size plus 5. It defaults to that value if the text +size is given in pixels, or 25 else.
+
spacehack
+
Convert spaces in the source to &#160;, which are non-breaking +spaces. SVG provides the xml:space attribute to control how +whitespace inside tags is handled, in theory, the preserve value +could be used to keep all whitespace as-is. However, many current SVG +viewers don’t obey that rule, so this option is provided as a workaround +and defaults to True.
+
+
+ +
+
+class Terminal256Formatter¶
+
+++ + + + + + +
Short names:terminal256, console256, 256
Filenames:None
+

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.

+

The formatter takes colors from a style defined by the style option +and converts them to nearest ANSI 256-color escape sequences. Bold and +underline attributes from the style are preserved (and displayed).

+
+

New in version 0.9.

+
+
+

Changed in version 2.2: If the used style defines foreground colors in the form #ansi*, then +Terminal256Formatter will map these to non extended foreground color. +See Terminal Styles for more information.

+
+

Options accepted:

+
+
style
+
The style to use, can be a string or a Style subclass (default: +'default').
+
+
+ +
+
+class TerminalFormatter¶
+
+++ + + + + + +
Short names:terminal, console
Filenames:None
+

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.

+

The get_style_defs() method doesn’t do anything special since there is +no support for common styles.

+

Options accepted:

+
+
bg
+
Set to "light" or "dark" depending on the terminal’s background +(default: "light").
+
colorscheme
+
A dictionary mapping token types to (lightbg, darkbg) color names or +None (default: None = use builtin colorscheme).
+
linenos
+
Set to True to have line numbers on the terminal output as well +(default: False = no line numbers).
+
+
+ +
+
+class TerminalTrueColorFormatter¶
+
+++ + + + + + +
Short names:terminal16m, console16m, 16m
Filenames:None
+

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.

+
+

New in version 2.1.

+
+

Options accepted:

+
+
style
+
The style to use, can be a string or a Style subclass (default: +'default').
+
+
+ +
+
+class TestcaseFormatter¶
+
+++ + + + + + +
Short names:testcase
Filenames:None
+

Format tokens as appropriate for a new testcase.

+
+

New in version 2.0.

+
+
+ +
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/index.html b/doc/_build/html/docs/index.html new file mode 100644 index 0000000..4457613 --- /dev/null +++ b/doc/_build/html/docs/index.html @@ -0,0 +1,171 @@ + + + + + + + + Pygments documentation — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Pygments documentation¶

+

Starting with Pygments

+ +

Builtin components

+ +

Reference

+ +

Hacking for Pygments

+ +

Hints and tricks

+ +

About Pygments

+ +

If you find bugs or have suggestions for the documentation, please look +here for info on how to contact the team.

+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/integrate.html b/doc/_build/html/docs/integrate.html new file mode 100644 index 0000000..5909f56 --- /dev/null +++ b/doc/_build/html/docs/integrate.html @@ -0,0 +1,160 @@ + + + + + + + + Using Pygments in various scenarios — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Using Pygments in various scenarios¶

+
+

Markdown¶

+

Since Pygments 0.9, the distribution ships Markdown preprocessor sample code +that uses Pygments to render source code in +external/markdown-processor.py. You can copy and adapt it to your +liking.

+
+
+

TextMate¶

+

Antonio Cangiano has created a Pygments bundle for TextMate that allows to +colorize code via a simple menu option. It can be found here.

+
+
+

Bash completion¶

+

The source distribution contains a file external/pygments.bashcomp that +sets up completion for the pygmentize command in bash.

+
+
+

Wrappers for other languages¶

+

These libraries provide Pygments highlighting for users of other languages +than Python:

+ +
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/java.html b/doc/_build/html/docs/java.html new file mode 100644 index 0000000..b004d66 --- /dev/null +++ b/doc/_build/html/docs/java.html @@ -0,0 +1,178 @@ + + + + + + + + Use Pygments in Java — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Use Pygments in Java¶

+

Thanks to Jython it is possible to use Pygments in +Java.

+

This page is a simple tutorial to get an idea of how this works. You can +then look at the Jython documentation for more +advanced uses.

+

Since version 1.5, Pygments is deployed on Maven Central as a JAR, as is Jython +which makes it a lot easier to create a Java project.

+

Here is an example of a Maven pom.xml file for a +project running Pygments:

+
<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+                             http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>example</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <dependencies>
+    <dependency>
+      <groupId>org.python</groupId>
+      <artifactId>jython-standalone</artifactId>
+      <version>2.5.3</version>
+    </dependency>
+    <dependency>
+      <groupId>org.pygments</groupId>
+      <artifactId>pygments</artifactId>
+      <version>1.5</version>
+      <scope>runtime</scope>
+    </dependency>
+  </dependencies>
+</project>
+
+
+

The following Java example:

+
PythonInterpreter interpreter = new PythonInterpreter();
+
+// Set a variable with the content you want to work with
+interpreter.set("code", code);
+
+// Simple use Pygments as you would in Python
+interpreter.exec("from pygments import highlight\n"
+    + "from pygments.lexers import PythonLexer\n"
+    + "from pygments.formatters import HtmlFormatter\n"
+    + "\nresult = highlight(code, PythonLexer(), HtmlFormatter())");
+
+// Get the result that has been set in a variable
+System.out.println(interpreter.get("result", String.class));
+
+
+

will print something like:

+
<div class="highlight">
+<pre><span class="k">print</span> <span class="s">&quot;Hello World&quot;</span></pre>
+</div>
+
+
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/lexerdevelopment.html b/doc/_build/html/docs/lexerdevelopment.html new file mode 100644 index 0000000..6376c9d --- /dev/null +++ b/doc/_build/html/docs/lexerdevelopment.html @@ -0,0 +1,768 @@ + + + + + + + + Write your own lexer — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Write your own lexer¶

+

If a lexer for your favorite language is missing in the Pygments package, you +can easily write your own and extend Pygments.

+

All you need can be found inside the pygments.lexer module. As you can +read in the API documentation, a lexer is a class that is +initialized with some keyword arguments (the lexer options) and that provides a +get_tokens_unprocessed() method which is given a string or unicode +object with the data to lex.

+

The get_tokens_unprocessed() method must return an iterator or iterable +containing tuples in the form (index, token, value). Normally you don’t +need to do this since there are base lexers that do most of the work and that +you can subclass.

+
+

RegexLexer¶

+

The lexer base class used by almost all of Pygments’ lexers is the +RegexLexer. This class allows you to define lexing rules in terms of +regular expressions for different states.

+

States are groups of regular expressions that are matched against the input +string at the current position. If one of these expressions matches, a +corresponding action is performed (such as yielding a token with a specific +type, or changing state), the current position is set to where the last match +ended and the matching process continues with the first regex of the current +state.

+

Lexer states are kept on a stack: each time a new state is entered, the new +state is pushed onto the stack. The most basic lexers (like the DiffLexer) +just need one state.

+

Each state is defined as a list of tuples in the form (regex, action, +new_state) where the last item is optional. In the most basic form, action +is a token type (like Name.Builtin). That means: When regex matches, emit a +token with the match text and type tokentype and push new_state on the state +stack. If the new state is '#pop', the topmost state is popped from the +stack instead. To pop more than one state, use '#pop:2' and so on. +'#push' is a synonym for pushing the current state on the stack.

+

The following example shows the DiffLexer from the builtin lexers. Note that +it contains some additional attributes name, aliases and filenames which +aren’t required for a lexer. They are used by the builtin lexer lookup +functions.

+
from pygments.lexer import RegexLexer
+from pygments.token import *
+
+class DiffLexer(RegexLexer):
+    name = 'Diff'
+    aliases = ['diff']
+    filenames = ['*.diff']
+
+    tokens = {
+        'root': [
+            (r' .*\n', Text),
+            (r'\+.*\n', Generic.Inserted),
+            (r'-.*\n', Generic.Deleted),
+            (r'@.*\n', Generic.Subheading),
+            (r'Index.*\n', Generic.Heading),
+            (r'=.*\n', Generic.Heading),
+            (r'.*\n', Text),
+        ]
+    }
+
+
+

As you can see this lexer only uses one state. When the lexer starts scanning +the text, it first checks if the current character is a space. If this is true +it scans everything until newline and returns the data as a Text token (which +is the “no special highlighting” token).

+

If this rule doesn’t match, it checks if the current char is a plus sign. And +so on.

+

If no rule matches at the current position, the current char is emitted as an +Error token that indicates a lexing error, and the position is increased by +one.

+
+
+

Adding and testing a new lexer¶

+

The easiest way to use a new lexer is to use Pygments’ support for loading +the lexer from a file relative to your current directory.

+

First, change the name of your lexer class to CustomLexer:

+
from pygments.lexer import RegexLexer
+from pygments.token import *
+
+class CustomLexer(RegexLexer):
+    """All your lexer code goes here!"""
+
+
+

Then you can load the lexer from the command line with the additional +flag -x:

+
$ pygmentize -l your_lexer_file.py -x
+
+
+

To specify a class name other than CustomLexer, append it with a colon:

+
$ pygmentize -l your_lexer.py:SomeLexer -x
+
+
+

Or, using the Python API:

+
# For a lexer named CustomLexer
+your_lexer = load_lexer_from_file(filename, **options)
+
+# For a lexer named MyNewLexer
+your_named_lexer = load_lexer_from_file(filename, "MyNewLexer", **options)
+
+
+

When loading custom lexers and formatters, be extremely careful to use only +trusted files; Pygments will perform the equivalent of eval on them.

+

If you only want to use your lexer with the Pygments API, you can import and +instantiate the lexer yourself, then pass it to pygments.highlight().

+

To prepare your new lexer for inclusion in the Pygments distribution, so that it +will be found when passing filenames or lexer aliases from the command line, you +have to perform the following steps.

+

First, change to the current directory containing the Pygments source code. You +will need to have either an unpacked source tarball, or (preferably) a copy +cloned from BitBucket.

+
$ cd .../pygments-main
+
+
+

Select a matching module under pygments/lexers, or create a new module for +your lexer class.

+

Next, make sure the lexer is known from outside of the module. All modules in +the pygments.lexers package specify __all__. For example, +esoteric.py sets:

+
__all__ = ['BrainfuckLexer', 'BefungeLexer', ...]
+
+
+

Add the name of your lexer class to this list (or create the list if your lexer +is the only class in the module).

+

Finally the lexer can be made publicly known by rebuilding the lexer mapping:

+
$ make mapfiles
+
+
+

To test the new lexer, store an example file with the proper extension in +tests/examplefiles. For example, to test your DiffLexer, add a +tests/examplefiles/example.diff containing a sample diff output.

+

Now you can use pygmentize to render your example to HTML:

+
$ ./pygmentize -O full -f html -o /tmp/example.html tests/examplefiles/example.diff
+
+
+

Note that this explicitly calls the pygmentize in the current directory +by preceding it with ./. This ensures your modifications are used. +Otherwise a possibly already installed, unmodified version without your new +lexer would have been called from the system search path ($PATH).

+

To view the result, open /tmp/example.html in your browser.

+

Once the example renders as expected, you should run the complete test suite:

+
$ make test
+
+
+

It also tests that your lexer fulfills the lexer API and certain invariants, +such as that the concatenation of all token text is the same as the input text.

+
+
+

Regex Flags¶

+

You can either define regex flags locally in the regex (r'(?x)foo bar') or +globally by adding a flags attribute to your lexer class. If no attribute is +defined, it defaults to re.MULTILINE. For more information about regular +expression flags see the page about regular expressions in the Python +documentation.

+
+
+

Scanning multiple tokens at once¶

+

So far, the action element in the rule tuple of regex, action and state has +been a single token type. Now we look at the first of several other possible +values.

+

Here is a more complex lexer that highlights INI files. INI files consist of +sections, comments and key = value pairs:

+
from pygments.lexer import RegexLexer, bygroups
+from pygments.token import *
+
+class IniLexer(RegexLexer):
+    name = 'INI'
+    aliases = ['ini', 'cfg']
+    filenames = ['*.ini', '*.cfg']
+
+    tokens = {
+        'root': [
+            (r'\s+', Text),
+            (r';.*?$', Comment),
+            (r'\[.*?\]$', Keyword),
+            (r'(.*?)(\s*)(=)(\s*)(.*?)$',
+             bygroups(Name.Attribute, Text, Operator, Text, String))
+        ]
+    }
+
+
+

The lexer first looks for whitespace, comments and section names. Later it +looks for a line that looks like a key, value pair, separated by an '=' +sign, and optional whitespace.

+

The bygroups helper yields each capturing group in the regex with a different +token type. First the Name.Attribute token, then a Text token for the +optional whitespace, after that a Operator token for the equals sign. Then a +Text token for the whitespace again. The rest of the line is returned as +String.

+

Note that for this to work, every part of the match must be inside a capturing +group (a (...)), and there must not be any nested capturing groups. If you +nevertheless need a group, use a non-capturing group defined using this syntax: +(?:some|words|here) (note the ?: after the beginning parenthesis).

+

If you find yourself needing a capturing group inside the regex which shouldn’t +be part of the output but is used in the regular expressions for backreferencing +(eg: r'(<(foo|bar)>)(.*?)(</\2>)'), you can pass None to the bygroups +function and that group will be skipped in the output.

+
+
+

Changing states¶

+

Many lexers need multiple states to work as expected. For example, some +languages allow multiline comments to be nested. Since this is a recursive +pattern it’s impossible to lex just using regular expressions.

+

Here is a lexer that recognizes C++ style comments (multi-line with /* */ +and single-line with // until end of line):

+
from pygments.lexer import RegexLexer
+from pygments.token import *
+
+class CppCommentLexer(RegexLexer):
+    name = 'Example Lexer with states'
+
+    tokens = {
+        'root': [
+            (r'[^/]+', Text),
+            (r'/\*', Comment.Multiline, 'comment'),
+            (r'//.*?$', Comment.Singleline),
+            (r'/', Text)
+        ],
+        'comment': [
+            (r'[^*/]', Comment.Multiline),
+            (r'/\*', Comment.Multiline, '#push'),
+            (r'\*/', Comment.Multiline, '#pop'),
+            (r'[*/]', Comment.Multiline)
+        ]
+    }
+
+
+

This lexer starts lexing in the 'root' state. It tries to match as much as +possible until it finds a slash ('/'). If the next character after the slash +is an asterisk ('*') the RegexLexer sends those two characters to the +output stream marked as Comment.Multiline and continues lexing with the rules +defined in the 'comment' state.

+

If there wasn’t an asterisk after the slash, the RegexLexer checks if it’s a +Singleline comment (i.e. followed by a second slash). If this also wasn’t the +case it must be a single slash, which is not a comment starter (the separate +regex for a single slash must also be given, else the slash would be marked as +an error token).

+

Inside the 'comment' state, we do the same thing again. Scan until the +lexer finds a star or slash. If it’s the opening of a multiline comment, push +the 'comment' state on the stack and continue scanning, again in the +'comment' state. Else, check if it’s the end of the multiline comment. If +yes, pop one state from the stack.

+

Note: If you pop from an empty stack you’ll get an IndexError. (There is an +easy way to prevent this from happening: don’t '#pop' in the root state).

+

If the RegexLexer encounters a newline that is flagged as an error token, the +stack is emptied and the lexer continues scanning in the 'root' state. This +can help producing error-tolerant highlighting for erroneous input, e.g. when a +single-line string is not closed.

+
+
+

Advanced state tricks¶

+

There are a few more things you can do with states:

+
    +
  • You can push multiple states onto the stack if you give a tuple instead of a +simple string as the third item in a rule tuple. For example, if you want to +match a comment containing a directive, something like:

    +
    /* <processing directive>    rest of comment */
    +
    +
    +

    you can use this rule:

    +
    tokens = {
    +    'root': [
    +        (r'/\* <', Comment, ('comment', 'directive')),
    +        ...
    +    ],
    +    'directive': [
    +        (r'[^>]*', Comment.Directive),
    +        (r'>', Comment, '#pop'),
    +    ],
    +    'comment': [
    +        (r'[^*]+', Comment),
    +        (r'\*/', Comment, '#pop'),
    +        (r'\*', Comment),
    +    ]
    +}
    +
    +
    +

    When this encounters the above sample, first 'comment' and 'directive' +are pushed onto the stack, then the lexer continues in the directive state +until it finds the closing >, then it continues in the comment state until +the closing */. Then, both states are popped from the stack again and +lexing continues in the root state.

    +
    +

    New in version 0.9: The tuple can contain the special '#push' and '#pop' (but not +'#pop:n') directives.

    +
    +
  • +
  • You can include the rules of a state in the definition of another. This is +done by using include from pygments.lexer:

    +
    from pygments.lexer import RegexLexer, bygroups, include
    +from pygments.token import *
    +
    +class ExampleLexer(RegexLexer):
    +    tokens = {
    +        'comments': [
    +            (r'/\*.*?\*/', Comment),
    +            (r'//.*?\n', Comment),
    +        ],
    +        'root': [
    +            include('comments'),
    +            (r'(function )(\w+)( {)',
    +             bygroups(Keyword, Name, Keyword), 'function'),
    +            (r'.', Text),
    +        ],
    +        'function': [
    +            (r'[^}/]+', Text),
    +            include('comments'),
    +            (r'/', Text),
    +            (r'\}', Keyword, '#pop'),
    +        ]
    +    }
    +
    +
    +

    This is a hypothetical lexer for a language that consist of functions and +comments. Because comments can occur at toplevel and in functions, we need +rules for comments in both states. As you can see, the include helper saves +repeating rules that occur more than once (in this example, the state +'comment' will never be entered by the lexer, as it’s only there to be +included in 'root' and 'function').

    +
  • +
  • Sometimes, you may want to “combine” a state from existing ones. This is +possible with the combined helper from pygments.lexer.

    +

    If you, instead of a new state, write combined('state1', 'state2') as the +third item of a rule tuple, a new anonymous state will be formed from state1 +and state2 and if the rule matches, the lexer will enter this state.

    +

    This is not used very often, but can be helpful in some cases, such as the +PythonLexer’s string literal processing.

    +
  • +
  • If you want your lexer to start lexing in a different state you can modify the +stack by overriding the get_tokens_unprocessed() method:

    +
    from pygments.lexer import RegexLexer
    +
    +class ExampleLexer(RegexLexer):
    +    tokens = {...}
    +
    +    def get_tokens_unprocessed(self, text, stack=('root', 'otherstate')):
    +        for item in RegexLexer.get_tokens_unprocessed(self, text, stack):
    +            yield item
    +
    +
    +

    Some lexers like the PhpLexer use this to make the leading <?php +preprocessor comments optional. Note that you can crash the lexer easily by +putting values into the stack that don’t exist in the token map. Also +removing 'root' from the stack can result in strange errors!

    +
  • +
  • In some lexers, a state should be popped if anything is encountered that isn’t +matched by a rule in the state. You could use an empty regex at the end of +the state list, but Pygments provides a more obvious way of spelling that: +default('#pop') is equivalent to ('', Text, '#pop').

    +
    +

    New in version 2.0.

    +
    +
  • +
+
+
+

Subclassing lexers derived from RegexLexer¶

+
+

New in version 1.6.

+
+

Sometimes multiple languages are very similar, but should still be lexed by +different lexer classes.

+

When subclassing a lexer derived from RegexLexer, the tokens dictionaries +defined in the parent and child class are merged. For example:

+
from pygments.lexer import RegexLexer, inherit
+from pygments.token import *
+
+class BaseLexer(RegexLexer):
+    tokens = {
+        'root': [
+            ('[a-z]+', Name),
+            (r'/\*', Comment, 'comment'),
+            ('"', String, 'string'),
+            ('\s+', Text),
+        ],
+        'string': [
+            ('[^"]+', String),
+            ('"', String, '#pop'),
+        ],
+        'comment': [
+            ...
+        ],
+    }
+
+class DerivedLexer(BaseLexer):
+    tokens = {
+        'root': [
+            ('[0-9]+', Number),
+            inherit,
+        ],
+        'string': [
+            (r'[^"\\]+', String),
+            (r'\\.', String.Escape),
+            ('"', String, '#pop'),
+        ],
+    }
+
+
+

The BaseLexer defines two states, lexing names and strings. The +DerivedLexer defines its own tokens dictionary, which extends the definitions +of the base lexer:

+
    +
  • The “root” state has an additional rule and then the special object inherit, +which tells Pygments to insert the token definitions of the parent class at +that point.
  • +
  • The “string” state is replaced entirely, since there is not inherit rule.
  • +
  • The “comment” state is inherited entirely.
  • +
+
+
+

Using multiple lexers¶

+

Using multiple lexers for the same input can be tricky. One of the easiest +combination techniques is shown here: You can replace the action entry in a rule +tuple with a lexer class. The matched text will then be lexed with that lexer, +and the resulting tokens will be yielded.

+

For example, look at this stripped-down HTML lexer:

+
from pygments.lexer import RegexLexer, bygroups, using
+from pygments.token import *
+from pygments.lexers.javascript import JavascriptLexer
+
+class HtmlLexer(RegexLexer):
+    name = 'HTML'
+    aliases = ['html']
+    filenames = ['*.html', '*.htm']
+
+    flags = re.IGNORECASE | re.DOTALL
+    tokens = {
+        'root': [
+            ('[^<&]+', Text),
+            ('&.*?;', Name.Entity),
+            (r'<\s*script\s*', Name.Tag, ('script-content', 'tag')),
+            (r'<\s*[a-zA-Z0-9:]+', Name.Tag, 'tag'),
+            (r'<\s*/\s*[a-zA-Z0-9:]+\s*>', Name.Tag),
+        ],
+        'script-content': [
+            (r'(.+?)(<\s*/\s*script\s*>)',
+             bygroups(using(JavascriptLexer), Name.Tag),
+             '#pop'),
+        ]
+    }
+
+
+

Here the content of a <script> tag is passed to a newly created instance of +a JavascriptLexer and not processed by the HtmlLexer. This is done using +the using helper that takes the other lexer class as its parameter.

+

Note the combination of bygroups and using. This makes sure that the +content up to the </script> end tag is processed by the JavascriptLexer, +while the end tag is yielded as a normal token with the Name.Tag type.

+

Also note the (r'<\s*script\s*', Name.Tag, ('script-content', 'tag')) rule. +Here, two states are pushed onto the state stack, 'script-content' and +'tag'. That means that first 'tag' is processed, which will lex +attributes and the closing >, then the 'tag' state is popped and the +next state on top of the stack will be 'script-content'.

+

Since you cannot refer to the class currently being defined, use this +(imported from pygments.lexer) to refer to the current lexer class, i.e. +using(this). This construct may seem unnecessary, but this is often the +most obvious way of lexing arbitrary syntax between fixed delimiters without +introducing deeply nested states.

+

The using() helper has a special keyword argument, state, which works as +follows: if given, the lexer to use initially is not in the "root" state, +but in the state given by this argument. This does not work with advanced +RegexLexer subclasses such as ExtendedRegexLexer (see below).

+

Any other keywords arguments passed to using() are added to the keyword +arguments used to create the lexer.

+
+
+

Delegating Lexer¶

+

Another approach for nested lexers is the DelegatingLexer which is for example +used for the template engine lexers. It takes two lexers as arguments on +initialisation: a root_lexer and a language_lexer.

+

The input is processed as follows: First, the whole text is lexed with the +language_lexer. All tokens yielded with the special type of Other are +then concatenated and given to the root_lexer. The language tokens of the +language_lexer are then inserted into the root_lexer’s token stream at the +appropriate positions.

+
from pygments.lexer import DelegatingLexer
+from pygments.lexers.web import HtmlLexer, PhpLexer
+
+class HtmlPhpLexer(DelegatingLexer):
+    def __init__(self, **options):
+        super(HtmlPhpLexer, self).__init__(HtmlLexer, PhpLexer, **options)
+
+
+

This procedure ensures that e.g. HTML with template tags in it is highlighted +correctly even if the template tags are put into HTML tags or attributes.

+

If you want to change the needle token Other to something else, you can give +the lexer another token type as the third parameter:

+
DelegatingLexer.__init__(MyLexer, OtherLexer, Text, **options)
+
+
+
+
+

Callbacks¶

+

Sometimes the grammar of a language is so complex that a lexer would be unable +to process it just by using regular expressions and stacks.

+

For this, the RegexLexer allows callbacks to be given in rule tuples, instead +of token types (bygroups and using are nothing else but preimplemented +callbacks). The callback must be a function taking two arguments:

+
    +
  • the lexer itself
  • +
  • the match object for the last matched rule
  • +
+

The callback must then return an iterable of (or simply yield) (index, +tokentype, value) tuples, which are then just passed through by +get_tokens_unprocessed(). The index here is the position of the token in +the input string, tokentype is the normal token type (like Name.Builtin), +and value the associated part of the input string.

+

You can see an example here:

+
from pygments.lexer import RegexLexer
+from pygments.token import Generic
+
+class HypotheticLexer(RegexLexer):
+
+    def headline_callback(lexer, match):
+        equal_signs = match.group(1)
+        text = match.group(2)
+        yield match.start(), Generic.Headline, equal_signs + text + equal_signs
+
+    tokens = {
+        'root': [
+            (r'(=+)(.*?)(\1)', headline_callback)
+        ]
+    }
+
+
+

If the regex for the headline_callback matches, the function is called with +the match object. Note that after the callback is done, processing continues +normally, that is, after the end of the previous match. The callback has no +possibility to influence the position.

+

There are not really any simple examples for lexer callbacks, but you can see +them in action e.g. in the SMLLexer class in ml.py.

+
+
+

The ExtendedRegexLexer class¶

+

The RegexLexer, even with callbacks, unfortunately isn’t powerful enough for +the funky syntax rules of languages such as Ruby.

+

But fear not; even then you don’t have to abandon the regular expression +approach: Pygments has a subclass of RegexLexer, the ExtendedRegexLexer. +All features known from RegexLexers are available here too, and the tokens are +specified in exactly the same way, except for one detail:

+

The get_tokens_unprocessed() method holds its internal state data not as local +variables, but in an instance of the pygments.lexer.LexerContext class, and +that instance is passed to callbacks as a third argument. This means that you +can modify the lexer state in callbacks.

+

The LexerContext class has the following members:

+
    +
  • text – the input text
  • +
  • pos – the current starting position that is used for matching regexes
  • +
  • stack – a list containing the state stack
  • +
  • end – the maximum position to which regexes are matched, this defaults to +the length of text
  • +
+

Additionally, the get_tokens_unprocessed() method can be given a +LexerContext instead of a string and will then process this context instead of +creating a new one for the string argument.

+

Note that because you can set the current position to anything in the callback, +it won’t be automatically be set by the caller after the callback is finished. +For example, this is how the hypothetical lexer above would be written with the +ExtendedRegexLexer:

+
from pygments.lexer import ExtendedRegexLexer
+from pygments.token import Generic
+
+class ExHypotheticLexer(ExtendedRegexLexer):
+
+    def headline_callback(lexer, match, ctx):
+        equal_signs = match.group(1)
+        text = match.group(2)
+        yield match.start(), Generic.Headline, equal_signs + text + equal_signs
+        ctx.pos = match.end()
+
+    tokens = {
+        'root': [
+            (r'(=+)(.*?)(\1)', headline_callback)
+        ]
+    }
+
+
+

This might sound confusing (and it can really be). But it is needed, and for an +example look at the Ruby lexer in ruby.py.

+
+
+

Handling Lists of Keywords¶

+

For a relatively short list (hundreds) you can construct an optimized regular +expression directly using words() (longer lists, see next section). This +function handles a few things for you automatically, including escaping +metacharacters and Python’s first-match rather than longest-match in +alternations. Feel free to put the lists themselves in +pygments/lexers/_$lang_builtins.py (see examples there), and generated by +code if possible.

+

An example of using words() is something like:

+
from pygments.lexer import RegexLexer, words, Name
+
+class MyLexer(RegexLexer):
+
+    tokens = {
+        'root': [
+            (words(('else', 'elseif'), suffix=r'\b'), Name.Builtin),
+            (r'\w+', Name),
+        ],
+    }
+
+
+

As you can see, you can add prefix and suffix parts to the constructed +regex.

+
+
+

Modifying Token Streams¶

+

Some languages ship a lot of builtin functions (for example PHP). The total +amount of those functions differs from system to system because not everybody +has every extension installed. In the case of PHP there are over 3000 builtin +functions. That’s an incredibly huge amount of functions, much more than you +want to put into a regular expression.

+

But because only Name tokens can be function names this is solvable by +overriding the get_tokens_unprocessed() method. The following lexer +subclasses the PythonLexer so that it highlights some additional names as +pseudo keywords:

+
from pygments.lexers.python import PythonLexer
+from pygments.token import Name, Keyword
+
+class MyPythonLexer(PythonLexer):
+    EXTRA_KEYWORDS = set(('foo', 'bar', 'foobar', 'barfoo', 'spam', 'eggs'))
+
+    def get_tokens_unprocessed(self, text):
+        for index, token, value in PythonLexer.get_tokens_unprocessed(self, text):
+            if token is Name and value in self.EXTRA_KEYWORDS:
+                yield index, Keyword.Pseudo, value
+            else:
+                yield index, token, value
+
+
+

The PhpLexer and LuaLexer use this method to resolve builtin functions.

+
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/lexers.html b/doc/_build/html/docs/lexers.html new file mode 100644 index 0000000..d244c2e --- /dev/null +++ b/doc/_build/html/docs/lexers.html @@ -0,0 +1,10169 @@ + + + + + + + + Available lexers — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Available lexers¶

+

This page lists all available builtin lexers and the options they take.

+

Currently, all lexers support these options:

+
+
stripnl
+
Strip leading and trailing newlines from the input (default: True)
+
stripall
+
Strip all leading and trailing whitespace from the input (default: +False).
+
ensurenl
+

Make sure that the input ends with a newline (default: True). This +is required for some lexers that consume input linewise.

+
+

New in version 1.3.

+
+
+
tabsize
+
If given and greater than 0, expand tabs in the input (default: 0).
+
encoding
+

If given, must be an encoding name (such as "utf-8"). This encoding +will be used to convert the input string to Unicode (if it is not already +a Unicode string). The default is "guess".

+

If this option is set to "guess", a simple UTF-8 vs. Latin-1 +detection is used, if it is set to "chardet", the +chardet library is used to +guess the encoding of the input.

+
+

New in version 0.6.

+
+
+
+

The “Short Names” field lists the identifiers that can be used with the +get_lexer_by_name() function.

+

These lexers are builtin and can be imported from pygments.lexers:

+
+

Lexers for ActionScript and MXML¶

+
+
+class pygments.lexers.actionscript.ActionScript3Lexer¶
+
+++ + + + + + + + +
Short names:as3, actionscript3
Filenames:*.as
MIME types:application/x-actionscript3, text/x-actionscript3, text/actionscript3
+

For ActionScript 3 source code.

+
+

New in version 0.11.

+
+
+ +
+
+class pygments.lexers.actionscript.ActionScriptLexer¶
+
+++ + + + + + + + +
Short names:as, actionscript
Filenames:*.as
MIME types:application/x-actionscript, text/x-actionscript, text/actionscript
+

For ActionScript source code.

+
+

New in version 0.9.

+
+
+ +
+
+class pygments.lexers.actionscript.MxmlLexer¶
+
+++ + + + + + + + +
Short names:mxml
Filenames:*.mxml
MIME types:None
+

For MXML markup. +Nested AS3 in <script> tags is highlighted by the appropriate lexer.

+
+

New in version 1.1.

+
+
+ +
+
+

Lexers for computer algebra systems¶

+
+
+class pygments.lexers.algebra.BCLexer¶
+
+++ + + + + + + + +
Short names:bc
Filenames:*.bc
MIME types:None
+

A BC lexer.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.algebra.GAPLexer¶
+
+++ + + + + + + + +
Short names:gap
Filenames:*.g, *.gd, *.gi, *.gap
MIME types:None
+

For GAP source code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.algebra.MathematicaLexer¶
+
+++ + + + + + + + +
Short names:mathematica, mma, nb
Filenames:*.nb, *.cdf, *.nbp, *.ma
MIME types:application/mathematica, application/vnd.wolfram.mathematica, application/vnd.wolfram.mathematica.package, application/vnd.wolfram.cdf
+

Lexer for Mathematica source code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.algebra.MuPADLexer¶
+
+++ + + + + + + + +
Short names:mupad
Filenames:*.mu
MIME types:None
+

A MuPAD lexer. +Contributed by Christopher Creutzig <christopher@creutzig.de>.

+
+

New in version 0.8.

+
+
+ +
+
+

Lexers for AmbientTalk language¶

+
+
+class pygments.lexers.ambient.AmbientTalkLexer¶
+
+++ + + + + + + + +
Short names:at, ambienttalk, ambienttalk/2
Filenames:*.at
MIME types:text/x-ambienttalk
+

Lexer for AmbientTalk source code.

+
+

New in version 2.0.

+
+
+ +
+
+

Lexers for the AMPL language¶

+
+
+class pygments.lexers.ampl.AmplLexer¶
+
+++ + + + + + + + +
Short names:ampl
Filenames:*.run
MIME types:None
+

For AMPL source code.

+
+

New in version 2.2.

+
+
+ +
+
+

Lexers for APL¶

+
+
+class pygments.lexers.apl.APLLexer¶
+
+++ + + + + + + + +
Short names:apl
Filenames:*.apl
MIME types:None
+

A simple APL lexer.

+
+

New in version 2.0.

+
+
+ +
+ +
+

Lexers for assembly languages¶

+
+
+class pygments.lexers.asm.CObjdumpLexer¶
+
+++ + + + + + + + +
Short names:c-objdump
Filenames:*.c-objdump
MIME types:text/x-c-objdump
+

For the output of ‘objdump -Sr on compiled C files’

+
+ +
+
+class pygments.lexers.asm.Ca65Lexer¶
+
+++ + + + + + + + +
Short names:ca65
Filenames:*.s
MIME types:None
+

For ca65 assembler sources.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.asm.CppObjdumpLexer¶
+
+++ + + + + + + + +
Short names:cpp-objdump, c++-objdumb, cxx-objdump
Filenames:*.cpp-objdump, *.c++-objdump, *.cxx-objdump
MIME types:text/x-cpp-objdump
+

For the output of ‘objdump -Sr on compiled C++ files’

+
+ +
+
+class pygments.lexers.asm.DObjdumpLexer¶
+
+++ + + + + + + + +
Short names:d-objdump
Filenames:*.d-objdump
MIME types:text/x-d-objdump
+

For the output of ‘objdump -Sr on compiled D files’

+
+ +
+
+class pygments.lexers.asm.GasLexer¶
+
+++ + + + + + + + +
Short names:gas, asm
Filenames:*.s, *.S
MIME types:text/x-gas
+

For Gas (AT&T) assembly code.

+
+ +
+
+class pygments.lexers.asm.HsailLexer¶
+
+++ + + + + + + + +
Short names:hsail, hsa
Filenames:*.hsail
MIME types:text/x-hsail
+

For HSAIL assembly code.

+
+

New in version 2.2.

+
+
+ +
+
+class pygments.lexers.asm.LlvmLexer¶
+
+++ + + + + + + + +
Short names:llvm
Filenames:*.ll
MIME types:text/x-llvm
+

For LLVM assembly code.

+
+ +
+
+class pygments.lexers.asm.NasmLexer¶
+
+++ + + + + + + + +
Short names:nasm
Filenames:*.asm, *.ASM
MIME types:text/x-nasm
+

For Nasm (Intel) assembly code.

+
+ +
+
+class pygments.lexers.asm.NasmObjdumpLexer¶
+
+++ + + + + + + + +
Short names:objdump-nasm
Filenames:*.objdump-intel
MIME types:text/x-nasm-objdump
+

For the output of ‘objdump -d -M intel’.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.asm.ObjdumpLexer¶
+
+++ + + + + + + + +
Short names:objdump
Filenames:*.objdump
MIME types:text/x-objdump
+

For the output of ‘objdump -dr’

+
+ +
+
+class pygments.lexers.asm.TasmLexer¶
+
+++ + + + + + + + +
Short names:tasm
Filenames:*.asm, *.ASM, *.tasm
MIME types:text/x-tasm
+

For Tasm (Turbo Assembler) assembly code.

+
+ +
+
+

Lexers for automation scripting languages¶

+
+
+class pygments.lexers.automation.AutoItLexer¶
+
+++ + + + + + + + +
Short names:autoit
Filenames:*.au3
MIME types:text/x-autoit
+

For AutoIt files.

+

AutoIt is a freeware BASIC-like scripting language +designed for automating the Windows GUI and general scripting

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.automation.AutohotkeyLexer¶
+
+++ + + + + + + + +
Short names:ahk, autohotkey
Filenames:*.ahk, *.ahkl
MIME types:text/x-autohotkey
+

For autohotkey source code.

+
+

New in version 1.4.

+
+
+ +
+
+

Lexers for BASIC like languages (other than VB.net)¶

+
+
+class pygments.lexers.basic.BlitzBasicLexer¶
+
+++ + + + + + + + +
Short names:blitzbasic, b3d, bplus
Filenames:*.bb, *.decls
MIME types:text/x-bb
+

For BlitzBasic source code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.basic.BlitzMaxLexer¶
+
+++ + + + + + + + +
Short names:blitzmax, bmax
Filenames:*.bmx
MIME types:text/x-bmx
+

For BlitzMax source code.

+
+

New in version 1.4.

+
+
+ +
+
+class pygments.lexers.basic.CbmBasicV2Lexer¶
+
+++ + + + + + + + +
Short names:cbmbas
Filenames:*.bas
MIME types:None
+

For CBM BASIC V2 sources.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.basic.MonkeyLexer¶
+
+++ + + + + + + + +
Short names:monkey
Filenames:*.monkey
MIME types:text/x-monkey
+

For +Monkey +source code.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.basic.QBasicLexer¶
+
+++ + + + + + + + +
Short names:qbasic, basic
Filenames:*.BAS, *.bas
MIME types:text/basic
+

For +QBasic +source code.

+
+

New in version 2.0.

+
+
+ +
+
+

Lexers for BibTeX bibliography data and styles¶

+
+
+class pygments.lexers.bibtex.BSTLexer¶
+
+++ + + + + + + + +
Short names:bst, bst-pybtex
Filenames:*.bst
MIME types:None
+

A lexer for BibTeX bibliography styles.

+
+

New in version 2.2.

+
+
+ +
+
+class pygments.lexers.bibtex.BibTeXLexer¶
+
+++ + + + + + + + +
Short names:bib, bibtex
Filenames:*.bib
MIME types:text/x-bibtex
+

A lexer for BibTeX bibliography data format.

+
+

New in version 2.2.

+
+
+ +
+
+

Lexers for “business-oriented” languages¶

+
+
+class pygments.lexers.business.ABAPLexer¶
+
+++ + + + + + + + +
Short names:abap
Filenames:*.abap, *.ABAP
MIME types:text/x-abap
+

Lexer for ABAP, SAP’s integrated language.

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.business.CobolFreeformatLexer¶
+
+++ + + + + + + + +
Short names:cobolfree
Filenames:*.cbl, *.CBL
MIME types:None
+

Lexer for Free format OpenCOBOL code.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.business.CobolLexer¶
+
+++ + + + + + + + +
Short names:cobol
Filenames:*.cob, *.COB, *.cpy, *.CPY
MIME types:text/x-cobol
+

Lexer for OpenCOBOL code.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.business.GoodDataCLLexer¶
+
+++ + + + + + + + +
Short names:gooddata-cl
Filenames:*.gdc
MIME types:text/x-gooddata-cl
+

Lexer for GoodData-CL +script files.

+
+

New in version 1.4.

+
+
+ +
+
+class pygments.lexers.business.MaqlLexer¶
+
+++ + + + + + + + +
Short names:maql
Filenames:*.maql
MIME types:text/x-gooddata-maql, application/x-gooddata-maql
+

Lexer for GoodData MAQL +scripts.

+
+

New in version 1.4.

+
+
+ +
+
+class pygments.lexers.business.OpenEdgeLexer¶
+
+++ + + + + + + + +
Short names:openedge, abl, progress
Filenames:*.p, *.cls
MIME types:text/x-openedge, application/x-openedge
+

Lexer for OpenEdge ABL (formerly Progress) source code.

+
+

New in version 1.5.

+
+
+ +
+
+

Lexers for C/C++ languages¶

+
+
+class pygments.lexers.c_cpp.CLexer¶
+
+++ + + + + + + + +
Short names:c
Filenames:*.c, *.h, *.idc
MIME types:text/x-chdr, text/x-csrc
+

For C source code with preprocessor directives.

+
+ +
+
+class pygments.lexers.c_cpp.CppLexer¶
+
+++ + + + + + + + +
Short names:cpp, c++
Filenames:*.cpp, *.hpp, *.c++, *.h++, *.cc, *.hh, *.cxx, *.hxx, *.C, *.H, *.cp, *.CPP
MIME types:text/x-c++hdr, text/x-c++src
+

For C++ source code with preprocessor directives.

+
+ +
+
+

Lexers for other C-like languages¶

+
+
+class pygments.lexers.c_like.ArduinoLexer¶
+
+++ + + + + + + + +
Short names:arduino
Filenames:*.ino
MIME types:text/x-arduino
+

For Arduino(tm) source.

+

This is an extension of the CppLexer, as the Arduino® Language is a superset +of C++

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.c_like.ClayLexer¶
+
+++ + + + + + + + +
Short names:clay
Filenames:*.clay
MIME types:text/x-clay
+

For Clay source.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.c_like.CudaLexer¶
+
+++ + + + + + + + +
Short names:cuda, cu
Filenames:*.cu, *.cuh
MIME types:text/x-cuda
+

For NVIDIA CUDA™ +source.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.c_like.ECLexer¶
+
+++ + + + + + + + +
Short names:ec
Filenames:*.ec, *.eh
MIME types:text/x-echdr, text/x-ecsrc
+

For eC source code with preprocessor directives.

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.c_like.MqlLexer¶
+
+++ + + + + + + + +
Short names:mql, mq4, mq5, mql4, mql5
Filenames:*.mq4, *.mq5, *.mqh
MIME types:text/x-mql
+

For MQL4 and +MQL5 source code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.c_like.NesCLexer¶
+
+++ + + + + + + + +
Short names:nesc
Filenames:*.nc
MIME types:text/x-nescsrc
+

For nesC source code with preprocessor +directives.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.c_like.PikeLexer¶
+
+++ + + + + + + + +
Short names:pike
Filenames:*.pike, *.pmod
MIME types:text/x-pike
+

For Pike source code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.c_like.SwigLexer¶
+
+++ + + + + + + + +
Short names:swig
Filenames:*.swg, *.i
MIME types:text/swig
+

For SWIG source code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.c_like.ValaLexer¶
+
+++ + + + + + + + +
Short names:vala, vapi
Filenames:*.vala, *.vapi
MIME types:text/x-vala
+

For Vala source code with preprocessor directives.

+
+

New in version 1.1.

+
+
+ +
+
+

Lexers for the Cap’n Proto schema language¶

+
+
+class pygments.lexers.capnproto.CapnProtoLexer¶
+
+++ + + + + + + + +
Short names:capnp
Filenames:*.capnp
MIME types:None
+

For Cap’n Proto source.

+
+

New in version 2.2.

+
+
+ +
+
+

Lexer for the Chapel language¶

+
+
+class pygments.lexers.chapel.ChapelLexer¶
+
+++ + + + + + + + +
Short names:chapel, chpl
Filenames:*.chpl
MIME types:None
+

For Chapel source.

+
+

New in version 2.0.

+
+
+ +
+
+

Lexer for the Clean language¶

+
+
+class pygments.lexers.clean.CleanLexer¶
+
+++ + + + + + + + +
Short names:clean
Filenames:*.icl, *.dcl
MIME types:None
+

Lexer for the general purpose, state-of-the-art, pure and lazy functional +programming language Clean (http://clean.cs.ru.nl/Clean).

+
+ +
+
+

Lexers for configuration file formats¶

+
+
+class pygments.lexers.configs.ApacheConfLexer¶
+
+++ + + + + + + + +
Short names:apacheconf, aconf, apache
Filenames:.htaccess, apache.conf, apache2.conf
MIME types:text/x-apacheconf
+

Lexer for configuration files following the Apache config file +format.

+
+

New in version 0.6.

+
+
+ +
+
+class pygments.lexers.configs.Cfengine3Lexer¶
+
+++ + + + + + + + +
Short names:cfengine3, cf3
Filenames:*.cf
MIME types:None
+

Lexer for CFEngine3 policy files.

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.configs.DockerLexer¶
+
+++ + + + + + + + +
Short names:docker, dockerfile
Filenames:Dockerfile, *.docker
MIME types:text/x-dockerfile-config
+

Lexer for Docker configuration files.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.configs.IniLexer¶
+
+++ + + + + + + + +
Short names:ini, cfg, dosini
Filenames:*.ini, *.cfg, *.inf
MIME types:text/x-ini, text/inf
+

Lexer for configuration files in INI style.

+
+ +
+
+class pygments.lexers.configs.KconfigLexer¶
+
+++ + + + + + + + +
Short names:kconfig, menuconfig, linux-config, kernel-config
Filenames:Kconfig, *Config.in*, external.in*, standard-modules.in
MIME types:text/x-kconfig
+

For Linux-style Kconfig files.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.configs.LighttpdConfLexer¶
+
+++ + + + + + + + +
Short names:lighty, lighttpd
Filenames:None
MIME types:text/x-lighttpd-conf
+

Lexer for Lighttpd configuration files.

+
+

New in version 0.11.

+
+
+ +
+
+class pygments.lexers.configs.NginxConfLexer¶
+
+++ + + + + + + + +
Short names:nginx
Filenames:nginx.conf
MIME types:text/x-nginx-conf
+

Lexer for Nginx configuration files.

+
+

New in version 0.11.

+
+
+ +
+
+class pygments.lexers.configs.PacmanConfLexer¶
+
+++ + + + + + + + +
Short names:pacmanconf
Filenames:pacman.conf
MIME types:None
+

Lexer for pacman.conf.

+

Actually, IniLexer works almost fine for this format, +but it yield error token. It is because pacman.conf has +a form without assignment like:

+
+
UseSyslog +Color +TotalDownload +CheckSpace +VerbosePkgLists
+

These are flags to switch on.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.configs.PkgConfigLexer¶
+
+++ + + + + + + + +
Short names:pkgconfig
Filenames:*.pc
MIME types:None
+

Lexer for pkg-config +(see also manual page).

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.configs.PropertiesLexer¶
+
+++ + + + + + + + +
Short names:properties, jproperties
Filenames:*.properties
MIME types:text/x-java-properties
+

Lexer for configuration files in Java’s properties format.

+

Note: trailing whitespace counts as part of the value as per spec

+
+

New in version 1.4.

+
+
+ +
+
+class pygments.lexers.configs.RegeditLexer¶
+
+++ + + + + + + + +
Short names:registry
Filenames:*.reg
MIME types:text/x-windows-registry
+

Lexer for Windows Registry files produced +by regedit.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.configs.SquidConfLexer¶
+
+++ + + + + + + + +
Short names:squidconf, squid.conf, squid
Filenames:squid.conf
MIME types:text/x-squidconf
+

Lexer for squid configuration files.

+
+

New in version 0.9.

+
+
+ +
+
+class pygments.lexers.configs.TermcapLexer¶
+
+++ + + + + + + + +
Short names:termcap
Filenames:termcap, termcap.src
MIME types:None
+

Lexer for termcap database source.

+

This is very simple and minimal.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.configs.TerminfoLexer¶
+
+++ + + + + + + + +
Short names:terminfo
Filenames:terminfo, terminfo.src
MIME types:None
+

Lexer for terminfo database source.

+

This is very simple and minimal.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.configs.TerraformLexer¶
+
+++ + + + + + + + +
Short names:terraform, tf
Filenames:*.tf
MIME types:application/x-tf, application/x-terraform
+

Lexer for terraformi .tf files.

+
+

New in version 2.1.

+
+
+ +
+
+

Lexers for misc console output¶

+
+
+class pygments.lexers.console.PyPyLogLexer¶
+
+++ + + + + + + + +
Short names:pypylog, pypy
Filenames:*.pypylog
MIME types:application/x-pypylog
+

Lexer for PyPy log files.

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.console.VCTreeStatusLexer¶
+
+++ + + + + + + + +
Short names:vctreestatus
Filenames:None
MIME types:None
+

For colorizing output of version control status commands, like “hg +status” or “svn status”.

+
+

New in version 2.0.

+
+
+ +
+
+

Lexer for Crystal¶

+
+
+class pygments.lexers.crystal.CrystalLexer¶
+
+++ + + + + + + + +
Short names:cr, crystal
Filenames:*.cr
MIME types:text/x-crystal
+

For Crystal source code.

+
+

New in version 2.2.

+
+
+ +
+
+

Lexers for CSound languages¶

+
+
+class pygments.lexers.csound.CsoundDocumentLexer¶
+
+++ + + + + + + + +
Short names:csound-document, csound-csd
Filenames:*.csd
MIME types:None
+

For Csound documents.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.csound.CsoundOrchestraLexer¶
+
+++ + + + + + + + +
Short names:csound, csound-orc
Filenames:*.orc
MIME types:None
+

For Csound orchestras.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.csound.CsoundScoreLexer¶
+
+++ + + + + + + + +
Short names:csound-score, csound-sco
Filenames:*.sco
MIME types:None
+

For Csound scores.

+
+

New in version 2.1.

+
+
+ +
+ +
+

Lexers for D languages¶

+
+
+class pygments.lexers.d.CrocLexer¶
+
+++ + + + + + + + +
Short names:croc
Filenames:*.croc
MIME types:text/x-crocsrc
+

For Croc source.

+
+ +
+
+class pygments.lexers.d.DLexer¶
+
+++ + + + + + + + +
Short names:d
Filenames:*.d, *.di
MIME types:text/x-dsrc
+

For D source.

+
+

New in version 1.2.

+
+
+ +
+
+class pygments.lexers.d.MiniDLexer¶
+
+++ + + + + + + + +
Short names:minid
Filenames:None
MIME types:text/x-minidsrc
+

For MiniD source. MiniD is now known as Croc.

+
+ +
+ +
+

Lexers for data file format¶

+
+
+class pygments.lexers.data.JsonBareObjectLexer¶
+
+++ + + + + + + + +
Short names:json-object
Filenames:None
MIME types:application/json-object
+

For JSON data structures (with missing object curly braces).

+
+

New in version 2.2.

+
+
+ +
+
+class pygments.lexers.data.JsonLdLexer¶
+
+++ + + + + + + + +
Short names:jsonld, json-ld
Filenames:*.jsonld
MIME types:application/ld+json
+

For JSON-LD linked data.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.data.JsonLexer¶
+
+++ + + + + + + + +
Short names:json
Filenames:*.json
MIME types:application/json
+

For JSON data structures.

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.data.YamlLexer¶
+
+++ + + + + + + + +
Short names:yaml
Filenames:*.yaml, *.yml
MIME types:text/x-yaml
+

Lexer for YAML, a human-friendly data serialization +language.

+
+

New in version 0.11.

+
+
+ +
+
+

Lexers for diff/patch formats¶

+
+
+class pygments.lexers.diff.DarcsPatchLexer¶
+
+++ + + + + + + + +
Short names:dpatch
Filenames:*.dpatch, *.darcspatch
MIME types:None
+

DarcsPatchLexer is a lexer for the various versions of the darcs patch +format. Examples of this format are derived by commands such as +darcs annotate --patch and darcs send.

+
+

New in version 0.10.

+
+
+ +
+
+class pygments.lexers.diff.DiffLexer¶
+
+++ + + + + + + + +
Short names:diff, udiff
Filenames:*.diff, *.patch
MIME types:text/x-diff, text/x-patch
+

Lexer for unified or context-style diffs or patches.

+
+ +
+
+class pygments.lexers.diff.WDiffLexer¶
+
+++ + + + + + + + +
Short names:wdiff
Filenames:*.wdiff
MIME types:None
+

A wdiff lexer.

+

Note that:

+
    +
  • only to normal output (without option like -l).
  • +
  • if target files of wdiff contain “[-“, “-]”, “{+”, “+}”, +especially they are unbalanced, this lexer will get confusing.
  • +
+
+

New in version 2.2.

+
+
+ +
+
+

Lexers for .net languages¶

+
+
+class pygments.lexers.dotnet.BooLexer¶
+
+++ + + + + + + + +
Short names:boo
Filenames:*.boo
MIME types:text/x-boo
+

For Boo source code.

+
+ +
+
+class pygments.lexers.dotnet.CSharpAspxLexer¶
+
+++ + + + + + + + +
Short names:aspx-cs
Filenames:*.aspx, *.asax, *.ascx, *.ashx, *.asmx, *.axd
MIME types:None
+

Lexer for highlighting C# within ASP.NET pages.

+
+ +
+
+class pygments.lexers.dotnet.CSharpLexer¶
+
+++ + + + + + + + +
Short names:csharp, c#
Filenames:*.cs
MIME types:text/x-csharp
+

For C# +source code.

+

Additional options accepted:

+
+
unicodelevel
+

Determines which Unicode characters this lexer allows for identifiers. +The possible values are:

+
    +
  • none – only the ASCII letters and numbers are allowed. This +is the fastest selection.
  • +
  • basic – all Unicode characters from the specification except +category Lo are allowed.
  • +
  • full – all Unicode characters as specified in the C# specs +are allowed. Note that this means a considerable slowdown since the +Lo category has more than 40,000 characters in it!
  • +
+

The default value is basic.

+
+

New in version 0.8.

+
+
+
+
+ +
+
+class pygments.lexers.dotnet.FSharpLexer¶
+
+++ + + + + + + + +
Short names:fsharp
Filenames:*.fs, *.fsi
MIME types:text/x-fsharp
+

For the F# language (version 3.0).

+

AAAAACK Strings +http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.html#_Toc335818775

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.dotnet.NemerleLexer¶
+
+++ + + + + + + + +
Short names:nemerle
Filenames:*.n
MIME types:text/x-nemerle
+

For Nemerle source code.

+

Additional options accepted:

+
+
unicodelevel
+

Determines which Unicode characters this lexer allows for identifiers. +The possible values are:

+
    +
  • none – only the ASCII letters and numbers are allowed. This +is the fastest selection.
  • +
  • basic – all Unicode characters from the specification except +category Lo are allowed.
  • +
  • full – all Unicode characters as specified in the C# specs +are allowed. Note that this means a considerable slowdown since the +Lo category has more than 40,000 characters in it!
  • +
+

The default value is basic.

+
+
+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.dotnet.VbNetAspxLexer¶
+
+++ + + + + + + + +
Short names:aspx-vb
Filenames:*.aspx, *.asax, *.ascx, *.ashx, *.asmx, *.axd
MIME types:None
+

Lexer for highlighting Visual Basic.net within ASP.NET pages.

+
+ +
+
+class pygments.lexers.dotnet.VbNetLexer¶
+
+++ + + + + + + + +
Short names:vb.net, vbnet
Filenames:*.vb, *.bas
MIME types:text/x-vbnet, text/x-vba
+

For +Visual Basic.NET +source code.

+
+ +
+
+

Lexers for various domain-specific languages¶

+
+
+class pygments.lexers.dsls.AlloyLexer¶
+
+++ + + + + + + + +
Short names:alloy
Filenames:*.als
MIME types:text/x-alloy
+

For Alloy source code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.dsls.BroLexer¶
+
+++ + + + + + + + +
Short names:bro
Filenames:*.bro
MIME types:None
+

For Bro scripts.

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.dsls.CrmshLexer¶
+
+++ + + + + + + + +
Short names:crmsh, pcmk
Filenames:*.crmsh, *.pcmk
MIME types:None
+

Lexer for crmsh configuration files +for Pacemaker clusters.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.dsls.FlatlineLexer¶
+
+++ + + + + + + + +
Short names:flatline
Filenames:None
MIME types:text/x-flatline
+

Lexer for Flatline expressions.

+
+

New in version 2.2.

+
+
+ +
+
+class pygments.lexers.dsls.MscgenLexer¶
+
+++ + + + + + + + +
Short names:mscgen, msc
Filenames:*.msc
MIME types:None
+

For Mscgen files.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.dsls.PanLexer¶
+
+++ + + + + + + + +
Short names:pan
Filenames:*.pan
MIME types:None
+

Lexer for pan source files.

+

Based on tcsh lexer.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.dsls.ProtoBufLexer¶
+
+++ + + + + + + + +
Short names:protobuf, proto
Filenames:*.proto
MIME types:None
+

Lexer for Protocol Buffer +definition files.

+
+

New in version 1.4.

+
+
+ +
+
+class pygments.lexers.dsls.PuppetLexer¶
+
+++ + + + + + + + +
Short names:puppet
Filenames:*.pp
MIME types:None
+

For Puppet configuration DSL.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.dsls.RslLexer¶
+
+++ + + + + + + + +
Short names:rsl
Filenames:*.rsl
MIME types:text/rsl
+

RSL is the formal specification +language used in RAISE (Rigorous Approach to Industrial Software Engineering) +method.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.dsls.SnowballLexer¶
+
+++ + + + + + + + +
Short names:snowball
Filenames:*.sbl
MIME types:None
+

Lexer for Snowball source code.

+
+

New in version 2.2.

+
+
+ +
+
+class pygments.lexers.dsls.ThriftLexer¶
+
+++ + + + + + + + +
Short names:thrift
Filenames:*.thrift
MIME types:application/x-thrift
+

For Thrift interface definitions.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.dsls.VGLLexer¶
+
+++ + + + + + + + +
Short names:vgl
Filenames:*.rpf
MIME types:None
+

For SampleManager VGL +source code.

+
+

New in version 1.6.

+
+
+ +
+
+

Lexers for the Dylan language¶

+
+
+class pygments.lexers.dylan.DylanConsoleLexer¶
+
+++ + + + + + + + +
Short names:dylan-console, dylan-repl
Filenames:*.dylan-console
MIME types:text/x-dylan-console
+

For Dylan interactive console output like:

+
? let a = 1;
+=> 1
+? a
+=> 1
+
+
+

This is based on a copy of the RubyConsoleLexer.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.dylan.DylanLexer¶
+
+++ + + + + + + + +
Short names:dylan
Filenames:*.dylan, *.dyl, *.intr
MIME types:text/x-dylan
+

For the Dylan language.

+
+

New in version 0.7.

+
+
+ +
+
+class pygments.lexers.dylan.DylanLidLexer¶
+
+++ + + + + + + + +
Short names:dylan-lid, lid
Filenames:*.lid, *.hdp
MIME types:text/x-dylan-lid
+

For Dylan LID (Library Interchange Definition) files.

+
+

New in version 1.6.

+
+
+ +
+
+

Lexers for the ECL language¶

+
+
+class pygments.lexers.ecl.ECLLexer¶
+
+++ + + + + + + + +
Short names:ecl
Filenames:*.ecl
MIME types:application/x-ecl
+

Lexer for the declarative big-data ECL +language.

+
+

New in version 1.5.

+
+
+ +
+
+

Lexer for the Eiffel language¶

+
+
+class pygments.lexers.eiffel.EiffelLexer¶
+
+++ + + + + + + + +
Short names:eiffel
Filenames:*.e
MIME types:text/x-eiffel
+

For Eiffel source code.

+
+

New in version 2.0.

+
+
+ +
+
+

Lexer for the Elm programming language¶

+
+
+class pygments.lexers.elm.ElmLexer¶
+
+++ + + + + + + + +
Short names:elm
Filenames:*.elm
MIME types:text/x-elm
+

For Elm source code.

+
+

New in version 2.1.

+
+
+ +
+
+

Lexers for Erlang¶

+
+
+class pygments.lexers.erlang.ElixirConsoleLexer¶
+
+++ + + + + + + + +
Short names:iex
Filenames:None
MIME types:text/x-elixir-shellsession
+

For Elixir interactive console (iex) output like:

+
iex> [head | tail] = [1,2,3]
+[1,2,3]
+iex> head
+1
+iex> tail
+[2,3]
+iex> [head | tail]
+[1,2,3]
+iex> length [head | tail]
+3
+
+
+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.erlang.ElixirLexer¶
+
+++ + + + + + + + +
Short names:elixir, ex, exs
Filenames:*.ex, *.exs
MIME types:text/x-elixir
+

For the Elixir language.

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.erlang.ErlangLexer¶
+
+++ + + + + + + + +
Short names:erlang
Filenames:*.erl, *.hrl, *.es, *.escript
MIME types:text/x-erlang
+

For the Erlang functional programming language.

+

Blame Jeremy Thurgood (http://jerith.za.net/).

+
+

New in version 0.9.

+
+
+ +
+
+class pygments.lexers.erlang.ErlangShellLexer¶
+
+++ + + + + + + + +
Short names:erl
Filenames:*.erl-sh
MIME types:text/x-erl-shellsession
+

Shell sessions in erl (for Erlang code).

+
+

New in version 1.1.

+
+
+ +
+
+

Lexers for esoteric languages¶

+
+
+class pygments.lexers.esoteric.AheuiLexer¶
+
+++ + + + + + + + +
Short names:aheui
Filenames:*.aheui
MIME types:None
+

Aheui_ Lexer.

+

Aheui_ is esoteric language based on Korean alphabets.

+
+ +
+
+class pygments.lexers.esoteric.BefungeLexer¶
+
+++ + + + + + + + +
Short names:befunge
Filenames:*.befunge
MIME types:application/x-befunge
+

Lexer for the esoteric Befunge +language.

+
+

New in version 0.7.

+
+
+ +
+
+class pygments.lexers.esoteric.BrainfuckLexer¶
+
+++ + + + + + + + +
Short names:brainfuck, bf
Filenames:*.bf, *.b
MIME types:application/x-brainfuck
+

Lexer for the esoteric BrainFuck +language.

+
+ +
+
+class pygments.lexers.esoteric.CAmkESLexer¶
+
+++ + + + + + + + +
Short names:camkes, idl4
Filenames:*.camkes, *.idl4
MIME types:None
+

Basic lexer for the input language for the +CAmkES component platform.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.esoteric.CapDLLexer¶
+
+++ + + + + + + + +
Short names:capdl
Filenames:*.cdl
MIME types:None
+

Basic lexer for +CapDL.

+

The source of the primary tool that reads such specifications is available +at https://github.com/seL4/capdl/tree/master/capDL-tool. Note that this +lexer only supports a subset of the grammar. For example, identifiers can +shadow type names, but these instances are currently incorrectly +highlighted as types. Supporting this would need a stateful lexer that is +considered unnecessarily complex for now.

+
+

New in version 2.2.

+
+
+ +
+
+class pygments.lexers.esoteric.RedcodeLexer¶
+
+++ + + + + + + + +
Short names:redcode
Filenames:*.cw
MIME types:None
+

A simple Redcode lexer based on ICWS‘94. +Contributed by Adam Blinkinsop <blinks@acm.org>.

+
+

New in version 0.8.

+
+
+ +
+
+

Pygments lexers for Ezhil language¶

+
+
+class pygments.lexers.ezhil.EzhilLexer¶
+
+++ + + + + + + + +
Short names:ezhil
Filenames:*.n
MIME types:text/x-ezhil
+

Lexer for Ezhil, a Tamil script-based programming language

+
+

New in version 2.1.

+
+
+ +
+
+

Lexers for the Factor language¶

+
+
+class pygments.lexers.factor.FactorLexer¶
+
+++ + + + + + + + +
Short names:factor
Filenames:*.factor
MIME types:text/x-factor
+

Lexer for the Factor language.

+
+

New in version 1.4.

+
+
+ +
+
+

Lexer for the Fantom language¶

+
+
+class pygments.lexers.fantom.FantomLexer¶
+
+++ + + + + + + + +
Short names:fan
Filenames:*.fan
MIME types:application/x-fantom
+

For Fantom source code.

+
+

New in version 1.5.

+
+
+ +
+
+

Lexer for the Felix language¶

+
+
+class pygments.lexers.felix.FelixLexer¶
+
+++ + + + + + + + +
Short names:felix, flx
Filenames:*.flx, *.flxh
MIME types:text/x-felix
+

For Felix source code.

+
+

New in version 1.2.

+
+
+ + +++ + + + +
copyright:Copyright 2006-2017 by the Pygments team, see AUTHORS
+
+
+
+class pygments.lexers.forth.ForthLexer¶
+
+++ + + + + + + + +
Short names:forth
Filenames:*.frt, *.fs
MIME types:application/x-forth
+

Lexer for Forth files.

+
+

New in version 2.2.

+
+
+ +
+
+

Lexers for Fortran languages¶

+
+
+class pygments.lexers.fortran.FortranFixedLexer¶
+
+++ + + + + + + + +
Short names:fortranfixed
Filenames:*.f, *.F
MIME types:None
+

Lexer for fixed format Fortran.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.fortran.FortranLexer¶
+
+++ + + + + + + + +
Short names:fortran
Filenames:*.f03, *.f90, *.F03, *.F90
MIME types:text/x-fortran
+

Lexer for FORTRAN 90 code.

+
+

New in version 0.10.

+
+
+ +
+
+

Simple lexer for Microsoft Visual FoxPro source code¶

+
+
+class pygments.lexers.foxpro.FoxProLexer¶
+
+++ + + + + + + + +
Short names:foxpro, vfp, clipper, xbase
Filenames:*.PRG, *.prg
MIME types:None
+

Lexer for Microsoft Visual FoxPro language.

+

FoxPro syntax allows to shorten all keywords and function names +to 4 characters. Shortened forms are not recognized by this lexer.

+
+

New in version 1.6.

+
+
+ +
+
+

Lexers for the Google Go language¶

+
+
+class pygments.lexers.go.GoLexer¶
+
+++ + + + + + + + +
Short names:go
Filenames:*.go
MIME types:text/x-gosrc
+

For Go source.

+
+

New in version 1.2.

+
+
+ +
+
+

Lexers for grammer notations like BNF¶

+
+
+class pygments.lexers.grammar_notation.AbnfLexer¶
+
+++ + + + + + + + +
Short names:abnf
Filenames:*.abnf
MIME types:text/x-abnf
+

Lexer for IETF 7405 ABNF +(Updates 5234) +grammars.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.grammar_notation.BnfLexer¶
+
+++ + + + + + + + +
Short names:bnf
Filenames:*.bnf
MIME types:text/x-bnf
+

This lexer is for grammer notations which are similar to +original BNF.

+

In order to maximize a number of targets of this lexer, +let’s decide some designs:

+
    +
  • We don’t distinguish Terminal Symbol.
  • +
  • We do assume that NonTerminal Symbol are always enclosed +with arrow brackets.
  • +
  • We do assume that NonTerminal Symbol may include +any printable characters except arrow brackets and ASCII 0x20. +This assumption is for RBNF.
  • +
  • We do assume that target notation doesn’t support comment.
  • +
  • We don’t distinguish any operators and punctuation except +::=.
  • +
+

Though these desision making might cause too minimal highlighting +and you might be disappointed, but it is reasonable for us.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.grammar_notation.JsgfLexer¶
+
+++ + + + + + + + +
Short names:jsgf
Filenames:*.jsgf
MIME types:application/jsgf, application/x-jsgf, text/jsgf
+

For JSpeech Grammar Format +grammars.

+
+

New in version 2.2.

+
+
+ +
+
+

Lexers for graph query languages¶

+
+
+class pygments.lexers.graph.CypherLexer¶
+
+++ + + + + + + + +
Short names:cypher
Filenames:*.cyp, *.cypher
MIME types:None
+

For Cypher Query Language

+

For the Cypher version in Neo4J 2.0

+
+

New in version 2.0.

+
+
+ +
+ + + +
+

Lexers for hardware descriptor languages¶

+
+
+class pygments.lexers.hdl.SystemVerilogLexer¶
+
+++ + + + + + + + +
Short names:systemverilog, sv
Filenames:*.sv, *.svh
MIME types:text/x-systemverilog
+

Extends verilog lexer to recognise all SystemVerilog keywords from IEEE +1800-2009 standard.

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.hdl.VerilogLexer¶
+
+++ + + + + + + + +
Short names:verilog, v
Filenames:*.v
MIME types:text/x-verilog
+

For verilog source code with preprocessor directives.

+
+

New in version 1.4.

+
+
+ +
+
+class pygments.lexers.hdl.VhdlLexer¶
+
+++ + + + + + + + +
Short names:vhdl
Filenames:*.vhdl, *.vhd
MIME types:text/x-vhdl
+

For VHDL source code.

+
+

New in version 1.5.

+
+
+ +
+
+

Lexers for hexadecimal dumps¶

+
+
+class pygments.lexers.hexdump.HexdumpLexer¶
+
+++ + + + + + + + +
Short names:hexdump
Filenames:None
MIME types:None
+

For typical hex dump output formats by the UNIX and GNU/Linux tools hexdump, +hd, hexcat, od and xxd, and the DOS tool DEBUG. For example:

+
00000000  7f 45 4c 46 02 01 01 00  00 00 00 00 00 00 00 00  |.ELF............|
+00000010  02 00 3e 00 01 00 00 00  c5 48 40 00 00 00 00 00  |..>......H@.....|
+
+
+

The specific supported formats are the outputs of:

+
    +
  • hexdump FILE
  • +
  • hexdump -C FILE – the canonical format used in the example.
  • +
  • hd FILE – same as hexdump -C FILE.
  • +
  • hexcat FILE
  • +
  • od -t x1z FILE
  • +
  • xxd FILE
  • +
  • DEBUG.EXE FILE.COM and entering d to the prompt.
  • +
+
+

New in version 2.1.

+
+
+ +
+ +
+

Lexers for IDL¶

+
+
+class pygments.lexers.idl.IDLLexer¶
+
+++ + + + + + + + +
Short names:idl
Filenames:*.pro
MIME types:text/idl
+

Pygments Lexer for IDL (Interactive Data Language).

+
+

New in version 1.6.

+
+
+ +
+
+

Lexers for Igor Pro¶

+
+
+class pygments.lexers.igor.IgorLexer¶
+
+++ + + + + + + + +
Short names:igor, igorpro
Filenames:*.ipf
MIME types:text/ipf
+

Pygments Lexer for Igor Pro procedure files (.ipf). +See http://www.wavemetrics.com/ and http://www.igorexchange.com/.

+
+

New in version 2.0.

+
+
+ +
+ +
+

Lexers for installer/packager DSLs and formats¶

+
+
+class pygments.lexers.installers.DebianControlLexer¶
+
+++ + + + + + + + +
Short names:control, debcontrol
Filenames:control
MIME types:None
+

Lexer for Debian control files and apt-cache show <pkg> outputs.

+
+

New in version 0.9.

+
+
+ +
+
+class pygments.lexers.installers.NSISLexer¶
+
+++ + + + + + + + +
Short names:nsis, nsi, nsh
Filenames:*.nsi, *.nsh
MIME types:text/x-nsis
+

For NSIS scripts.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.installers.RPMSpecLexer¶
+
+++ + + + + + + + +
Short names:spec
Filenames:*.spec
MIME types:text/x-rpm-spec
+

For RPM .spec files.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.installers.SourcesListLexer¶
+
+++ + + + + + + + +
Short names:sourceslist, sources.list, debsources
Filenames:sources.list
MIME types:None
+

Lexer that highlights debian sources.list files.

+
+

New in version 0.7.

+
+
+ +
+
+

Lexers for interactive fiction languages¶

+
+
+class pygments.lexers.int_fiction.Inform6Lexer¶
+
+++ + + + + + + + +
Short names:inform6, i6
Filenames:*.inf
MIME types:None
+

For Inform 6 source code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.int_fiction.Inform6TemplateLexer¶
+
+++ + + + + + + + +
Short names:i6t
Filenames:*.i6t
MIME types:None
+

For Inform 6 template code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.int_fiction.Inform7Lexer¶
+
+++ + + + + + + + +
Short names:inform7, i7
Filenames:*.ni, *.i7x
MIME types:None
+

For Inform 7 source code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.int_fiction.Tads3Lexer¶
+
+++ + + + + + + + +
Short names:tads3
Filenames:*.t
MIME types:None
+

For TADS 3 source code.

+
+ +
+
+

Lexers for the Io language¶

+
+
+class pygments.lexers.iolang.IoLexer¶
+
+++ + + + + + + + +
Short names:io
Filenames:*.io
MIME types:text/x-iosrc
+

For Io (a small, prototype-based +programming language) source.

+
+

New in version 0.10.

+
+
+ +
+
+

Lexer for the J programming language¶

+
+
+class pygments.lexers.j.JLexer¶
+
+++ + + + + + + + +
Short names:j
Filenames:*.ijs
MIME types:text/x-j
+

For J source code.

+
+

New in version 2.1.

+
+
+ +
+ +
+

Lexers for the Julia language¶

+
+
+class pygments.lexers.julia.JuliaConsoleLexer¶
+
+++ + + + + + + + +
Short names:jlcon
Filenames:None
MIME types:None
+

For Julia console sessions. Modeled after MatlabSessionLexer.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.julia.JuliaLexer¶
+
+++ + + + + + + + +
Short names:julia, jl
Filenames:*.jl
MIME types:text/x-julia, application/x-julia
+

For Julia source code.

+
+

New in version 1.6.

+
+
+ +
+
+

Pygments lexers for JVM languages¶

+
+
+class pygments.lexers.jvm.AspectJLexer¶
+
+++ + + + + + + + +
Short names:aspectj
Filenames:*.aj
MIME types:text/x-aspectj
+

For AspectJ source code.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.jvm.CeylonLexer¶
+
+++ + + + + + + + +
Short names:ceylon
Filenames:*.ceylon
MIME types:text/x-ceylon
+

For Ceylon source code.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.jvm.ClojureLexer¶
+
+++ + + + + + + + +
Short names:clojure, clj
Filenames:*.clj
MIME types:text/x-clojure, application/x-clojure
+

Lexer for Clojure source code.

+
+

New in version 0.11.

+
+
+ +
+
+class pygments.lexers.jvm.ClojureScriptLexer¶
+
+++ + + + + + + + +
Short names:clojurescript, cljs
Filenames:*.cljs
MIME types:text/x-clojurescript, application/x-clojurescript
+

Lexer for ClojureScript +source code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.jvm.GoloLexer¶
+
+++ + + + + + + + +
Short names:golo
Filenames:*.golo
MIME types:None
+

For Golo source code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.jvm.GosuLexer¶
+
+++ + + + + + + + +
Short names:gosu
Filenames:*.gs, *.gsx, *.gsp, *.vark
MIME types:text/x-gosu
+

For Gosu source code.

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.jvm.GosuTemplateLexer¶
+
+++ + + + + + + + +
Short names:gst
Filenames:*.gst
MIME types:text/x-gosu-template
+

For Gosu templates.

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.jvm.GroovyLexer¶
+
+++ + + + + + + + +
Short names:groovy
Filenames:*.groovy, *.gradle
MIME types:text/x-groovy
+

For Groovy source code.

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.jvm.IokeLexer¶
+
+++ + + + + + + + +
Short names:ioke, ik
Filenames:*.ik
MIME types:text/x-iokesrc
+

For Ioke (a strongly typed, dynamic, +prototype based programming language) source.

+
+

New in version 1.4.

+
+
+ +
+
+class pygments.lexers.jvm.JasminLexer¶
+
+++ + + + + + + + +
Short names:jasmin, jasminxt
Filenames:*.j
MIME types:None
+

For Jasmin assembly code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.jvm.JavaLexer¶
+
+++ + + + + + + + +
Short names:java
Filenames:*.java
MIME types:text/x-java
+

For Java source code.

+
+ +
+
+class pygments.lexers.jvm.KotlinLexer¶
+
+++ + + + + + + + +
Short names:kotlin
Filenames:*.kt
MIME types:text/x-kotlin
+

For Kotlin +source code.

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.jvm.PigLexer¶
+
+++ + + + + + + + +
Short names:pig
Filenames:*.pig
MIME types:text/x-pig
+

For Pig Latin source code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.jvm.ScalaLexer¶
+
+++ + + + + + + + +
Short names:scala
Filenames:*.scala
MIME types:text/x-scala
+

For Scala source code.

+
+ +
+
+class pygments.lexers.jvm.XtendLexer¶
+
+++ + + + + + + + +
Short names:xtend
Filenames:*.xtend
MIME types:text/x-xtend
+

For Xtend source code.

+
+

New in version 1.6.

+
+
+ +
+
+

Lexers for Lispy languages¶

+
+
+class pygments.lexers.lisp.CPSALexer¶
+
+++ + + + + + + + +
Short names:cpsa
Filenames:*.cpsa
MIME types:None
+

A CPSA lexer based on the CPSA language as of version 2.2.12

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.lisp.CommonLispLexer¶
+
+++ + + + + + + + +
Short names:common-lisp, cl, lisp
Filenames:*.cl, *.lisp
MIME types:text/x-common-lisp
+

A Common Lisp lexer.

+
+

New in version 0.9.

+
+
+ +
+
+class pygments.lexers.lisp.EmacsLispLexer¶
+
+++ + + + + + + + +
Short names:emacs, elisp, emacs-lisp
Filenames:*.el
MIME types:text/x-elisp, application/x-elisp
+

An ELisp lexer, parsing a stream and outputting the tokens +needed to highlight elisp code.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.lisp.FennelLexer¶
+
+++ + + + + + + + +
Short names:None
Filenames:*.fnl
MIME types:None
+

A lexer for the Fennel programming language <https://fennel-lang.org>

+

Fennel compiles to Lua, so all the Lua builtins are recognized as well +as the special forms that are particular to the Fennel compiler.

+
+ +
+
+class pygments.lexers.lisp.HyLexer¶
+
+++ + + + + + + + +
Short names:hylang
Filenames:*.hy
MIME types:text/x-hy, application/x-hy
+

Lexer for Hy source code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.lisp.NewLispLexer¶
+
+++ + + + + + + + +
Short names:newlisp
Filenames:*.lsp, *.nl, *.kif
MIME types:text/x-newlisp, application/x-newlisp
+

For newLISP. source code (version 10.3.0).

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.lisp.RacketLexer¶
+
+++ + + + + + + + +
Short names:racket, rkt
Filenames:*.rkt, *.rktd, *.rktl
MIME types:text/x-racket, application/x-racket
+

Lexer for Racket source code (formerly +known as PLT Scheme).

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.lisp.SchemeLexer¶
+
+++ + + + + + + + +
Short names:scheme, scm
Filenames:*.scm, *.ss
MIME types:text/x-scheme, application/x-scheme
+

A Scheme lexer, parsing a stream and outputting the tokens +needed to highlight scheme code. +This lexer could be most probably easily subclassed to parse +other LISP-Dialects like Common Lisp, Emacs Lisp or AutoLisp.

+

This parser is checked with pastes from the LISP pastebin +at http://paste.lisp.org/ to cover as much syntax as possible.

+

It supports the full Scheme syntax as defined in R5RS.

+
+

New in version 0.6.

+
+
+ +
+
+class pygments.lexers.lisp.ShenLexer¶
+
+++ + + + + + + + +
Short names:shen
Filenames:*.shen
MIME types:text/x-shen, application/x-shen
+

Lexer for Shen source code.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.lisp.XtlangLexer¶
+
+++ + + + + + + + +
Short names:extempore
Filenames:*.xtm
MIME types:None
+

An xtlang lexer for the Extempore programming environment.

+

This is a mixture of Scheme and xtlang, really. Keyword lists are +taken from the Extempore Emacs mode +(https://github.com/extemporelang/extempore-emacs-mode)

+
+

New in version 2.2.

+
+
+ +
+
+

Lexers for Makefiles and similar¶

+
+
+class pygments.lexers.make.BaseMakefileLexer¶
+
+++ + + + + + + + +
Short names:basemake
Filenames:None
MIME types:None
+

Lexer for simple Makefiles (no preprocessing).

+
+

New in version 0.10.

+
+
+ +
+
+class pygments.lexers.make.CMakeLexer¶
+
+++ + + + + + + + +
Short names:cmake
Filenames:*.cmake, CMakeLists.txt
MIME types:text/x-cmake
+

Lexer for CMake files.

+
+

New in version 1.2.

+
+
+ +
+
+class pygments.lexers.make.MakefileLexer¶
+
+++ + + + + + + + +
Short names:make, makefile, mf, bsdmake
Filenames:*.mak, *.mk, Makefile, makefile, Makefile.*, GNUmakefile
MIME types:text/x-makefile
+

Lexer for BSD and GNU make extensions (lenient enough to handle both in +the same file even).

+

Rewritten in Pygments 0.10.

+
+ +
+
+

Lexers for non-HTML markup languages¶

+
+
+class pygments.lexers.markup.BBCodeLexer¶
+
+++ + + + + + + + +
Short names:bbcode
Filenames:None
MIME types:text/x-bbcode
+

A lexer that highlights BBCode(-like) syntax.

+
+

New in version 0.6.

+
+
+ +
+
+class pygments.lexers.markup.GroffLexer¶
+
+++ + + + + + + + +
Short names:groff, nroff, man
Filenames:*.[1234567], *.man
MIME types:application/x-troff, text/troff
+

Lexer for the (g)roff typesetting language, supporting groff +extensions. Mainly useful for highlighting manpage sources.

+
+

New in version 0.6.

+
+
+ +
+
+class pygments.lexers.markup.MarkdownLexer¶
+
+++ + + + + + + + +
Short names:md
Filenames:*.md
MIME types:text/x-markdown
+

For Markdown markup.

+
+

New in version 2.2.

+
+
+ +
+
+class pygments.lexers.markup.MoinWikiLexer¶
+
+++ + + + + + + + +
Short names:trac-wiki, moin
Filenames:None
MIME types:text/x-trac-wiki
+

For MoinMoin (and Trac) Wiki markup.

+
+

New in version 0.7.

+
+
+ +
+
+class pygments.lexers.markup.MozPreprocCssLexer¶
+
+++ + + + + + + + +
Short names:css+mozpreproc
Filenames:*.css.in
MIME types:None
+

Subclass of the MozPreprocHashLexer that highlights unlexed data with the +CssLexer.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.markup.MozPreprocHashLexer¶
+
+++ + + + + + + + +
Short names:mozhashpreproc
Filenames:None
MIME types:None
+

Lexer for Mozilla Preprocessor files (with ‘#’ as the marker).

+

Other data is left untouched.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.markup.MozPreprocJavascriptLexer¶
+
+++ + + + + + + + +
Short names:javascript+mozpreproc
Filenames:*.js.in
MIME types:None
+

Subclass of the MozPreprocHashLexer that highlights unlexed data with the +JavascriptLexer.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.markup.MozPreprocPercentLexer¶
+
+++ + + + + + + + +
Short names:mozpercentpreproc
Filenames:None
MIME types:None
+

Lexer for Mozilla Preprocessor files (with ‘%’ as the marker).

+

Other data is left untouched.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.markup.MozPreprocXulLexer¶
+
+++ + + + + + + + +
Short names:xul+mozpreproc
Filenames:*.xul.in
MIME types:None
+

Subclass of the MozPreprocHashLexer that highlights unlexed data with the +XmlLexer.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.markup.RstLexer¶
+
+++ + + + + + + + +
Short names:rst, rest, restructuredtext
Filenames:*.rst, *.rest
MIME types:text/x-rst, text/prs.fallenstein.rst
+

For reStructuredText markup.

+
+

New in version 0.7.

+
+

Additional options accepted:

+
+
handlecodeblocks
+

Highlight the contents of .. sourcecode:: language, +.. code:: language and .. code-block:: language +directives with a lexer for the given language (default: +True).

+
+

New in version 0.8.

+
+
+
+
+ +
+
+class pygments.lexers.markup.TexLexer¶
+
+++ + + + + + + + +
Short names:tex, latex
Filenames:*.tex, *.aux, *.toc
MIME types:text/x-tex, text/x-latex
+

Lexer for the TeX and LaTeX typesetting languages.

+
+ +
+ +
+

Lexers for ML family languages¶

+
+
+class pygments.lexers.ml.OcamlLexer¶
+
+++ + + + + + + + +
Short names:ocaml
Filenames:*.ml, *.mli, *.mll, *.mly
MIME types:text/x-ocaml
+

For the OCaml language.

+
+

New in version 0.7.

+
+
+ +
+
+class pygments.lexers.ml.OpaLexer¶
+
+++ + + + + + + + +
Short names:opa
Filenames:*.opa
MIME types:text/x-opa
+

Lexer for the Opa language (http://opalang.org).

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.ml.SMLLexer¶
+
+++ + + + + + + + +
Short names:sml
Filenames:*.sml, *.sig, *.fun
MIME types:text/x-standardml, application/x-standardml
+

For the Standard ML language.

+
+

New in version 1.5.

+
+
+ +
+
+

Lexers for modeling languages¶

+
+
+class pygments.lexers.modeling.BugsLexer¶
+
+++ + + + + + + + +
Short names:bugs, winbugs, openbugs
Filenames:*.bug
MIME types:None
+

Pygments Lexer for OpenBugs and WinBugs +models.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.modeling.JagsLexer¶
+
+++ + + + + + + + +
Short names:jags
Filenames:*.jag, *.bug
MIME types:None
+

Pygments Lexer for JAGS.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.modeling.ModelicaLexer¶
+
+++ + + + + + + + +
Short names:modelica
Filenames:*.mo
MIME types:text/x-modelica
+

For Modelica source code.

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.modeling.StanLexer¶
+
+++ + + + + + + + +
Short names:stan
Filenames:*.stan
MIME types:None
+

Pygments Lexer for Stan models.

+

The Stan modeling language is specified in the Stan Modeling Language +User’s Guide and Reference Manual, v2.8.0, +pdf.

+
+

New in version 1.6.

+
+
+ +
+
+

Multi-Dialect Lexer for Modula-2¶

+
+
+class pygments.lexers.modula2.Modula2Lexer¶
+
+++ + + + + + + + +
Short names:modula2, m2
Filenames:*.def, *.mod
MIME types:text/x-modula2
+

For Modula-2 source code.

+

The Modula-2 lexer supports several dialects. By default, it operates in +fallback mode, recognising the combined literals, punctuation symbols +and operators of all supported dialects, and the combined reserved words +and builtins of PIM Modula-2, ISO Modula-2 and Modula-2 R10, while not +differentiating between library defined identifiers.

+

To select a specific dialect, a dialect option may be passed +or a dialect tag may be embedded into a source file.

+

Dialect Options:

+
+
m2pim
+
Select PIM Modula-2 dialect.
+
m2iso
+
Select ISO Modula-2 dialect.
+
m2r10
+
Select Modula-2 R10 dialect.
+
objm2
+
Select Objective Modula-2 dialect.
+
+

The PIM and ISO dialect options may be qualified with a language extension.

+

Language Extensions:

+
+
+aglet
+
Select Aglet Modula-2 extensions, available with m2iso.
+
+gm2
+
Select GNU Modula-2 extensions, available with m2pim.
+
+p1
+
Select p1 Modula-2 extensions, available with m2iso.
+
+xds
+
Select XDS Modula-2 extensions, available with m2iso.
+
+

Passing a Dialect Option via Unix Commandline Interface

+

Dialect options may be passed to the lexer using the dialect key. +Only one such option should be passed. If multiple dialect options are +passed, the first valid option is used, any subsequent options are ignored.

+

Examples:

+
+
$ pygmentize -O full,dialect=m2iso -f html -o /path/to/output /path/to/input
+
Use ISO dialect to render input to HTML output
+
$ pygmentize -O full,dialect=m2iso+p1 -f rtf -o /path/to/output /path/to/input
+
Use ISO dialect with p1 extensions to render input to RTF output
+
+

Embedding a Dialect Option within a source file

+

A dialect option may be embedded in a source file in form of a dialect +tag, a specially formatted comment that specifies a dialect option.

+

Dialect Tag EBNF:

+
dialectTag :
+    OpeningCommentDelim Prefix dialectOption ClosingCommentDelim ;
+
+dialectOption :
+    'm2pim' | 'm2iso' | 'm2r10' | 'objm2' |
+    'm2iso+aglet' | 'm2pim+gm2' | 'm2iso+p1' | 'm2iso+xds' ;
+
+Prefix : '!' ;
+
+OpeningCommentDelim : '(*' ;
+
+ClosingCommentDelim : '*)' ;
+
+
+

No whitespace is permitted between the tokens of a dialect tag.

+

In the event that a source file contains multiple dialect tags, the first +tag that contains a valid dialect option will be used and any subsequent +dialect tags will be ignored. Ideally, a dialect tag should be placed +at the beginning of a source file.

+

An embedded dialect tag overrides a dialect option set via command line.

+

Examples:

+
+
(*!m2r10*) DEFINITION MODULE Foobar; ...
+
Use Modula2 R10 dialect to render this source file.
+
(*!m2pim+gm2*) DEFINITION MODULE Bazbam; ...
+
Use PIM dialect with GNU extensions to render this source file.
+
+

Algol Publication Mode:

+

In Algol publication mode, source text is rendered for publication of +algorithms in scientific papers and academic texts, following the format +of the Revised Algol-60 Language Report. It is activated by passing +one of two corresponding styles as an option:

+
+
algol
+
render reserved words lowercase underline boldface +and builtins lowercase boldface italic
+
algol_nu
+
render reserved words lowercase boldface (no underlining) +and builtins lowercase boldface italic
+
+

The lexer automatically performs the required lowercase conversion when +this mode is activated.

+

Example:

+
+
$ pygmentize -O full,style=algol -f latex -o /path/to/output /path/to/input
+
Render input file in Algol publication mode to LaTeX output.
+
+

Rendering Mode of First Class ADT Identifiers:

+

The rendering of standard library first class ADT identifiers is controlled +by option flag “treat_stdlib_adts_as_builtins”.

+

When this option is turned on, standard library ADT identifiers are rendered +as builtins. When it is turned off, they are rendered as ordinary library +identifiers.

+

treat_stdlib_adts_as_builtins (default: On)

+

The option is useful for dialects that support ADTs as first class objects +and provide ADTs in the standard library that would otherwise be built-in.

+

At present, only Modula-2 R10 supports library ADTs as first class objects +and therefore, no ADT identifiers are defined for any other dialects.

+

Example:

+
+
$ pygmentize -O full,dialect=m2r10,treat_stdlib_adts_as_builtins=Off ...
+
Render standard library ADTs as ordinary library types.
+
+
+

New in version 1.3.

+
+
+

Changed in version 2.1: Added multi-dialect support.

+
+
+ +
+
+

Lexer for the Monte programming language¶

+
+
+class pygments.lexers.monte.MonteLexer¶
+
+++ + + + + + + + +
Short names:monte
Filenames:*.mt
MIME types:None
+

Lexer for the Monte programming language.

+
+

New in version 2.2.

+
+
+ +
+
+

Lexers for NCAR Command Language¶

+
+
+class pygments.lexers.ncl.NCLLexer¶
+
+++ + + + + + + + +
Short names:ncl
Filenames:*.ncl
MIME types:text/ncl
+

Lexer for NCL code.

+
+

New in version 2.2.

+
+
+ +
+
+

Lexer for the Nim language (formerly known as Nimrod)¶

+
+
+class pygments.lexers.nimrod.NimrodLexer¶
+
+++ + + + + + + + +
Short names:nim, nimrod
Filenames:*.nim, *.nimrod
MIME types:text/x-nim
+

For Nim source code.

+
+

New in version 1.5.

+
+
+ +
+
+

Lexer for the Nit language¶

+
+
+class pygments.lexers.nit.NitLexer¶
+
+++ + + + + + + + +
Short names:nit
Filenames:*.nit
MIME types:None
+

For nit source.

+
+

New in version 2.0.

+
+
+ +
+
+

Lexers for the NixOS Nix language¶

+
+
+class pygments.lexers.nix.NixLexer¶
+
+++ + + + + + + + +
Short names:nixos, nix
Filenames:*.nix
MIME types:text/x-nix
+

For the Nix language.

+
+

New in version 2.0.

+
+
+ +
+
+

Lexers for Oberon family languages¶

+
+
+class pygments.lexers.oberon.ComponentPascalLexer¶
+
+++ + + + + + + + +
Short names:componentpascal, cp
Filenames:*.cp, *.cps
MIME types:text/x-component-pascal
+

For Component Pascal source code.

+
+

New in version 2.1.

+
+
+ +
+
+

Lexers for Objective-C family languages¶

+
+
+class pygments.lexers.objective.LogosLexer¶
+
+++ + + + + + + + +
Short names:logos
Filenames:*.x, *.xi, *.xm, *.xmi
MIME types:text/x-logos
+

For Logos + Objective-C source code with preprocessor directives.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.objective.ObjectiveCLexer¶
+
+++ + + + + + + + +
Short names:objective-c, objectivec, obj-c, objc
Filenames:*.m, *.h
MIME types:text/x-objective-c
+

For Objective-C source code with preprocessor directives.

+
+ +
+
+class pygments.lexers.objective.ObjectiveCppLexer¶
+
+++ + + + + + + + +
Short names:objective-c++, objectivec++, obj-c++, objc++
Filenames:*.mm, *.hh
MIME types:text/x-objective-c++
+

For Objective-C++ source code with preprocessor directives.

+
+ +
+
+class pygments.lexers.objective.SwiftLexer¶
+
+++ + + + + + + + +
Short names:swift
Filenames:*.swift
MIME types:text/x-swift
+

For Swift source.

+
+

New in version 2.0.

+
+
+ +
+
+

Lexers for the Ooc language¶

+
+
+class pygments.lexers.ooc.OocLexer¶
+
+++ + + + + + + + +
Short names:ooc
Filenames:*.ooc
MIME types:text/x-ooc
+

For Ooc source code

+
+

New in version 1.2.

+
+
+ +
+
+

Lexer for ParaSail¶

+
+
+class pygments.lexers.parasail.ParaSailLexer¶
+
+++ + + + + + + + +
Short names:parasail
Filenames:*.psi, *.psl
MIME types:text/x-parasail
+

For ParaSail source code.

+
+

New in version 2.1.

+
+
+ +
+
+

Lexers for parser generators¶

+
+
+class pygments.lexers.parsers.AntlrActionScriptLexer¶
+
+++ + + + + + + + +
Short names:antlr-as, antlr-actionscript
Filenames:*.G, *.g
MIME types:None
+

ANTLR with ActionScript Target

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.parsers.AntlrCSharpLexer¶
+
+++ + + + + + + + +
Short names:antlr-csharp, antlr-c#
Filenames:*.G, *.g
MIME types:None
+

ANTLR with C# Target

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.parsers.AntlrCppLexer¶
+
+++ + + + + + + + +
Short names:antlr-cpp
Filenames:*.G, *.g
MIME types:None
+

ANTLR with CPP Target

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.parsers.AntlrJavaLexer¶
+
+++ + + + + + + + +
Short names:antlr-java
Filenames:*.G, *.g
MIME types:None
+

ANTLR with Java Target

+
+

New in version 1..

+
+
+ +
+
+class pygments.lexers.parsers.AntlrLexer¶
+
+++ + + + + + + + +
Short names:antlr
Filenames:None
MIME types:None
+

Generic ANTLR Lexer. +Should not be called directly, instead +use DelegatingLexer for your target language.

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.parsers.AntlrObjectiveCLexer¶
+
+++ + + + + + + + +
Short names:antlr-objc
Filenames:*.G, *.g
MIME types:None
+

ANTLR with Objective-C Target

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.parsers.AntlrPerlLexer¶
+
+++ + + + + + + + +
Short names:antlr-perl
Filenames:*.G, *.g
MIME types:None
+

ANTLR with Perl Target

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.parsers.AntlrPythonLexer¶
+
+++ + + + + + + + +
Short names:antlr-python
Filenames:*.G, *.g
MIME types:None
+

ANTLR with Python Target

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.parsers.AntlrRubyLexer¶
+
+++ + + + + + + + +
Short names:antlr-ruby, antlr-rb
Filenames:*.G, *.g
MIME types:None
+

ANTLR with Ruby Target

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.parsers.EbnfLexer¶
+
+++ + + + + + + + +
Short names:ebnf
Filenames:*.ebnf
MIME types:text/x-ebnf
+

Lexer for ISO/IEC 14977 EBNF +grammars.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.parsers.RagelCLexer¶
+
+++ + + + + + + + +
Short names:ragel-c
Filenames:*.rl
MIME types:None
+

A lexer for Ragel in a C host file.

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.parsers.RagelCppLexer¶
+
+++ + + + + + + + +
Short names:ragel-cpp
Filenames:*.rl
MIME types:None
+

A lexer for Ragel in a CPP host file.

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.parsers.RagelDLexer¶
+
+++ + + + + + + + +
Short names:ragel-d
Filenames:*.rl
MIME types:None
+

A lexer for Ragel in a D host file.

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.parsers.RagelEmbeddedLexer¶
+
+++ + + + + + + + +
Short names:ragel-em
Filenames:*.rl
MIME types:None
+

A lexer for Ragel embedded in a host language file.

+

This will only highlight Ragel statements. If you want host language +highlighting then call the language-specific Ragel lexer.

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.parsers.RagelJavaLexer¶
+
+++ + + + + + + + +
Short names:ragel-java
Filenames:*.rl
MIME types:None
+

A lexer for Ragel in a Java host file.

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.parsers.RagelLexer¶
+
+++ + + + + + + + +
Short names:ragel
Filenames:None
MIME types:None
+

A pure Ragel lexer. Use this for +fragments of Ragel. For .rl files, use RagelEmbeddedLexer instead +(or one of the language-specific subclasses).

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.parsers.RagelObjectiveCLexer¶
+
+++ + + + + + + + +
Short names:ragel-objc
Filenames:*.rl
MIME types:None
+

A lexer for Ragel in an Objective C host file.

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.parsers.RagelRubyLexer¶
+
+++ + + + + + + + +
Short names:ragel-ruby, ragel-rb
Filenames:*.rl
MIME types:None
+

A lexer for Ragel in a Ruby host file.

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.parsers.TreetopLexer¶
+
+++ + + + + + + + +
Short names:treetop
Filenames:*.treetop, *.tt
MIME types:None
+

A lexer for Treetop grammars.

+
+

New in version 1.6.

+
+
+ +
+
+

Lexers for Pascal family languages¶

+
+
+class pygments.lexers.pascal.AdaLexer¶
+
+++ + + + + + + + +
Short names:ada, ada95, ada2005
Filenames:*.adb, *.ads, *.ada
MIME types:text/x-ada
+

For Ada source code.

+
+

New in version 1.3.

+
+
+ +
+
+class pygments.lexers.pascal.DelphiLexer¶
+
+++ + + + + + + + +
Short names:delphi, pas, pascal, objectpascal
Filenames:*.pas, *.dpr
MIME types:text/x-pascal
+

For Delphi (Borland Object Pascal), +Turbo Pascal and Free Pascal source code.

+

Additional options accepted:

+
+
turbopascal
+
Highlight Turbo Pascal specific keywords (default: True).
+
delphi
+
Highlight Borland Delphi specific keywords (default: True).
+
freepascal
+
Highlight Free Pascal specific keywords (default: True).
+
units
+
A list of units that should be considered builtin, supported are +System, SysUtils, Classes and Math. +Default is to consider all of them builtin.
+
+
+ +
+
+

Lexers for the Pawn languages¶

+
+
+class pygments.lexers.pawn.PawnLexer¶
+
+++ + + + + + + + +
Short names:pawn
Filenames:*.p, *.pwn, *.inc
MIME types:text/x-pawn
+

For Pawn source code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.pawn.SourcePawnLexer¶
+
+++ + + + + + + + +
Short names:sp
Filenames:*.sp
MIME types:text/x-sourcepawn
+

For SourcePawn source code with preprocessor directives.

+
+

New in version 1.6.

+
+
+ +
+ + +
+

Lexer for Praat¶

+
+
+class pygments.lexers.praat.PraatLexer¶
+
+++ + + + + + + + +
Short names:praat
Filenames:*.praat, *.proc, *.psc
MIME types:None
+

For Praat scripts.

+
+

New in version 2.1.

+
+
+ +
+
+

Lexers for Prolog and Prolog-like languages¶

+
+
+class pygments.lexers.prolog.LogtalkLexer¶
+
+++ + + + + + + + +
Short names:logtalk
Filenames:*.lgt, *.logtalk
MIME types:text/x-logtalk
+

For Logtalk source code.

+
+

New in version 0.10.

+
+
+ +
+
+class pygments.lexers.prolog.PrologLexer¶
+
+++ + + + + + + + +
Short names:prolog
Filenames:*.ecl, *.prolog, *.pro, *.pl
MIME types:text/x-prolog
+

Lexer for Prolog files.

+
+ +
+ +
+

Lexer for QVT Operational language¶

+
+
+class pygments.lexers.qvt.QVToLexer¶
+
+++ + + + + + + + +
Short names:qvto, qvt
Filenames:*.qvto
MIME types:None
+

For the QVT Operational Mapping language.

+

Reference for implementing this: «Meta Object Facility (MOF) 2.0 +Query/View/Transformation Specification», Version 1.1 - January 2011 +(http://www.omg.org/spec/QVT/1.1/), see §8.4, «Concrete Syntax» in +particular.

+

Notable tokens assignments:

+
    +
  • Name.Class is assigned to the identifier following any of the following +keywords: metamodel, class, exception, primitive, enum, transformation +or library
  • +
  • Name.Function is assigned to the names of mappings and queries
  • +
  • Name.Builtin.Pseudo is assigned to the pre-defined variables ‘this’, +‘self’ and ‘result’.
  • +
+
+ +
+
+

Lexers for the R/S languages¶

+
+
+class pygments.lexers.r.RConsoleLexer¶
+
+++ + + + + + + + +
Short names:rconsole, rout
Filenames:*.Rout
MIME types:None
+

For R console transcripts or R CMD BATCH output files.

+
+ +
+
+class pygments.lexers.r.RdLexer¶
+
+++ + + + + + + + +
Short names:rd
Filenames:*.Rd
MIME types:text/x-r-doc
+

Pygments Lexer for R documentation (Rd) files

+

This is a very minimal implementation, highlighting little more +than the macros. A description of Rd syntax is found in Writing R +Extensions +and Parsing Rd files.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.r.SLexer¶
+
+++ + + + + + + + +
Short names:splus, s, r
Filenames:*.S, *.R, .Rhistory, .Rprofile, .Renviron
MIME types:text/S-plus, text/S, text/x-r-source, text/x-r, text/x-R, text/x-r-history, text/x-r-profile
+

For S, S-plus, and R source code.

+
+

New in version 0.10.

+
+
+ +
+
+

Lexers for semantic web and RDF query languages and markup¶

+
+
+class pygments.lexers.rdf.SparqlLexer¶
+
+++ + + + + + + + +
Short names:sparql
Filenames:*.rq, *.sparql
MIME types:application/sparql-query
+

Lexer for SPARQL query language.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.rdf.TurtleLexer¶
+
+++ + + + + + + + +
Short names:turtle
Filenames:*.ttl
MIME types:text/turtle, application/x-turtle
+

Lexer for Turtle data language.

+
+

New in version 2.1.

+
+
+ +
+ +
+

Lexer for resource definition files¶

+
+
+class pygments.lexers.resource.ResourceLexer¶
+
+++ + + + + + + + +
Short names:resource, resourcebundle
Filenames:*.txt
MIME types:None
+

Lexer for ICU Resource bundles.

+
+

New in version 2.0.

+
+
+ +
+
+

Lexer for Relax-NG Compact syntax¶

+
+
+class pygments.lexers.rnc.RNCCompactLexer¶
+
+++ + + + + + + + +
Short names:rnc, rng-compact
Filenames:*.rnc
MIME types:None
+

For RelaxNG-compact syntax.

+
+

New in version 2.2.

+
+
+ +
+
+

Lexers for Roboconf DSL¶

+
+
+class pygments.lexers.roboconf.RoboconfGraphLexer¶
+
+++ + + + + + + + +
Short names:roboconf-graph
Filenames:*.graph
MIME types:None
+

Lexer for Roboconf graph files.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.roboconf.RoboconfInstancesLexer¶
+
+++ + + + + + + + +
Short names:roboconf-instances
Filenames:*.instances
MIME types:None
+

Lexer for Roboconf instances files.

+
+

New in version 2.1.

+
+
+ +
+
+

Lexer for Robot Framework¶

+
+
+class pygments.lexers.robotframework.RobotFrameworkLexer¶
+
+++ + + + + + + + +
Short names:robotframework
Filenames:*.txt, *.robot
MIME types:text/x-robotframework
+

For Robot Framework test data.

+

Supports both space and pipe separated plain text formats.

+
+

New in version 1.6.

+
+
+ +
+ +
+

Lexers for the Rust language¶

+
+
+class pygments.lexers.rust.RustLexer¶
+
+++ + + + + + + + +
Short names:rust, rs
Filenames:*.rs, *.rs.in
MIME types:text/rust
+

Lexer for the Rust programming language (version 1.10).

+
+

New in version 1.6.

+
+
+ +
+
+

Lexer for SAS¶

+
+
+class pygments.lexers.sas.SASLexer¶
+
+++ + + + + + + + +
Short names:sas
Filenames:*.SAS, *.sas
MIME types:text/x-sas, text/sas, application/x-sas
+

For SAS files.

+
+

New in version 2.2.

+
+
+ +
+
+

Lexer for scripting and embedded languages¶

+
+
+class pygments.lexers.scripting.AppleScriptLexer¶
+
+++ + + + + + + + +
Short names:applescript
Filenames:*.applescript
MIME types:None
+

For AppleScript source code, +including AppleScript Studio. +Contributed by Andreas Amann <aamann@mac.com>.

+
+

New in version 1.0.

+
+
+ +
+
+class pygments.lexers.scripting.ChaiscriptLexer¶
+
+++ + + + + + + + +
Short names:chai, chaiscript
Filenames:*.chai
MIME types:text/x-chaiscript, application/x-chaiscript
+

For ChaiScript source code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.scripting.EasytrieveLexer¶
+
+++ + + + + + + + +
Short names:easytrieve
Filenames:*.ezt, *.mac
MIME types:text/x-easytrieve
+

Easytrieve Plus is a programming language for extracting, filtering and +converting sequential data. Furthermore it can layout data for reports. +It is mainly used on mainframe platforms and can access several of the +mainframe’s native file formats. It is somewhat comparable to awk.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.scripting.HybrisLexer¶
+
+++ + + + + + + + +
Short names:hybris, hy
Filenames:*.hy, *.hyb
MIME types:text/x-hybris, application/x-hybris
+

For Hybris source code.

+
+

New in version 1.4.

+
+
+ +
+
+class pygments.lexers.scripting.JclLexer¶
+
+++ + + + + + + + +
Short names:jcl
Filenames:*.jcl
MIME types:text/x-jcl
+

Job Control Language (JCL) +is a scripting language used on mainframe platforms to instruct the system +on how to run a batch job or start a subsystem. It is somewhat +comparable to MS DOS batch and Unix shell scripts.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.scripting.LSLLexer¶
+
+++ + + + + + + + +
Short names:lsl
Filenames:*.lsl
MIME types:text/x-lsl
+

For Second Life’s Linden Scripting Language source code.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.scripting.LuaLexer¶
+
+++ + + + + + + + +
Short names:lua
Filenames:*.lua, *.wlua
MIME types:text/x-lua, application/x-lua
+

For Lua source code.

+

Additional options accepted:

+
+
func_name_highlighting
+
If given and True, highlight builtin function names +(default: True).
+
disabled_modules
+

If given, must be a list of module names whose function names +should not be highlighted. By default all modules are highlighted.

+

To get a list of allowed modules have a look into the +_lua_builtins module:

+
>>> from pygments.lexers._lua_builtins import MODULES
+>>> MODULES.keys()
+['string', 'coroutine', 'modules', 'io', 'basic', ...]
+
+
+
+
+
+ +
+
+class pygments.lexers.scripting.MOOCodeLexer¶
+
+++ + + + + + + + +
Short names:moocode, moo
Filenames:*.moo
MIME types:text/x-moocode
+

For MOOCode (the MOO scripting +language).

+
+

New in version 0.9.

+
+
+ +
+
+class pygments.lexers.scripting.MoonScriptLexer¶
+
+++ + + + + + + + +
Short names:moon, moonscript
Filenames:*.moon
MIME types:text/x-moonscript, application/x-moonscript
+

For MoonScript source code.

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.scripting.RexxLexer¶
+
+++ + + + + + + + +
Short names:rexx, arexx
Filenames:*.rexx, *.rex, *.rx, *.arexx
MIME types:text/x-rexx
+

Rexx is a scripting language available for +a wide range of different platforms with its roots found on mainframe +systems. It is popular for I/O- and data based tasks and can act as glue +language to bind different applications together.

+
+

New in version 2.0.

+
+
+ +
+
+

Lexers for various shells¶

+
+
+class pygments.lexers.shell.BashLexer¶
+
+++ + + + + + + + +
Short names:bash, sh, ksh, zsh, shell
Filenames:*.sh, *.ksh, *.bash, *.ebuild, *.eclass, *.exheres-0, *.exlib, *.zsh, .bashrc, bashrc, .bash\*, bash\*, zshrc, .zshrc, PKGBUILD
MIME types:application/x-sh, application/x-shellscript
+

Lexer for (ba|k|z|)sh shell scripts.

+
+

New in version 0.6.

+
+
+ +
+
+class pygments.lexers.shell.BashSessionLexer¶
+
+++ + + + + + + + +
Short names:console, shell-session
Filenames:*.sh-session, *.shell-session
MIME types:application/x-shell-session, application/x-sh-session
+

Lexer for simplistic shell sessions.

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.shell.BatchLexer¶
+
+++ + + + + + + + +
Short names:bat, batch, dosbatch, winbatch
Filenames:*.bat, *.cmd
MIME types:application/x-dos-batch
+

Lexer for the DOS/Windows Batch file format.

+
+

New in version 0.7.

+
+
+ +
+
+class pygments.lexers.shell.FishShellLexer¶
+
+++ + + + + + + + +
Short names:fish, fishshell
Filenames:*.fish, *.load
MIME types:application/x-fish
+

Lexer for Fish shell scripts.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.shell.MSDOSSessionLexer¶
+
+++ + + + + + + + +
Short names:doscon
Filenames:None
MIME types:None
+

Lexer for simplistic MSDOS sessions.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.shell.PowerShellLexer¶
+
+++ + + + + + + + +
Short names:powershell, posh, ps1, psm1
Filenames:*.ps1, *.psm1
MIME types:text/x-powershell
+

For Windows PowerShell code.

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.shell.PowerShellSessionLexer¶
+
+++ + + + + + + + +
Short names:ps1con
Filenames:None
MIME types:None
+

Lexer for simplistic Windows PowerShell sessions.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.shell.TcshLexer¶
+
+++ + + + + + + + +
Short names:tcsh, csh
Filenames:*.tcsh, *.csh
MIME types:application/x-csh
+

Lexer for tcsh scripts.

+
+

New in version 0.10.

+
+
+ +
+
+class pygments.lexers.shell.TcshSessionLexer¶
+
+++ + + + + + + + +
Short names:tcshcon
Filenames:None
MIME types:None
+

Lexer for Tcsh sessions.

+
+

New in version 2.1.

+
+
+ +
+ +
+

Lexers for the SMV languages¶

+
+
+class pygments.lexers.smv.NuSMVLexer¶
+
+++ + + + + + + + +
Short names:nusmv
Filenames:*.smv
MIME types:None
+

Lexer for the NuSMV language.

+
+

New in version 2.2.

+
+
+ +
+
+

Lexers for the SNOBOL language¶

+
+
+class pygments.lexers.snobol.SnobolLexer¶
+
+++ + + + + + + + +
Short names:snobol
Filenames:*.snobol
MIME types:text/x-snobol
+

Lexer for the SNOBOL4 programming language.

+

Recognizes the common ASCII equivalents of the original SNOBOL4 operators. +Does not require spaces around binary operators.

+
+

New in version 1.5.

+
+
+ +
+
+

Special lexers¶

+
+
+class pygments.lexers.special.RawTokenLexer¶
+
+++ + + + + + + + +
Short names:raw
Filenames:None
MIME types:application/x-pygments-tokens
+

Recreate a token stream formatted with the RawTokenFormatter. This +lexer raises exceptions during parsing if the token stream in the +file is malformed.

+

Additional options accepted:

+
+
compress
+
If set to "gz" or "bz2", decompress the token stream with +the given compression algorithm before lexing (default: "").
+
+
+ +
+
+class pygments.lexers.special.TextLexer¶
+
+++ + + + + + + + +
Short names:text
Filenames:*.txt
MIME types:text/plain
+

“Null” lexer, doesn’t highlight anything.

+
+ +
+ +
+

Lexer for Stata¶

+
+
+class pygments.lexers.stata.StataLexer¶
+
+++ + + + + + + + +
Short names:stata, do
Filenames:*.do, *.ado
MIME types:text/x-stata, text/stata, application/x-stata
+

For Stata do files.

+
+

New in version 2.2.

+
+
+ +
+
+

Lexer for SuperCollider¶

+
+
+class pygments.lexers.supercollider.SuperColliderLexer¶
+
+++ + + + + + + + +
Short names:sc, supercollider
Filenames:*.sc, *.scd
MIME types:application/supercollider, text/supercollider
+

For SuperCollider source code.

+
+

New in version 2.1.

+
+
+ +
+ +
+

Lexers for various template engines’ markup¶

+
+
+class pygments.lexers.templates.Angular2HtmlLexer¶
+
+++ + + + + + + + +
Short names:html+ng2
Filenames:*.ng2
MIME types:None
+

Subclass of the Angular2Lexer that highlights unlexed data with the +HtmlLexer.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.templates.Angular2Lexer¶
+
+++ + + + + + + + +
Short names:ng2
Filenames:None
MIME types:None
+

Generic +angular2 +template lexer.

+

Highlights only the Angular template tags (stuff between {{ and }} and +special attributes: ‘(event)=’, ‘[property]=’, ‘[(twoWayBinding)]=’). +Everything else is left for a delegating lexer.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.templates.CheetahHtmlLexer¶
+
+++ + + + + + + + +
Short names:html+cheetah, html+spitfire, htmlcheetah
Filenames:None
MIME types:text/html+cheetah, text/html+spitfire
+

Subclass of the CheetahLexer that highlights unlexed data +with the HtmlLexer.

+
+ +
+
+class pygments.lexers.templates.CheetahJavascriptLexer¶
+
+++ + + + + + + + +
Short names:js+cheetah, javascript+cheetah, js+spitfire, javascript+spitfire
Filenames:None
MIME types:application/x-javascript+cheetah, text/x-javascript+cheetah, text/javascript+cheetah, application/x-javascript+spitfire, text/x-javascript+spitfire, text/javascript+spitfire
+

Subclass of the CheetahLexer that highlights unlexed data +with the JavascriptLexer.

+
+ +
+
+class pygments.lexers.templates.CheetahLexer¶
+
+++ + + + + + + + +
Short names:cheetah, spitfire
Filenames:*.tmpl, *.spt
MIME types:application/x-cheetah, application/x-spitfire
+

Generic cheetah templates lexer. Code that isn’t Cheetah +markup is yielded as Token.Other. This also works for +spitfire templates which use the same syntax.

+
+ +
+
+class pygments.lexers.templates.CheetahXmlLexer¶
+
+++ + + + + + + + +
Short names:xml+cheetah, xml+spitfire
Filenames:None
MIME types:application/xml+cheetah, application/xml+spitfire
+

Subclass of the CheetahLexer that highlights unlexed data +with the XmlLexer.

+
+ +
+
+class pygments.lexers.templates.ColdfusionCFCLexer¶
+
+++ + + + + + + + +
Short names:cfc
Filenames:*.cfc
MIME types:None
+

Coldfusion markup/script components

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.templates.ColdfusionHtmlLexer¶
+
+++ + + + + + + + +
Short names:cfm
Filenames:*.cfm, *.cfml
MIME types:application/x-coldfusion
+

Coldfusion markup in html

+
+ +
+
+class pygments.lexers.templates.ColdfusionLexer¶
+
+++ + + + + + + + +
Short names:cfs
Filenames:None
MIME types:None
+

Coldfusion statements

+
+ +
+
+class pygments.lexers.templates.CssDjangoLexer¶
+
+++ + + + + + + + +
Short names:css+django, css+jinja
Filenames:None
MIME types:text/css+django, text/css+jinja
+

Subclass of the DjangoLexer that highlights unlexed data with the +CssLexer.

+
+ +
+
+class pygments.lexers.templates.CssErbLexer¶
+
+++ + + + + + + + +
Short names:css+erb, css+ruby
Filenames:None
MIME types:text/css+ruby
+

Subclass of ErbLexer which highlights unlexed data with the CssLexer.

+
+ +
+
+class pygments.lexers.templates.CssGenshiLexer¶
+
+++ + + + + + + + +
Short names:css+genshitext, css+genshi
Filenames:None
MIME types:text/css+genshi
+

A lexer that highlights CSS definitions in genshi text templates.

+
+ +
+
+class pygments.lexers.templates.CssPhpLexer¶
+
+++ + + + + + + + +
Short names:css+php
Filenames:None
MIME types:text/css+php
+

Subclass of PhpLexer which highlights unmatched data with the CssLexer.

+
+ +
+
+class pygments.lexers.templates.CssSmartyLexer¶
+
+++ + + + + + + + +
Short names:css+smarty
Filenames:None
MIME types:text/css+smarty
+

Subclass of the SmartyLexer that highlights unlexed data with the +CssLexer.

+
+ +
+
+class pygments.lexers.templates.DjangoLexer¶
+
+++ + + + + + + + +
Short names:django, jinja
Filenames:None
MIME types:application/x-django-templating, application/x-jinja
+

Generic django +and jinja template lexer.

+

It just highlights django/jinja code between the preprocessor directives, +other data is left untouched by the lexer.

+
+ +
+
+class pygments.lexers.templates.ErbLexer¶
+
+++ + + + + + + + +
Short names:erb
Filenames:None
MIME types:application/x-ruby-templating
+

Generic ERB (Ruby Templating) +lexer.

+

Just highlights ruby code between the preprocessor directives, other data +is left untouched by the lexer.

+

All options are also forwarded to the RubyLexer.

+
+ +
+
+class pygments.lexers.templates.EvoqueHtmlLexer¶
+
+++ + + + + + + + +
Short names:html+evoque
Filenames:*.html
MIME types:text/html+evoque
+

Subclass of the EvoqueLexer that highlights unlexed data with the +HtmlLexer.

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.templates.EvoqueLexer¶
+
+++ + + + + + + + +
Short names:evoque
Filenames:*.evoque
MIME types:application/x-evoque
+

For files using the Evoque templating system.

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.templates.EvoqueXmlLexer¶
+
+++ + + + + + + + +
Short names:xml+evoque
Filenames:*.xml
MIME types:application/xml+evoque
+

Subclass of the EvoqueLexer that highlights unlexed data with the +XmlLexer.

+
+

New in version 1.1.

+
+
+ +
+
+class pygments.lexers.templates.GenshiLexer¶
+
+++ + + + + + + + +
Short names:genshi, kid, xml+genshi, xml+kid
Filenames:*.kid
MIME types:application/x-genshi, application/x-kid
+

A lexer that highlights genshi and +kid kid XML templates.

+
+ +
+
+class pygments.lexers.templates.GenshiTextLexer¶
+
+++ + + + + + + + +
Short names:genshitext
Filenames:None
MIME types:application/x-genshi-text, text/x-genshi
+

A lexer that highlights genshi text +templates.

+
+ +
+
+class pygments.lexers.templates.HandlebarsHtmlLexer¶
+
+++ + + + + + + + +
Short names:html+handlebars
Filenames:*.handlebars, *.hbs
MIME types:text/html+handlebars, text/x-handlebars-template
+

Subclass of the HandlebarsLexer that highlights unlexed data with the +HtmlLexer.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.templates.HandlebarsLexer¶
+
+++ + + + + + + + +
Short names:handlebars
Filenames:None
MIME types:None
+

Generic handlebars <http://handlebarsjs.com/> template lexer.

+

Highlights only the Handlebars template tags (stuff between {{ and }}). +Everything else is left for a delegating lexer.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.templates.HtmlDjangoLexer¶
+
+++ + + + + + + + +
Short names:html+django, html+jinja, htmldjango
Filenames:None
MIME types:text/html+django, text/html+jinja
+

Subclass of the DjangoLexer that highlights unlexed data with the +HtmlLexer.

+

Nested Javascript and CSS is highlighted too.

+
+ +
+
+class pygments.lexers.templates.HtmlGenshiLexer¶
+
+++ + + + + + + + +
Short names:html+genshi, html+kid
Filenames:None
MIME types:text/html+genshi
+

A lexer that highlights genshi and +kid kid HTML templates.

+
+ +
+
+class pygments.lexers.templates.HtmlPhpLexer¶
+
+++ + + + + + + + +
Short names:html+php
Filenames:*.phtml
MIME types:application/x-php, application/x-httpd-php, application/x-httpd-php3, application/x-httpd-php4, application/x-httpd-php5
+

Subclass of PhpLexer that highlights unhandled data with the HtmlLexer.

+

Nested Javascript and CSS is highlighted too.

+
+ +
+
+class pygments.lexers.templates.HtmlSmartyLexer¶
+
+++ + + + + + + + +
Short names:html+smarty
Filenames:None
MIME types:text/html+smarty
+

Subclass of the SmartyLexer that highlights unlexed data with the +HtmlLexer.

+

Nested Javascript and CSS is highlighted too.

+
+ +
+
+class pygments.lexers.templates.JavascriptDjangoLexer¶
+
+++ + + + + + + + +
Short names:js+django, javascript+django, js+jinja, javascript+jinja
Filenames:None
MIME types:application/x-javascript+django, application/x-javascript+jinja, text/x-javascript+django, text/x-javascript+jinja, text/javascript+django, text/javascript+jinja
+

Subclass of the DjangoLexer that highlights unlexed data with the +JavascriptLexer.

+
+ +
+
+class pygments.lexers.templates.JavascriptErbLexer¶
+
+++ + + + + + + + +
Short names:js+erb, javascript+erb, js+ruby, javascript+ruby
Filenames:None
MIME types:application/x-javascript+ruby, text/x-javascript+ruby, text/javascript+ruby
+

Subclass of ErbLexer which highlights unlexed data with the +JavascriptLexer.

+
+ +
+
+class pygments.lexers.templates.JavascriptGenshiLexer¶
+
+++ + + + + + + + +
Short names:js+genshitext, js+genshi, javascript+genshitext, javascript+genshi
Filenames:None
MIME types:application/x-javascript+genshi, text/x-javascript+genshi, text/javascript+genshi
+

A lexer that highlights javascript code in genshi text templates.

+
+ +
+
+class pygments.lexers.templates.JavascriptPhpLexer¶
+
+++ + + + + + + + +
Short names:js+php, javascript+php
Filenames:None
MIME types:application/x-javascript+php, text/x-javascript+php, text/javascript+php
+

Subclass of PhpLexer which highlights unmatched data with the +JavascriptLexer.

+
+ +
+
+class pygments.lexers.templates.JavascriptSmartyLexer¶
+
+++ + + + + + + + +
Short names:js+smarty, javascript+smarty
Filenames:None
MIME types:application/x-javascript+smarty, text/x-javascript+smarty, text/javascript+smarty
+

Subclass of the SmartyLexer that highlights unlexed data with the +JavascriptLexer.

+
+ +
+
+class pygments.lexers.templates.JspLexer¶
+
+++ + + + + + + + +
Short names:jsp
Filenames:*.jsp
MIME types:application/x-jsp
+

Lexer for Java Server Pages.

+
+

New in version 0.7.

+
+
+ +
+
+class pygments.lexers.templates.LassoCssLexer¶
+
+++ + + + + + + + +
Short names:css+lasso
Filenames:None
MIME types:text/css+lasso
+

Subclass of the LassoLexer which highlights unhandled data with the +CssLexer.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.templates.LassoHtmlLexer¶
+
+++ + + + + + + + +
Short names:html+lasso
Filenames:None
MIME types:text/html+lasso, application/x-httpd-lasso, application/x-httpd-lasso[89]
+

Subclass of the LassoLexer which highlights unhandled data with the +HtmlLexer.

+

Nested JavaScript and CSS is also highlighted.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.templates.LassoJavascriptLexer¶
+
+++ + + + + + + + +
Short names:js+lasso, javascript+lasso
Filenames:None
MIME types:application/x-javascript+lasso, text/x-javascript+lasso, text/javascript+lasso
+

Subclass of the LassoLexer which highlights unhandled data with the +JavascriptLexer.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.templates.LassoXmlLexer¶
+
+++ + + + + + + + +
Short names:xml+lasso
Filenames:None
MIME types:application/xml+lasso
+

Subclass of the LassoLexer which highlights unhandled data with the +XmlLexer.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.templates.LiquidLexer¶
+
+++ + + + + + + + +
Short names:liquid
Filenames:*.liquid
MIME types:None
+

Lexer for Liquid templates.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.templates.MakoCssLexer¶
+
+++ + + + + + + + +
Short names:css+mako
Filenames:None
MIME types:text/css+mako
+

Subclass of the MakoLexer that highlights unlexed data +with the CssLexer.

+
+

New in version 0.7.

+
+
+ +
+
+class pygments.lexers.templates.MakoHtmlLexer¶
+
+++ + + + + + + + +
Short names:html+mako
Filenames:None
MIME types:text/html+mako
+

Subclass of the MakoLexer that highlights unlexed data +with the HtmlLexer.

+
+

New in version 0.7.

+
+
+ +
+
+class pygments.lexers.templates.MakoJavascriptLexer¶
+
+++ + + + + + + + +
Short names:js+mako, javascript+mako
Filenames:None
MIME types:application/x-javascript+mako, text/x-javascript+mako, text/javascript+mako
+

Subclass of the MakoLexer that highlights unlexed data +with the JavascriptLexer.

+
+

New in version 0.7.

+
+
+ +
+
+class pygments.lexers.templates.MakoLexer¶
+
+++ + + + + + + + +
Short names:mako
Filenames:*.mao
MIME types:application/x-mako
+

Generic mako templates lexer. Code that isn’t Mako +markup is yielded as Token.Other.

+
+

New in version 0.7.

+
+
+ +
+
+class pygments.lexers.templates.MakoXmlLexer¶
+
+++ + + + + + + + +
Short names:xml+mako
Filenames:None
MIME types:application/xml+mako
+

Subclass of the MakoLexer that highlights unlexed data +with the XmlLexer.

+
+

New in version 0.7.

+
+
+ +
+
+class pygments.lexers.templates.MasonLexer¶
+
+++ + + + + + + + +
Short names:mason
Filenames:*.m, *.mhtml, *.mc, *.mi, autohandler, dhandler
MIME types:application/x-mason
+

Generic mason templates lexer. Stolen from Myghty lexer. Code that isn’t +Mason markup is HTML.

+
+

New in version 1.4.

+
+
+ +
+
+class pygments.lexers.templates.MyghtyCssLexer¶
+
+++ + + + + + + + +
Short names:css+myghty
Filenames:None
MIME types:text/css+myghty
+

Subclass of the MyghtyLexer that highlights unlexed data +with the CssLexer.

+
+

New in version 0.6.

+
+
+ +
+
+class pygments.lexers.templates.MyghtyHtmlLexer¶
+
+++ + + + + + + + +
Short names:html+myghty
Filenames:None
MIME types:text/html+myghty
+

Subclass of the MyghtyLexer that highlights unlexed data +with the HtmlLexer.

+
+

New in version 0.6.

+
+
+ +
+
+class pygments.lexers.templates.MyghtyJavascriptLexer¶
+
+++ + + + + + + + +
Short names:js+myghty, javascript+myghty
Filenames:None
MIME types:application/x-javascript+myghty, text/x-javascript+myghty, text/javascript+mygthy
+

Subclass of the MyghtyLexer that highlights unlexed data +with the JavascriptLexer.

+
+

New in version 0.6.

+
+
+ +
+
+class pygments.lexers.templates.MyghtyLexer¶
+
+++ + + + + + + + +
Short names:myghty
Filenames:*.myt, autodelegate
MIME types:application/x-myghty
+

Generic myghty templates lexer. Code that isn’t Myghty +markup is yielded as Token.Other.

+
+

New in version 0.6.

+
+
+ +
+
+class pygments.lexers.templates.MyghtyXmlLexer¶
+
+++ + + + + + + + +
Short names:xml+myghty
Filenames:None
MIME types:application/xml+myghty
+

Subclass of the MyghtyLexer that highlights unlexed data +with the XmlLexer.

+
+

New in version 0.6.

+
+
+ +
+
+class pygments.lexers.templates.RhtmlLexer¶
+
+++ + + + + + + + +
Short names:rhtml, html+erb, html+ruby
Filenames:*.rhtml
MIME types:text/html+ruby
+

Subclass of the ERB lexer that highlights the unlexed data with the +html lexer.

+

Nested Javascript and CSS is highlighted too.

+
+ +
+
+class pygments.lexers.templates.SmartyLexer¶
+
+++ + + + + + + + +
Short names:smarty
Filenames:*.tpl
MIME types:application/x-smarty
+

Generic Smarty template lexer.

+

Just highlights smarty code between the preprocessor directives, other +data is left untouched by the lexer.

+
+ +
+
+class pygments.lexers.templates.SspLexer¶
+
+++ + + + + + + + +
Short names:ssp
Filenames:*.ssp
MIME types:application/x-ssp
+

Lexer for Scalate Server Pages.

+
+

New in version 1.4.

+
+
+ +
+
+class pygments.lexers.templates.TeaTemplateLexer¶
+
+++ + + + + + + + +
Short names:tea
Filenames:*.tea
MIME types:text/x-tea
+

Lexer for Tea Templates.

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.templates.TwigHtmlLexer¶
+
+++ + + + + + + + +
Short names:html+twig
Filenames:*.twig
MIME types:text/html+twig
+

Subclass of the TwigLexer that highlights unlexed data with the +HtmlLexer.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.templates.TwigLexer¶
+
+++ + + + + + + + +
Short names:twig
Filenames:None
MIME types:application/x-twig
+

Twig template lexer.

+

It just highlights Twig code between the preprocessor directives, +other data is left untouched by the lexer.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.templates.VelocityHtmlLexer¶
+
+++ + + + + + + + +
Short names:html+velocity
Filenames:None
MIME types:text/html+velocity
+

Subclass of the VelocityLexer that highlights unlexed data +with the HtmlLexer.

+
+ +
+
+class pygments.lexers.templates.VelocityLexer¶
+
+++ + + + + + + + +
Short names:velocity
Filenames:*.vm, *.fhtml
MIME types:None
+

Generic Velocity template lexer.

+

Just highlights velocity directives and variable references, other +data is left untouched by the lexer.

+
+ +
+
+class pygments.lexers.templates.VelocityXmlLexer¶
+
+++ + + + + + + + +
Short names:xml+velocity
Filenames:None
MIME types:application/xml+velocity
+

Subclass of the VelocityLexer that highlights unlexed data +with the XmlLexer.

+
+ +
+
+class pygments.lexers.templates.XmlDjangoLexer¶
+
+++ + + + + + + + +
Short names:xml+django, xml+jinja
Filenames:None
MIME types:application/xml+django, application/xml+jinja
+

Subclass of the DjangoLexer that highlights unlexed data with the +XmlLexer.

+
+ +
+
+class pygments.lexers.templates.XmlErbLexer¶
+
+++ + + + + + + + +
Short names:xml+erb, xml+ruby
Filenames:None
MIME types:application/xml+ruby
+

Subclass of ErbLexer which highlights data outside preprocessor +directives with the XmlLexer.

+
+ +
+
+class pygments.lexers.templates.XmlPhpLexer¶
+
+++ + + + + + + + +
Short names:xml+php
Filenames:None
MIME types:application/xml+php
+

Subclass of PhpLexer that highlights unhandled data with the XmlLexer.

+
+ +
+
+class pygments.lexers.templates.XmlSmartyLexer¶
+
+++ + + + + + + + +
Short names:xml+smarty
Filenames:None
MIME types:application/xml+smarty
+

Subclass of the SmartyLexer that highlights unlexed data with the +XmlLexer.

+
+ +
+
+class pygments.lexers.templates.YamlJinjaLexer¶
+
+++ + + + + + + + +
Short names:yaml+jinja, salt, sls
Filenames:*.sls
MIME types:text/x-yaml+jinja, text/x-sls
+

Subclass of the DjangoLexer that highlights unlexed data with the +YamlLexer.

+

Commonly used in Saltstack salt states.

+
+

New in version 2.0.

+
+
+ +
+
+

Lexers for testing languages¶

+
+
+class pygments.lexers.testing.GherkinLexer¶
+
+++ + + + + + + + +
Short names:cucumber, gherkin
Filenames:*.feature
MIME types:text/x-gherkin
+

For Gherkin <http://github.com/aslakhellesoy/gherkin/> syntax.

+
+

New in version 1.2.

+
+
+ +
+
+class pygments.lexers.testing.TAPLexer¶
+
+++ + + + + + + + +
Short names:tap
Filenames:*.tap
MIME types:None
+

For Test Anything Protocol (TAP) output.

+
+

New in version 2.1.

+
+
+ +
+ +
+

Lexers for various text formats¶

+
+
+class pygments.lexers.textfmts.GettextLexer¶
+
+++ + + + + + + + +
Short names:pot, po
Filenames:*.pot, *.po
MIME types:application/x-gettext, text/x-gettext, text/gettext
+

Lexer for Gettext catalog files.

+
+

New in version 0.9.

+
+
+ +
+
+class pygments.lexers.textfmts.HttpLexer¶
+
+++ + + + + + + + +
Short names:http
Filenames:None
MIME types:None
+

Lexer for HTTP sessions.

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.textfmts.IrcLogsLexer¶
+
+++ + + + + + + + +
Short names:irc
Filenames:*.weechatlog
MIME types:text/x-irclog
+

Lexer for IRC logs in irssi, xchat or weechat style.

+
+ +
+
+class pygments.lexers.textfmts.TodotxtLexer¶
+
+++ + + + + + + + +
Short names:todotxt
Filenames:todo.txt, *.todotxt
MIME types:text/x-todo
+

Lexer for Todo.txt todo list format.

+
+

New in version 2.0.

+
+
+ +
+
+

Lexers for theorem-proving languages¶

+
+
+class pygments.lexers.theorem.CoqLexer¶
+
+++ + + + + + + + +
Short names:coq
Filenames:*.v
MIME types:text/x-coq
+

For the Coq theorem prover.

+
+

New in version 1.5.

+
+
+ +
+
+class pygments.lexers.theorem.IsabelleLexer¶
+
+++ + + + + + + + +
Short names:isabelle
Filenames:*.thy
MIME types:text/x-isabelle
+

For the Isabelle proof assistant.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.theorem.LeanLexer¶
+
+++ + + + + + + + +
Short names:lean
Filenames:*.lean
MIME types:text/x-lean
+

For the Lean +theorem prover.

+
+

New in version 2.0.

+
+
+ +
+
+

Lexer for RiverBed’s TrafficScript (RTS) language¶

+
+
+class pygments.lexers.trafficscript.RtsLexer¶
+
+++ + + + + + + + +
Short names:rts, trafficscript
Filenames:*.rts
MIME types:None
+

For Riverbed Stingray Traffic Manager

+
+

New in version 2.1.

+
+
+ +
+
+

Lexers for TypoScript¶

+
+
+class pygments.lexers.typoscript.TypoScriptCssDataLexer¶
+
+++ + + + + + + + +
Short names:typoscriptcssdata
Filenames:None
MIME types:None
+

Lexer that highlights markers, constants and registers within css blocks.

+
+

New in version 2.2.

+
+
+ +
+
+class pygments.lexers.typoscript.TypoScriptHtmlDataLexer¶
+
+++ + + + + + + + +
Short names:typoscripthtmldata
Filenames:None
MIME types:None
+

Lexer that highlights markers, constants and registers within html tags.

+
+

New in version 2.2.

+
+
+ +
+
+class pygments.lexers.typoscript.TypoScriptLexer¶
+
+++ + + + + + + + +
Short names:typoscript
Filenames:*.ts, *.txt
MIME types:text/x-typoscript
+

Lexer for TypoScript code.

+

http://docs.typo3.org/typo3cms/TyposcriptReference/

+
+

New in version 2.2.

+
+
+ +
+
+

Lexers for UrbiScript language¶

+
+
+class pygments.lexers.urbi.UrbiscriptLexer¶
+
+++ + + + + + + + +
Short names:urbiscript
Filenames:*.u
MIME types:application/x-urbiscript
+

For UrbiScript source code.

+
+

New in version 1.5.

+
+
+ +
+
+

Lexers for Varnish configuration¶

+
+
+class pygments.lexers.varnish.VCLLexer¶
+
+++ + + + + + + + +
Short names:vcl
Filenames:*.vcl
MIME types:text/x-vclsrc
+

For Varnish Configuration Language (VCL).

+
+

New in version 2.2.

+
+
+ +
+
+class pygments.lexers.varnish.VCLSnippetLexer¶
+
+++ + + + + + + + +
Short names:vclsnippets, vclsnippet
Filenames:None
MIME types:text/x-vclsnippet
+

For Varnish Configuration Language snippets.

+
+

New in version 2.2.

+
+
+ +
+
+

Lexer for Intermediate Verification Languages (IVLs)¶

+
+
+class pygments.lexers.verification.BoogieLexer¶
+
+++ + + + + + + + +
Short names:boogie
Filenames:*.bpl
MIME types:None
+

For Boogie source code.

+
+

New in version 2.1.

+
+
+ +
+
+class pygments.lexers.verification.SilverLexer¶
+
+++ + + + + + + + +
Short names:silver
Filenames:*.sil, *.vpr
MIME types:None
+

For Silver source code.

+
+

New in version 2.2.

+
+
+ +
+
+

Lexers for misc. web stuff¶

+
+
+class pygments.lexers.webmisc.CirruLexer¶
+
+++ + + + + + + + +
Short names:cirru
Filenames:*.cirru
MIME types:text/x-cirru
+

Syntax rules of Cirru can be found at: +http://cirru.org/

+
    +
  • using () for expressions, but restricted in a same line
  • +
  • using "" for strings, with \ for escaping chars
  • +
  • using $ as folding operator
  • +
  • using , as unfolding operator
  • +
  • using indentations for nested blocks
  • +
+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.webmisc.DuelLexer¶
+
+++ + + + + + + + +
Short names:duel, jbst, jsonml+bst
Filenames:*.duel, *.jbst
MIME types:text/x-duel, text/x-jbst
+

Lexer for Duel Views Engine (formerly JBST) markup with JavaScript code blocks. +See http://duelengine.org/. +See http://jsonml.org/jbst/.

+
+

New in version 1.4.

+
+
+ +
+
+class pygments.lexers.webmisc.QmlLexer¶
+
+++ + + + + + + + +
Short names:qml, qbs
Filenames:*.qml, *.qbs
MIME types:application/x-qml, application/x-qt.qbs+qml
+

For QML files. See http://doc.qt.digia.com/4.7/qdeclarativeintroduction.html.

+
+

New in version 1.6.

+
+
+ +
+
+class pygments.lexers.webmisc.SlimLexer¶
+
+++ + + + + + + + +
Short names:slim
Filenames:*.slim
MIME types:text/x-slim
+

For Slim markup.

+
+

New in version 2.0.

+
+
+ +
+
+class pygments.lexers.webmisc.XQueryLexer¶
+
+++ + + + + + + + +
Short names:xquery, xqy, xq, xql, xqm
Filenames:*.xqy, *.xquery, *.xq, *.xql, *.xqm
MIME types:text/xquery, application/xquery
+

An XQuery lexer, parsing a stream and outputting the tokens needed to +highlight xquery code.

+
+

New in version 1.4.

+
+
+ +
+
+

Lexers for the Whiley language¶

+
+
+class pygments.lexers.whiley.WhileyLexer¶
+
+++ + + + + + + + +
Short names:whiley
Filenames:*.whiley
MIME types:text/x-whiley
+

Lexer for the Whiley programming language.

+
+

New in version 2.2.

+
+
+ +
+
+

Lexers for the X10 programming language¶

+
+
+class pygments.lexers.x10.X10Lexer¶
+
+++ + + + + + + + +
Short names:x10, xten
Filenames:*.x10
MIME types:text/x-x10
+

For the X10 language.

+
+

New in version 0.1.

+
+
+ +
+
+

Lexers for Xorg configs¶

+
+
+class pygments.lexers.xorg.XorgLexer¶
+
+++ + + + + + + + +
Short names:xorg.conf
Filenames:xorg.conf
MIME types:None
+

Lexer for xorg.conf file.

+
+ +
+
+

Iterating over all lexers¶

+
+

New in version 0.6.

+
+

To get all lexers (both the builtin and the plugin ones), you can +use the get_all_lexers() function from the pygments.lexers +module:

+
>>> from pygments.lexers import get_all_lexers
+>>> i = get_all_lexers()
+>>> i.next()
+('Diff', ('diff',), ('*.diff', '*.patch'), ('text/x-diff', 'text/x-patch'))
+>>> i.next()
+('Delphi', ('delphi', 'objectpascal', 'pas', 'pascal'), ('*.pas',), ('text/x-pascal',))
+>>> i.next()
+('XML+Ruby', ('xml+erb', 'xml+ruby'), (), ())
+
+
+

As you can see, the return value is an iterator which yields tuples +in the form (name, aliases, filetypes, mimetypes).

+
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/moinmoin.html b/doc/_build/html/docs/moinmoin.html new file mode 100644 index 0000000..c2a2ad1 --- /dev/null +++ b/doc/_build/html/docs/moinmoin.html @@ -0,0 +1,148 @@ + + + + + + + + Using Pygments with MoinMoin — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Using Pygments with MoinMoin¶

+

From Pygments 0.7, the source distribution ships a Moin parser plugin that +can be used to get Pygments highlighting in Moin wiki pages.

+

To use it, copy the file external/moin-parser.py from the Pygments +distribution to the data/plugin/parser subdirectory of your Moin instance. +Edit the options at the top of the file (currently ATTACHMENTS and +INLINESTYLES) and rename the file to the name that the parser directive +should have. For example, if you name the file code.py, you can get a +highlighted Python code sample with this Wiki markup:

+
{{{
+#!code python
+[...]
+}}}
+
+
+

where python is the Pygments name of the lexer to use.

+

Additionally, if you set the ATTACHMENTS option to True, Pygments will also +be called for all attachments for whose filenames there is no other parser +registered.

+

You are responsible for including CSS rules that will map the Pygments CSS +classes to colors. You can output a stylesheet file with pygmentize, put it +into the htdocs directory of your Moin instance and then include it in the +stylesheets configuration option in the Moin config, e.g.:

+
stylesheets = [('screen', '/htdocs/pygments.css')]
+
+
+

If you do not want to do that and are willing to accept larger HTML output, you +can set the INLINESTYLES option to True.

+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/plugins.html b/doc/_build/html/docs/plugins.html new file mode 100644 index 0000000..6faab8c --- /dev/null +++ b/doc/_build/html/docs/plugins.html @@ -0,0 +1,200 @@ + + + + + + + + Register Plugins — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Register Plugins¶

+

If you want to extend Pygments without hacking the sources, but want to +use the lexer/formatter/style/filter lookup functions (lexers.get_lexer_by_name +et al.), you can use setuptools entrypoints to add new lexers, formatters +or styles as if they were in the Pygments core.

+

That means you can use your highlighter modules with the pygmentize script, +which relies on the mentioned functions.

+
+

Entrypoints¶

+

Here is a list of setuptools entrypoints that Pygments understands:

+

pygments.lexers

+
+

This entrypoint is used for adding new lexers to the Pygments core. +The name of the entrypoint values doesn’t really matter, Pygments extracts +required metadata from the class definition:

+
[pygments.lexers]
+yourlexer = yourmodule:YourLexer
+
+
+

Note that you have to define name, aliases and filename +attributes so that you can use the highlighter from the command line:

+
class YourLexer(...):
+    name = 'Name Of Your Lexer'
+    aliases = ['alias']
+    filenames = ['*.ext']
+
+
+
+

pygments.formatters

+
+

You can use this entrypoint to add new formatters to Pygments. The +name of an entrypoint item is the name of the formatter. If you +prefix the name with a slash it’s used as a filename pattern:

+
[pygments.formatters]
+yourformatter = yourmodule:YourFormatter
+/.ext = yourmodule:YourFormatter
+
+
+
+

pygments.styles

+
+

To add a new style you can use this entrypoint. The name of the entrypoint +is the name of the style:

+
[pygments.styles]
+yourstyle = yourmodule:YourStyle
+
+
+
+

pygments.filters

+
+

Use this entrypoint to register a new filter. The name of the +entrypoint is the name of the filter:

+
[pygments.filters]
+yourfilter = yourmodule:YourFilter
+
+
+
+
+
+

How To Use Entrypoints¶

+

This documentation doesn’t explain how to use those entrypoints because this is +covered in the setuptools documentation. That page should cover everything +you need to write a plugin.

+
+
+

Extending The Core¶

+

If you have written a Pygments plugin that is open source, please inform us +about that. There is a high chance that we’ll add it to the Pygments +distribution.

+
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/quickstart.html b/doc/_build/html/docs/quickstart.html new file mode 100644 index 0000000..229a241 --- /dev/null +++ b/doc/_build/html/docs/quickstart.html @@ -0,0 +1,296 @@ + + + + + + + + Introduction and Quickstart — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Introduction and Quickstart¶

+

Welcome to Pygments! This document explains the basic concepts and terms and +gives a few examples of how to use the library.

+
+

Architecture¶

+

There are four types of components that work together highlighting a piece of +code:

+
    +
  • A lexer splits the source into tokens, fragments of the source that +have a token type that determines what the text represents semantically +(e.g., keyword, string, or comment). There is a lexer for every language +or markup format that Pygments supports.
  • +
  • The token stream can be piped through filters, which usually modify +the token types or text fragments, e.g. uppercasing all keywords.
  • +
  • A formatter then takes the token stream and writes it to an output +file, in a format such as HTML, LaTeX or RTF.
  • +
  • While writing the output, a style determines how to highlight all the +different token types. It maps them to attributes like “red and bold”.
  • +
+
+
+

Example¶

+

Here is a small example for highlighting Python code:

+
from pygments import highlight
+from pygments.lexers import PythonLexer
+from pygments.formatters import HtmlFormatter
+
+code = 'print "Hello World"'
+print(highlight(code, PythonLexer(), HtmlFormatter()))
+
+
+

which prints something like this:

+
<div class="highlight">
+<pre><span class="k">print</span> <span class="s">&quot;Hello World&quot;</span></pre>
+</div>
+
+
+

As you can see, Pygments uses CSS classes (by default, but you can change that) +instead of inline styles in order to avoid outputting redundant style information over +and over. A CSS stylesheet that contains all CSS classes possibly used in the output +can be produced by:

+
print(HtmlFormatter().get_style_defs('.highlight'))
+
+
+

The argument to get_style_defs() is used as an additional CSS selector: +the output may look like this:

+
.highlight .k { color: #AA22FF; font-weight: bold }
+.highlight .s { color: #BB4444 }
+...
+
+
+
+
+

Options¶

+

The highlight() function supports a fourth argument called outfile, it +must be a file object if given. The formatted output will then be written to +this file instead of being returned as a string.

+

Lexers and formatters both support options. They are given to them as keyword +arguments either to the class or to the lookup method:

+
from pygments import highlight
+from pygments.lexers import get_lexer_by_name
+from pygments.formatters import HtmlFormatter
+
+lexer = get_lexer_by_name("python", stripall=True)
+formatter = HtmlFormatter(linenos=True, cssclass="source")
+result = highlight(code, lexer, formatter)
+
+
+

This makes the lexer strip all leading and trailing whitespace from the input +(stripall option), lets the formatter output line numbers (linenos option), +and sets the wrapping <div>’s class to source (instead of +highlight).

+

Important options include:

+
+
encoding : for lexers and formatters
+
Since Pygments uses Unicode strings internally, this determines which +encoding will be used to convert to or from byte strings.
+
style : for formatters
+
The name of the style to use when writing the output.
+
+

For an overview of builtin lexers and formatters and their options, visit the +lexer and formatters lists.

+

For a documentation on filters, see this page.

+
+
+

Lexer and formatter lookup¶

+

If you want to lookup a built-in lexer by its alias or a filename, you can use +one of the following methods:

+
>>> from pygments.lexers import (get_lexer_by_name,
+...     get_lexer_for_filename, get_lexer_for_mimetype)
+
+>>> get_lexer_by_name('python')
+<pygments.lexers.PythonLexer>
+
+>>> get_lexer_for_filename('spam.rb')
+<pygments.lexers.RubyLexer>
+
+>>> get_lexer_for_mimetype('text/x-perl')
+<pygments.lexers.PerlLexer>
+
+
+

All these functions accept keyword arguments; they will be passed to the lexer +as options.

+

A similar API is available for formatters: use get_formatter_by_name() +and get_formatter_for_filename() from the pygments.formatters +module for this purpose.

+
+
+

Guessing lexers¶

+

If you don’t know the content of the file, or you want to highlight a file +whose extension is ambiguous, such as .html (which could contain plain HTML +or some template tags), use these functions:

+
>>> from pygments.lexers import guess_lexer, guess_lexer_for_filename
+
+>>> guess_lexer('#!/usr/bin/python\nprint "Hello World!"')
+<pygments.lexers.PythonLexer>
+
+>>> guess_lexer_for_filename('test.py', 'print "Hello World!"')
+<pygments.lexers.PythonLexer>
+
+
+

guess_lexer() passes the given content to the lexer classes’ +analyse_text() method and returns the one for which it returns the +highest number.

+

All lexers have two different filename pattern lists: the primary and the +secondary one. The get_lexer_for_filename() function only uses the +primary list, whose entries are supposed to be unique among all lexers. +guess_lexer_for_filename(), however, will first loop through all lexers +and look at the primary and secondary filename patterns if the filename matches. +If only one lexer matches, it is returned, else the guessing mechanism of +guess_lexer() is used with the matching lexers.

+

As usual, keyword arguments to these functions are given to the created lexer +as options.

+
+
+

Command line usage¶

+

You can use Pygments from the command line, using the pygmentize +script:

+
$ pygmentize test.py
+
+
+

will highlight the Python file test.py using ANSI escape sequences +(a.k.a. terminal colors) and print the result to standard output.

+

To output HTML, use the -f option:

+
$ pygmentize -f html -o test.html test.py
+
+
+

to write an HTML-highlighted version of test.py to the file test.html. +Note that it will only be a snippet of HTML, if you want a full HTML document, +use the “full” option:

+
$ pygmentize -f html -O full -o test.html test.py
+
+
+

This will produce a full HTML document with included stylesheet.

+

A style can be selected with -O style=<name>.

+

If you need a stylesheet for an existing HTML file using Pygments CSS classes, +it can be created with:

+
$ pygmentize -S default -f html > style.css
+
+
+

where default is the style name.

+

More options and tricks and be found in the command line reference.

+
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/rstdirective.html b/doc/_build/html/docs/rstdirective.html new file mode 100644 index 0000000..c7bcd66 --- /dev/null +++ b/doc/_build/html/docs/rstdirective.html @@ -0,0 +1,128 @@ + + + + + + + + Using Pygments in ReST documents — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Using Pygments in ReST documents¶

+

Many Python people use ReST for documentation their sourcecode, programs, +scripts et cetera. This also means that documentation often includes sourcecode +samples or snippets.

+

You can easily enable Pygments support for your ReST texts using a custom +directive – this is also how this documentation displays source code.

+

From Pygments 0.9, the directive is shipped in the distribution as +external/rst-directive.py. You can copy and adapt this code to your liking.

+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/styles.html b/doc/_build/html/docs/styles.html new file mode 100644 index 0000000..8caaa22 --- /dev/null +++ b/doc/_build/html/docs/styles.html @@ -0,0 +1,299 @@ + + + + + + + + Styles — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Styles¶

+

Pygments comes with some builtin styles that work for both the HTML and +LaTeX formatter.

+

The builtin styles can be looked up with the get_style_by_name function:

+
>>> from pygments.styles import get_style_by_name
+>>> get_style_by_name('colorful')
+<class 'pygments.styles.colorful.ColorfulStyle'>
+
+
+

You can pass a instance of a Style class to a formatter as the style +option in form of a string:

+
>>> from pygments.styles import get_style_by_name
+>>> from pygments.formatters import HtmlFormatter
+>>> HtmlFormatter(style='colorful').style
+<class 'pygments.styles.colorful.ColorfulStyle'>
+
+
+

Or you can also import your own style (which must be a subclass of +pygments.style.Style) and pass it to the formatter:

+
>>> from yourapp.yourmodule import YourStyle
+>>> from pygments.formatters import HtmlFormatter
+>>> HtmlFormatter(style=YourStyle).style
+<class 'yourapp.yourmodule.YourStyle'>
+
+
+
+

Creating Own Styles¶

+

So, how to create a style? All you have to do is to subclass Style and +define some styles:

+
from pygments.style import Style
+from pygments.token import Keyword, Name, Comment, String, Error, \
+     Number, Operator, Generic
+
+class YourStyle(Style):
+    default_style = ""
+    styles = {
+        Comment:                'italic #888',
+        Keyword:                'bold #005',
+        Name:                   '#f00',
+        Name.Function:          '#0f0',
+        Name.Class:             'bold #0f0',
+        String:                 'bg:#eee #111'
+    }
+
+
+

That’s it. There are just a few rules. When you define a style for Name +the style automatically also affects Name.Function and so on. If you +defined 'bold' and you don’t want boldface for a subtoken use 'nobold'.

+

(Philosophy: the styles aren’t written in CSS syntax since this way +they can be used for a variety of formatters.)

+

default_style is the style inherited by all token types.

+

To make the style usable for Pygments, you must

+
    +
  • either register it as a plugin (see the plugin docs)
  • +
  • or drop it into the styles subpackage of your Pygments distribution one style +class per style, where the file name is the style name and the class name is +StylenameClass. For example, if your style should be called +"mondrian", name the class MondrianStyle, put it into the file +mondrian.py and this file into the pygments.styles subpackage +directory.
  • +
+
+
+

Style Rules¶

+

Here a small overview of all allowed styles:

+
+
bold
+
render text as bold
+
nobold
+
don’t render text as bold (to prevent subtokens being highlighted bold)
+
italic
+
render text italic
+
noitalic
+
don’t render text as italic
+
underline
+
render text underlined
+
nounderline
+
don’t render text underlined
+
bg:
+
transparent background
+
bg:#000000
+
background color (black)
+
border:
+
no border
+
border:#ffffff
+
border color (white)
+
#ff0000
+
text color (red)
+
noinherit
+
don’t inherit styles from supertoken
+
+

Note that there may not be a space between bg: and the color value +since the style definition string is split at whitespace. +Also, using named colors is not allowed since the supported color names +vary for different formatters.

+

Furthermore, not all lexers might support every style.

+
+
+

Builtin Styles¶

+

Pygments ships some builtin styles which are maintained by the Pygments team.

+

To get a list of known styles you can use this snippet:

+
>>> from pygments.styles import STYLE_MAP
+>>> STYLE_MAP.keys()
+['default', 'emacs', 'friendly', 'colorful']
+
+
+
+
+

Getting a list of available styles¶

+
+

New in version 0.6.

+
+

Because it could be that a plugin registered a style, there is +a way to iterate over all styles:

+
>>> from pygments.styles import get_all_styles
+>>> styles = list(get_all_styles())
+
+
+
+
+

Terminal Styles¶

+
+

New in version 2.2.

+
+

Custom styles used with the 256-color terminal formatter can also map colors to +use the 8 default ANSI colors. To do so, use #ansigreen, #ansired or +any other colors defined in pygments.style.ansicolors. Foreground ANSI +colors will be mapped to the corresponding escape codes 30 to 37 thus respecting any +custom color mapping and themes provided by many terminal emulators. Light +variants are treated as foreground color with and an added bold flag. +bg:#ansi<color> will also be respected, except the light variant will be the +same shade as their dark variant.

+

See the following example where the color of the string "hello world" is +governed by the escape sequence \x1b[34;01m (Ansi Blue, Bold, 41 being red +background) instead of an extended foreground & background color.

+
>>> from pygments import highlight
+>>> from pygments.style import Style
+>>> from pygments.token import Token
+>>> from pygments.lexers import Python3Lexer
+>>> from pygments.formatters import Terminal256Formatter
+
+>>> class MyStyle(Style):
+        styles = {
+            Token.String:     '#ansiblue bg:#ansired',
+        }
+
+>>> code = 'print("Hello World")'
+>>> result = highlight(code, Python3Lexer(), Terminal256Formatter(style=MyStyle))
+>>> print(result.encode())
+b'\x1b[34;41;01m"\x1b[39;49;00m\x1b[34;41;01mHello World\x1b[39;49;00m\x1b[34;41;01m"\x1b[39;49;00m'
+
+
+

Colors specified using #ansi* are converted to a default set of RGB colors +when used with formatters other than the terminal-256 formatter.

+

By definition of ANSI, the following colors are considered “light” colors, and +will be rendered by most terminals as bold:

+
    +
  • “darkgray”, “red”, “green”, “yellow”, “blue”, “fuchsia”, “turquoise”, “white”
  • +
+

The following are considered “dark” colors and will be rendered as non-bold:

+
    +
  • “black”, “darkred”, “darkgreen”, “brown”, “darkblue”, “purple”, “teal”, +“lightgray”
  • +
+

Exact behavior might depends on the terminal emulator you are using, and its +settings.

+
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/tokens.html b/doc/_build/html/docs/tokens.html new file mode 100644 index 0000000..142a934 --- /dev/null +++ b/doc/_build/html/docs/tokens.html @@ -0,0 +1,464 @@ + + + + + + + + Builtin Tokens — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Builtin Tokens¶

+

In the pygments.token module, there is a special object called Token +that is used to create token types.

+

You can create a new token type by accessing an attribute of Token:

+
>>> from pygments.token import Token
+>>> Token.String
+Token.String
+>>> Token.String is Token.String
+True
+
+
+

Note that tokens are singletons so you can use the is operator for comparing +token types.

+

As of Pygments 0.7 you can also use the in operator to perform set tests:

+
>>> from pygments.token import Comment
+>>> Comment.Single in Comment
+True
+>>> Comment in Comment.Multi
+False
+
+
+

This can be useful in filters and if you write lexers on your +own without using the base lexers.

+

You can also split a token type into a hierarchy, and get the parent of it:

+
>>> String.split()
+[Token, Token.Literal, Token.Literal.String]
+>>> String.parent
+Token.Literal
+
+
+

In principle, you can create an unlimited number of token types but nobody can +guarantee that a style would define style rules for a token type. Because of +that, Pygments proposes some global token types defined in the +pygments.token.STANDARD_TYPES dict.

+

For some tokens aliases are already defined:

+
>>> from pygments.token import String
+>>> String
+Token.Literal.String
+
+
+

Inside the pygments.token module the following aliases are defined:

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TextToken.Textfor any type of text data
WhitespaceToken.Text.Whitespacefor specially highlighted whitespace
ErrorToken.Errorrepresents lexer errors
OtherToken.Otherspecial token for data not +matched by a parser (e.g. HTML +markup in PHP code)
KeywordToken.Keywordany kind of keywords
NameToken.Namevariable/function names
LiteralToken.LiteralAny literals
StringToken.Literal.Stringstring literals
NumberToken.Literal.Numbernumber literals
OperatorToken.Operatoroperators (+, not…)
PunctuationToken.Punctuationpunctuation ([, (…)
CommentToken.Commentany kind of comments
GenericToken.Genericgeneric tokens (have a look at +the explanation below)
+

The Whitespace token type is new in Pygments 0.8. It is used only by the +VisibleWhitespaceFilter currently.

+

Normally you just create token types using the already defined aliases. For each +of those token aliases, a number of subtypes exists (excluding the special tokens +Token.Text, Token.Error and Token.Other)

+

The is_token_subtype() function in the pygments.token module can be used to +test if a token type is a subtype of another (such as Name.Tag and Name). +(This is the same as Name.Tag in Name. The overloaded in operator was newly +introduced in Pygments 0.7, the function still exists for backwards +compatibility.)

+

With Pygments 0.7, it’s also possible to convert strings to token types (for example +if you want to supply a token from the command line):

+
>>> from pygments.token import String, string_to_tokentype
+>>> string_to_tokentype("String")
+Token.Literal.String
+>>> string_to_tokentype("Token.Literal.String")
+Token.Literal.String
+>>> string_to_tokentype(String)
+Token.Literal.String
+
+
+
+

Keyword Tokens¶

+
+
Keyword
+
For any kind of keyword (especially if it doesn’t match any of the +subtypes of course).
+
Keyword.Constant
+
For keywords that are constants (e.g. None in future Python versions).
+
Keyword.Declaration
+
For keywords used for variable declaration (e.g. var in some programming +languages like JavaScript).
+
Keyword.Namespace
+
For keywords used for namespace declarations (e.g. import in Python and +Java and package in Java).
+
Keyword.Pseudo
+
For keywords that aren’t really keywords (e.g. None in old Python +versions).
+
Keyword.Reserved
+
For reserved keywords.
+
Keyword.Type
+
For builtin types that can’t be used as identifiers (e.g. int, +char etc. in C).
+
+
+
+

Name Tokens¶

+
+
Name
+
For any name (variable names, function names, classes).
+
Name.Attribute
+
For all attributes (e.g. in HTML tags).
+
Name.Builtin
+
Builtin names; names that are available in the global namespace.
+
Name.Builtin.Pseudo
+
Builtin names that are implicit (e.g. self in Ruby, this in Java).
+
Name.Class
+
Class names. Because no lexer can know if a name is a class or a function +or something else this token is meant for class declarations.
+
Name.Constant
+
Token type for constants. In some languages you can recognise a token by the +way it’s defined (the value after a const keyword for example). In +other languages constants are uppercase by definition (Ruby).
+
Name.Decorator
+
Token type for decorators. Decorators are syntactic elements in the Python +language. Similar syntax elements exist in C# and Java.
+
Name.Entity
+
Token type for special entities. (e.g. &nbsp; in HTML).
+
Name.Exception
+
Token type for exception names (e.g. RuntimeError in Python). Some languages +define exceptions in the function signature (Java). You can highlight +the name of that exception using this token then.
+
Name.Function
+
Token type for function names.
+
Name.Function.Magic
+
same as Name.Function but for special function names that have an implicit use +in a language (e.g. __init__ method in Python).
+
Name.Label
+
Token type for label names (e.g. in languages that support goto).
+
Name.Namespace
+
Token type for namespaces. (e.g. import paths in Java/Python), names following +the module/namespace keyword in other languages.
+
Name.Other
+
Other names. Normally unused.
+
Name.Tag
+
Tag names (in HTML/XML markup or configuration files).
+
Name.Variable
+
Token type for variables. Some languages have prefixes for variable names +(PHP, Ruby, Perl). You can highlight them using this token.
+
Name.Variable.Class
+
same as Name.Variable but for class variables (also static variables).
+
Name.Variable.Global
+
same as Name.Variable but for global variables (used in Ruby, for +example).
+
Name.Variable.Instance
+
same as Name.Variable but for instance variables.
+
Name.Variable.Magic
+
same as Name.Variable but for special variable names that have an implicit use +in a language (e.g. __doc__ in Python).
+
+
+
+

Literals¶

+
+
Literal
+
For any literal (if not further defined).
+
Literal.Date
+
for date literals (e.g. 42d in Boo).
+
String
+
For any string literal.
+
String.Affix
+
Token type for affixes that further specify the type of the string they’re +attached to (e.g. the prefixes r and u8 in r"foo" and u8"foo").
+
String.Backtick
+
Token type for strings enclosed in backticks.
+
String.Char
+
Token type for single characters (e.g. Java, C).
+
String.Delimiter
+
Token type for delimiting identifiers in “heredoc”, raw and other similar +strings (e.g. the word END in Perl code print <<'END';).
+
String.Doc
+
Token type for documentation strings (for example Python).
+
String.Double
+
Double quoted strings.
+
String.Escape
+
Token type for escape sequences in strings.
+
String.Heredoc
+
Token type for “heredoc” strings (e.g. in Ruby or Perl).
+
String.Interpol
+
Token type for interpolated parts in strings (e.g. #{foo} in Ruby).
+
String.Other
+
Token type for any other strings (for example %q{foo} string constructs +in Ruby).
+
String.Regex
+
Token type for regular expression literals (e.g. /foo/ in JavaScript).
+
String.Single
+
Token type for single quoted strings.
+
String.Symbol
+
Token type for symbols (e.g. :foo in LISP or Ruby).
+
Number
+
Token type for any number literal.
+
Number.Bin
+
Token type for binary literals (e.g. 0b101010).
+
Number.Float
+
Token type for float literals (e.g. 42.0).
+
Number.Hex
+
Token type for hexadecimal number literals (e.g. 0xdeadbeef).
+
Number.Integer
+
Token type for integer literals (e.g. 42).
+
Number.Integer.Long
+
Token type for long integer literals (e.g. 42L in Python).
+
Number.Oct
+
Token type for octal literals.
+
+
+
+

Operators¶

+
+
Operator
+
For any punctuation operator (e.g. +, -).
+
Operator.Word
+
For any operator that is a word (e.g. not).
+
+
+
+

Punctuation¶

+
+

New in version 0.7.

+
+
+
Punctuation
+
For any punctuation which is not an operator (e.g. [, (…)
+
+
+
+

Comments¶

+
+
Comment
+
Token type for any comment.
+
Comment.Hashbang
+
+
Token type for hashbang comments (i.e. first lines of files that start with
+
#!).
+
+
+
Comment.Multiline
+
Token type for multiline comments.
+
Comment.Preproc
+
Token type for preprocessor comments (also <?php/<% constructs).
+
Comment.Single
+
Token type for comments that end at the end of a line (e.g. # foo).
+
Comment.Special
+
Special data in comments. For example code tags, author and license +information, etc.
+
+
+
+

Generic Tokens¶

+

Generic tokens are for special lexers like the DiffLexer that doesn’t really +highlight a programming language but a patch file.

+
+
Generic
+
A generic, unstyled token. Normally you don’t use this token type.
+
Generic.Deleted
+
Marks the token value as deleted.
+
Generic.Emph
+
Marks the token value as emphasized.
+
Generic.Error
+
Marks the token value as an error message.
+
Generic.Heading
+
Marks the token value as headline.
+
Generic.Inserted
+
Marks the token value as inserted.
+
Generic.Output
+
Marks the token value as program output (e.g. for python cli lexer).
+
Generic.Prompt
+
Marks the token value as command prompt (e.g. bash lexer).
+
Generic.Strong
+
Marks the token value as bold (e.g. for rst lexer).
+
Generic.Subheading
+
Marks the token value as subheadline.
+
Generic.Traceback
+
Marks the token value as a part of an error traceback.
+
+
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/docs/unicode.html b/doc/_build/html/docs/unicode.html new file mode 100644 index 0000000..f4f4c16 --- /dev/null +++ b/doc/_build/html/docs/unicode.html @@ -0,0 +1,164 @@ + + + + + + + + Unicode and Encodings — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Unicode and Encodings¶

+

Since Pygments 0.6, all lexers use unicode strings internally. Because of that +you might encounter the occasional UnicodeDecodeError if you pass strings +with the wrong encoding.

+

Per default all lexers have their input encoding set to guess. This means +that the following encodings are tried:

+
    +
  • UTF-8 (including BOM handling)
  • +
  • The locale encoding (i.e. the result of locale.getpreferredencoding())
  • +
  • As a last resort, latin1
  • +
+

If you pass a lexer a byte string object (not unicode), it tries to decode the +data using this encoding.

+

You can override the encoding using the encoding or inencoding lexer +options. If you have the chardet library installed and set the encoding to +chardet if will analyse the text and use the encoding it thinks is the +right one automatically:

+
from pygments.lexers import PythonLexer
+lexer = PythonLexer(encoding='chardet')
+
+
+

The best way is to pass Pygments unicode objects. In that case you can’t get +unexpected output.

+

The formatters now send Unicode objects to the stream if you don’t set the +output encoding. You can do so by passing the formatters an encoding option:

+
from pygments.formatters import HtmlFormatter
+f = HtmlFormatter(encoding='utf-8')
+
+
+

You will have to set this option if you have non-ASCII characters in the +source and the output stream does not accept Unicode written to it! +This is the case for all regular files and for terminals.

+

Note: The Terminal formatter tries to be smart: if its output stream has an +encoding attribute, and you haven’t set the option, it will encode any +Unicode string with this encoding before writing it. This is the case for +sys.stdout, for example. The other formatters don’t have that behavior.

+

Another note: If you call Pygments via the command line (pygmentize), +encoding is handled differently, see the command line docs.

+
+

New in version 0.7: The formatters now also accept an outencoding option which will override +the encoding option if given. This makes it possible to use a single +options dict with lexers and formatters, and still have different input and +output encodings.

+
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/download.html b/doc/_build/html/download.html new file mode 100644 index 0000000..31c5bd8 --- /dev/null +++ b/doc/_build/html/download.html @@ -0,0 +1,160 @@ + + + + + + + + Download and installation — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Download and installation¶

+

The current release is version 2.3.0.

+
+

Packaged versions¶

+

You can download it from the Python Package Index. For installation of packages from +PyPI, we recommend Pip, which works on all +major platforms.

+

Under Linux, most distributions include a package for Pygments, usually called +pygments or python-pygments. You can install it with the package +manager as usual.

+
+
+

Development sources¶

+

We’re using the Mercurial version control +system. You can get the development source using this command:

+
hg clone http://bitbucket.org/birkenfeld/pygments-main pygments
+
+
+

Development takes place at Bitbucket, you can browse the source +online here.

+

The latest changes in the development source code are listed in the changelog.

+
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/faq.html b/doc/_build/html/faq.html new file mode 100644 index 0000000..e7f9333 --- /dev/null +++ b/doc/_build/html/faq.html @@ -0,0 +1,254 @@ + + + + + + + + Pygments FAQ — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Pygments FAQ¶

+
+

What is Pygments?¶

+

Pygments is a syntax highlighting engine written in Python. That means, it will +take source code (or other markup) in a supported language and output a +processed version (in different formats) containing syntax highlighting markup.

+

Its features include:

+
    +
  • a wide range of common languages and markup formats is supported
  • +
  • new languages and formats are added easily
  • +
  • a number of output formats is available, including:
      +
    • HTML
    • +
    • ANSI sequences (console output)
    • +
    • LaTeX
    • +
    • RTF
    • +
    +
  • +
  • it is usable as a command-line tool and as a library
  • +
  • parsing and formatting is fast
  • +
+

Pygments is licensed under the BSD license.

+
+
+

Where does the name Pygments come from?¶

+

Py of course stands for Python, while pigments are used for coloring paint, +and in this case, source code!

+
+
+

What are the system requirements?¶

+

Pygments only needs a standard Python install, version 2.7 or higher or version +3.5 or higher for Python 3. No additional libraries are needed.

+
+
+

How can I use Pygments?¶

+

Pygments is usable as a command-line tool as well as a library.

+

From the command-line, usage looks like this (assuming the pygmentize script is +properly installed):

+
pygmentize -f html /path/to/file.py
+
+
+

This will print a HTML-highlighted version of /path/to/file.py to standard output.

+

For a complete help, please run pygmentize -h.

+

Usage as a library is thoroughly demonstrated in the Documentation section.

+
+
+

How do I make a new style?¶

+

Please see the documentation on styles.

+
+
+

How can I report a bug or suggest a feature?¶

+

Please report bugs and feature wishes in the tracker at Bitbucket.

+

You can also e-mail the author or use IRC, see the contact details.

+
+
+

I want this support for this language!¶

+

Instead of waiting for others to include language support, why not write it +yourself? All you have to know is outlined in the docs.

+
+
+

Can I use Pygments for programming language processing?¶

+

The Pygments lexing machinery is quite powerful can be used to build lexers for +basically all languages. However, parsing them is not possible, though some +lexers go some steps in this direction in order to e.g. highlight function names +differently.

+

Also, error reporting is not the scope of Pygments. It focuses on correctly +highlighting syntactically valid documents, not finding and compensating errors.

+
+
+

Who uses Pygments?¶

+

This is an (incomplete) list of projects and sites known to use the Pygments highlighter.

+
    +
  • Wikipedia
  • +
  • BitBucket, a Mercurial and Git hosting site
  • +
  • The Sphinx documentation builder, for embedded source examples
  • +
  • rst2pdf, a reStructuredText to PDF converter
  • +
  • Codecov, a code coverage CI service
  • +
  • Trac, the universal project management tool
  • +
  • AsciiDoc, a text-based documentation generator
  • +
  • ActiveState Code, the Python Cookbook successor
  • +
  • ViewVC, a web-based version control repository browser
  • +
  • BzrFruit, a Bazaar branch viewer
  • +
  • QBzr, a cross-platform Qt-based GUI front end for Bazaar
  • +
  • Review Board, a collaborative code reviewing tool
  • +
  • Diamanda, a Django powered wiki system with support for Pygments
  • +
  • Progopedia (English), +an encyclopedia of programming languages
  • +
  • Bruce, a reStructuredText presentation tool
  • +
  • PIDA, a universal IDE written in Python
  • +
  • BPython, a curses-based intelligent Python shell
  • +
  • PuDB, a console Python debugger
  • +
  • XWiki, a wiki-based development framework in Java, using Jython
  • +
  • roux, a script for running R scripts +and creating beautiful output including graphs
  • +
  • hurl, a web service for making HTTP requests
  • +
  • wxHTMLPygmentizer is +a GUI utility, used to make code-colorization easier
  • +
  • Postmarkup, a BBCode to XHTML generator
  • +
  • WpPygments, and WPygments, highlighter plugins for WordPress
  • +
  • Siafoo, a tool for sharing and storing useful code and programming experience
  • +
  • D source, a community for the D programming language
  • +
  • dpaste.com, another Django pastebin
  • +
  • Django snippets, a pastebin for Django code
  • +
  • Fayaa, a Chinese pastebin
  • +
  • Incollo.com, a free collaborative debugging tool
  • +
  • PasteBox, a pastebin focused on privacy
  • +
  • hilite.me, a site to highlight code snippets
  • +
  • patx.me, a pastebin
  • +
  • Fluidic, an experiment in +integrating shells with a GUI
  • +
  • pygments.rb, a pygments wrapper for Ruby
  • +
  • Clygments, a pygments wrapper for +Clojure
  • +
  • PHPygments, a pygments wrapper for PHP
  • +
+

If you have a project or web site using Pygments, drop me a line, and I’ll add a +link here.

+
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/genindex.html b/doc/_build/html/genindex.html new file mode 100644 index 0000000..249e802 --- /dev/null +++ b/doc/_build/html/genindex.html @@ -0,0 +1,1603 @@ + + + + + + + + + Index — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ + +

Index

+ +
+ A + | B + | C + | D + | E + | F + | G + | H + | I + | J + | K + | L + | M + | N + | O + | P + | Q + | R + | S + | T + | U + | V + | W + | X + | Y + | Z + +
+

A

+ + + +
+ +

B

+ + + +
+ +

C

+ + + +
+ +

D

+ + + +
+ +

E

+ + + +
+ +

F

+ + + +
+ +

G

+ + + +
+ +

H

+ + + +
+ +

I

+ + + +
+ +

J

+ + + +
+ +

K

+ + + +
+ +

L

+ + + +
+ +

M

+ + + +
+ +

N

+ + + +
+ +

O

+ + + +
+ +

P

+ + + +
+ +

Q

+ + + +
+ +

R

+ + + +
+ +

S

+ + + +
+ +

T

+ + + +
+ +

U

+ + +
+ +

V

+ + + +
+ +

W

+ + + +
+ +

X

+ + + +
+ +

Y

+ + + +
+ +

Z

+ + +
+ + + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/index.html b/doc/_build/html/index.html new file mode 100644 index 0000000..f3f6c11 --- /dev/null +++ b/doc/_build/html/index.html @@ -0,0 +1,184 @@ + + + + + + + + Welcome! — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Welcome!¶

+

This is the home of Pygments. It is a generic syntax highlighter suitable for +use in code hosting, forums, wikis or other applications that need to prettify +source code. Highlights are:

+
    +
  • a wide range of over 300 languages and other text formats is supported
  • +
  • special attention is paid to details that increase highlighting quality
  • +
  • support for new languages and formats are added easily; most languages use a +simple regex-based lexing mechanism
  • +
  • a number of output formats is available, among them HTML, RTF, LaTeX and ANSI +sequences
  • +
  • it is usable as a command-line tool and as a library
  • +
  • … and it highlights even Perl 6!
  • +
+

Read more in the FAQ list or the documentation, +or download the latest release.

+
+

Contribute¶

+

Like every open-source project, we are always looking for volunteers to help us +with programming. Python knowledge is required, but don’t fear: Python is a very +clear and easy to learn language.

+

Development takes place on Bitbucket, where the Mercurial +repository, tickets and pull requests can be viewed.

+

Our primary communication instrument is the IRC channel #pocoo on the +Freenode network. To join it, let your IRC client connect to +irc.freenode.net and do /join #pocoo.

+

If you found a bug, just open a ticket in the Bitbucket tracker. Be sure to log +in to be notified when the issue is fixed – development is not fast-paced as +the library is quite stable. You can also send an e-mail to the developers, see +below.

+
+
+

The authors¶

+

Pygments is maintained by Georg Brandl, e-mail address georg@python.org.

+

Many lexers and fixes have been contributed by Armin Ronacher, the rest of +the Pocoo team and Tim Hatch.

+
+
+
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/languages.html b/doc/_build/html/languages.html new file mode 100644 index 0000000..be7a08f --- /dev/null +++ b/doc/_build/html/languages.html @@ -0,0 +1,284 @@ + + + + + + + + Supported languages — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Supported languages¶

+

Pygments supports an ever-growing range of languages. Watch this space…

+
+

Programming languages¶

+
    +
  • ActionScript
  • +
  • Ada
  • +
  • ANTLR
  • +
  • AppleScript
  • +
  • Assembly (various)
  • +
  • Asymptote
  • +
  • Awk
  • +
  • Befunge
  • +
  • Boo
  • +
  • BrainFuck
  • +
  • C, C++
  • +
  • C#
  • +
  • Clojure
  • +
  • CoffeeScript
  • +
  • ColdFusion
  • +
  • Common Lisp
  • +
  • Coq
  • +
  • Cryptol (incl. Literate Cryptol)
  • +
  • Crystal
  • +
  • Cython
  • +
  • D
  • +
  • Dart
  • +
  • Delphi
  • +
  • Dylan
  • +
  • Elm
  • +
  • Erlang
  • +
  • Ezhil Ezhil - A Tamil programming language
  • +
  • Factor
  • +
  • Fancy
  • +
  • Fennel
  • +
  • Fortran
  • +
  • F#
  • +
  • GAP
  • +
  • Gherkin (Cucumber)
  • +
  • GL shaders
  • +
  • Groovy
  • +
  • Haskell (incl. Literate Haskell)
  • +
  • HLSL
  • +
  • IDL
  • +
  • Io
  • +
  • Java
  • +
  • JavaScript
  • +
  • Lasso
  • +
  • LLVM
  • +
  • Logtalk
  • +
  • Lua
  • +
  • Matlab
  • +
  • MiniD
  • +
  • Modelica
  • +
  • Modula-2
  • +
  • MuPad
  • +
  • Nemerle
  • +
  • Nimrod
  • +
  • Objective-C
  • +
  • Objective-J
  • +
  • Octave
  • +
  • OCaml
  • +
  • PHP
  • +
  • Perl
  • +
  • PovRay
  • +
  • PostScript
  • +
  • PowerShell
  • +
  • Prolog
  • +
  • Python 2.x and 3.x (incl. console sessions and tracebacks)
  • +
  • REBOL
  • +
  • Red
  • +
  • Redcode
  • +
  • Ruby (incl. irb sessions)
  • +
  • Rust
  • +
  • S, S-Plus, R
  • +
  • Scala
  • +
  • Scheme
  • +
  • Scilab
  • +
  • Smalltalk
  • +
  • SNOBOL
  • +
  • Tcl
  • +
  • Vala
  • +
  • Verilog
  • +
  • VHDL
  • +
  • Visual Basic.NET
  • +
  • Visual FoxPro
  • +
  • XQuery
  • +
  • Zephir
  • +
+
+
+

Template languages¶

+
    +
  • Cheetah templates
  • +
  • Django / Jinja templates
  • +
  • ERB (Ruby templating)
  • +
  • Genshi (the Trac template language)
  • +
  • JSP (Java Server Pages)
  • +
  • Myghty (the HTML::Mason based framework)
  • +
  • Mako (the Myghty successor)
  • +
  • Smarty templates (PHP templating)
  • +
  • Tea
  • +
+
+
+

Other markup¶

+
    +
  • Apache config files
  • +
  • Bash shell scripts
  • +
  • BBCode
  • +
  • CMake
  • +
  • CSS
  • +
  • Debian control files
  • +
  • Diff files
  • +
  • DTD
  • +
  • Gettext catalogs
  • +
  • Gnuplot script
  • +
  • Groff markup
  • +
  • HTML
  • +
  • HTTP sessions
  • +
  • INI-style config files
  • +
  • IRC logs (irssi style)
  • +
  • Lighttpd config files
  • +
  • Makefiles
  • +
  • MoinMoin/Trac Wiki markup
  • +
  • MySQL
  • +
  • Nginx config files
  • +
  • POV-Ray scenes
  • +
  • Ragel
  • +
  • Redcode
  • +
  • ReST
  • +
  • Robot Framework
  • +
  • RPM spec files
  • +
  • SQL, also MySQL, SQLite
  • +
  • Squid configuration
  • +
  • TeX
  • +
  • tcsh
  • +
  • Vim Script
  • +
  • Windows batch files
  • +
  • XML
  • +
  • XSLT
  • +
  • YAML
  • +
+
+
+

… that’s all?¶

+

Well, why not write your own? Contributing to Pygments is easy and fun. Take a look at the +docs on lexer development and +contact details.

+

Note: the languages listed here are supported in the development version. The +latest release may lack a few of them.

+
+
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/objects.inv b/doc/_build/html/objects.inv new file mode 100644 index 0000000..6d5f2b8 Binary files /dev/null and b/doc/_build/html/objects.inv differ diff --git a/doc/_build/html/py-modindex.html b/doc/_build/html/py-modindex.html new file mode 100644 index 0000000..2d84731 --- /dev/null +++ b/doc/_build/html/py-modindex.html @@ -0,0 +1,758 @@ + + + + + + + + Python Module Index — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ + +

Python Module Index

+ +
+ p +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ p
+ pygments +
    + pygments.formatter +
    + pygments.formatters +
    + pygments.lexer +
    + pygments.lexers +
    + pygments.lexers.actionscript +
    + pygments.lexers.algebra +
    + pygments.lexers.ambient +
    + pygments.lexers.ampl +
    + pygments.lexers.apl +
    + pygments.lexers.archetype +
    + pygments.lexers.asm +
    + pygments.lexers.automation +
    + pygments.lexers.basic +
    + pygments.lexers.bibtex +
    + pygments.lexers.business +
    + pygments.lexers.c_cpp +
    + pygments.lexers.c_like +
    + pygments.lexers.capnproto +
    + pygments.lexers.chapel +
    + pygments.lexers.clean +
    + pygments.lexers.configs +
    + pygments.lexers.console +
    + pygments.lexers.crystal +
    + pygments.lexers.csound +
    + pygments.lexers.css +
    + pygments.lexers.d +
    + pygments.lexers.dalvik +
    + pygments.lexers.data +
    + pygments.lexers.diff +
    + pygments.lexers.dotnet +
    + pygments.lexers.dsls +
    + pygments.lexers.dylan +
    + pygments.lexers.ecl +
    + pygments.lexers.eiffel +
    + pygments.lexers.elm +
    + pygments.lexers.erlang +
    + pygments.lexers.esoteric +
    + pygments.lexers.ezhil +
    + pygments.lexers.factor +
    + pygments.lexers.fantom +
    + pygments.lexers.felix +
    + pygments.lexers.forth +
    + pygments.lexers.fortran +
    + pygments.lexers.foxpro +
    + pygments.lexers.go +
    + pygments.lexers.grammar_notation +
    + pygments.lexers.graph +
    + pygments.lexers.graphics +
    + pygments.lexers.haskell +
    + pygments.lexers.haxe +
    + pygments.lexers.hdl +
    + pygments.lexers.hexdump +
    + pygments.lexers.html +
    + pygments.lexers.idl +
    + pygments.lexers.igor +
    + pygments.lexers.inferno +
    + pygments.lexers.installers +
    + pygments.lexers.int_fiction +
    + pygments.lexers.iolang +
    + pygments.lexers.j +
    + pygments.lexers.javascript +
    + pygments.lexers.julia +
    + pygments.lexers.jvm +
    + pygments.lexers.lisp +
    + pygments.lexers.make +
    + pygments.lexers.markup +
    + pygments.lexers.matlab +
    + pygments.lexers.ml +
    + pygments.lexers.modeling +
    + pygments.lexers.modula2 +
    + pygments.lexers.monte +
    + pygments.lexers.ncl +
    + pygments.lexers.nimrod +
    + pygments.lexers.nit +
    + pygments.lexers.nix +
    + pygments.lexers.oberon +
    + pygments.lexers.objective +
    + pygments.lexers.ooc +
    + pygments.lexers.parasail +
    + pygments.lexers.parsers +
    + pygments.lexers.pascal +
    + pygments.lexers.pawn +
    + pygments.lexers.perl +
    + pygments.lexers.php +
    + pygments.lexers.praat +
    + pygments.lexers.prolog +
    + pygments.lexers.python +
    + pygments.lexers.qvt +
    + pygments.lexers.r +
    + pygments.lexers.rdf +
    + pygments.lexers.rebol +
    + pygments.lexers.resource +
    + pygments.lexers.rnc +
    + pygments.lexers.roboconf +
    + pygments.lexers.robotframework +
    + pygments.lexers.ruby +
    + pygments.lexers.rust +
    + pygments.lexers.sas +
    + pygments.lexers.scripting +
    + pygments.lexers.shell +
    + pygments.lexers.smalltalk +
    + pygments.lexers.smv +
    + pygments.lexers.snobol +
    + pygments.lexers.special +
    + pygments.lexers.sql +
    + pygments.lexers.stata +
    + pygments.lexers.supercollider +
    + pygments.lexers.tcl +
    + pygments.lexers.templates +
    + pygments.lexers.testing +
    + pygments.lexers.textedit +
    + pygments.lexers.textfmts +
    + pygments.lexers.theorem +
    + pygments.lexers.trafficscript +
    + pygments.lexers.typoscript +
    + pygments.lexers.urbi +
    + pygments.lexers.varnish +
    + pygments.lexers.verification +
    + pygments.lexers.webmisc +
    + pygments.lexers.whiley +
    + pygments.lexers.x10 +
    + pygments.lexers.xorg +
    + pygments.styles +
    + pygments.token +
    + pygments.util +
+ + +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/search.html b/doc/_build/html/search.html new file mode 100644 index 0000000..4d51454 --- /dev/null +++ b/doc/_build/html/search.html @@ -0,0 +1,131 @@ + + + + + + + + Search — Pygments 2.3.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +

Search

+
+ +

+ Please activate JavaScript to enable the search + functionality. +

+
+

+ From here you can search these documents. Enter your search + words into the box below and click "search". Note that the search + function will automatically search for all of the words. Pages + containing fewer words won't appear in the result list. +

+
+ + + +
+ +
+ +
+ +
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/doc/_build/html/searchindex.js b/doc/_build/html/searchindex.js new file mode 100644 index 0000000..11c16cd --- /dev/null +++ b/doc/_build/html/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({docnames:["docs/api","docs/authors","docs/changelog","docs/cmdline","docs/filterdevelopment","docs/filters","docs/formatterdevelopment","docs/formatters","docs/index","docs/integrate","docs/java","docs/lexerdevelopment","docs/lexers","docs/moinmoin","docs/plugins","docs/quickstart","docs/rstdirective","docs/styles","docs/tokens","docs/unicode","download","faq","index","languages"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,"sphinx.ext.intersphinx":1,sphinx:55},filenames:["docs/api.rst","docs/authors.rst","docs/changelog.rst","docs/cmdline.rst","docs/filterdevelopment.rst","docs/filters.rst","docs/formatterdevelopment.rst","docs/formatters.rst","docs/index.rst","docs/integrate.rst","docs/java.rst","docs/lexerdevelopment.rst","docs/lexers.rst","docs/moinmoin.rst","docs/plugins.rst","docs/quickstart.rst","docs/rstdirective.rst","docs/styles.rst","docs/tokens.rst","docs/unicode.rst","download.rst","faq.rst","index.rst","languages.rst"],objects:{"":{BBCodeFormatter:[7,0,1,""],BmpImageFormatter:[7,0,1,""],CodeTagFilter:[5,0,1,""],GifImageFormatter:[7,0,1,""],GobbleFilter:[5,0,1,""],HtmlFormatter:[7,0,1,""],IRCFormatter:[7,0,1,""],ImageFormatter:[7,0,1,""],JpgImageFormatter:[7,0,1,""],KeywordCaseFilter:[5,0,1,""],LatexFormatter:[7,0,1,""],NameHighlightFilter:[5,0,1,""],NullFormatter:[7,0,1,""],RaiseOnErrorTokenFilter:[5,0,1,""],RawTokenFormatter:[7,0,1,""],RtfFormatter:[7,0,1,""],SvgFormatter:[7,0,1,""],Terminal256Formatter:[7,0,1,""],TerminalFormatter:[7,0,1,""],TerminalTrueColorFormatter:[7,0,1,""],TestcaseFormatter:[7,0,1,""],TokenMergeFilter:[5,0,1,""],VisibleWhitespaceFilter:[5,0,1,""],pygments:[0,1,0,"-"]},"pygments.formatter":{Formatter:[0,0,1,""]},"pygments.formatter.Formatter":{aliases:[0,3,1,""],filenames:[0,3,1,""],format:[0,4,1,""],get_style_defs:[0,4,1,""],name:[0,3,1,""]},"pygments.formatters":{get_formatter_by_name:[0,2,1,""],get_formatter_for_filename:[0,2,1,""],load_formatter_from_file:[0,2,1,""]},"pygments.lexer":{Lexer:[0,0,1,""]},"pygments.lexer.Lexer":{alias_filenames:[0,3,1,""],aliases:[0,3,1,""],analyse_text:[0,5,1,""],filenames:[0,3,1,""],get_tokens:[0,4,1,""],get_tokens_unprocessed:[0,4,1,""],mimetypes:[0,3,1,""],name:[0,3,1,""]},"pygments.lexers":{actionscript:[12,1,0,"-"],algebra:[12,1,0,"-"],ambient:[12,1,0,"-"],ampl:[12,1,0,"-"],apl:[12,1,0,"-"],archetype:[12,1,0,"-"],asm:[12,1,0,"-"],automation:[12,1,0,"-"],basic:[12,1,0,"-"],bibtex:[12,1,0,"-"],business:[12,1,0,"-"],c_cpp:[12,1,0,"-"],c_like:[12,1,0,"-"],capnproto:[12,1,0,"-"],chapel:[12,1,0,"-"],clean:[12,1,0,"-"],configs:[12,1,0,"-"],console:[12,1,0,"-"],crystal:[12,1,0,"-"],csound:[12,1,0,"-"],css:[12,1,0,"-"],d:[12,1,0,"-"],dalvik:[12,1,0,"-"],data:[12,1,0,"-"],diff:[12,1,0,"-"],dotnet:[12,1,0,"-"],dsls:[12,1,0,"-"],dylan:[12,1,0,"-"],ecl:[12,1,0,"-"],eiffel:[12,1,0,"-"],elm:[12,1,0,"-"],erlang:[12,1,0,"-"],esoteric:[12,1,0,"-"],ezhil:[12,1,0,"-"],factor:[12,1,0,"-"],fantom:[12,1,0,"-"],felix:[12,1,0,"-"],find_lexer_class:[0,2,1,""],find_lexer_class_by_name:[0,2,1,""],forth:[12,1,0,"-"],fortran:[12,1,0,"-"],foxpro:[12,1,0,"-"],get_all_lexers:[0,2,1,""],get_lexer_by_name:[0,2,1,""],get_lexer_for_filename:[0,2,1,""],get_lexer_for_mimetype:[0,2,1,""],go:[12,1,0,"-"],grammar_notation:[12,1,0,"-"],graph:[12,1,0,"-"],graphics:[12,1,0,"-"],guess_lexer:[0,2,1,""],guess_lexer_for_filename:[0,2,1,""],haskell:[12,1,0,"-"],haxe:[12,1,0,"-"],hdl:[12,1,0,"-"],hexdump:[12,1,0,"-"],html:[12,1,0,"-"],idl:[12,1,0,"-"],igor:[12,1,0,"-"],inferno:[12,1,0,"-"],installers:[12,1,0,"-"],int_fiction:[12,1,0,"-"],iolang:[12,1,0,"-"],j:[12,1,0,"-"],javascript:[12,1,0,"-"],julia:[12,1,0,"-"],jvm:[12,1,0,"-"],lisp:[12,1,0,"-"],load_lexer_from_file:[0,2,1,""],make:[12,1,0,"-"],markup:[12,1,0,"-"],matlab:[12,1,0,"-"],ml:[12,1,0,"-"],modeling:[12,1,0,"-"],modula2:[12,1,0,"-"],monte:[12,1,0,"-"],ncl:[12,1,0,"-"],nimrod:[12,1,0,"-"],nit:[12,1,0,"-"],nix:[12,1,0,"-"],oberon:[12,1,0,"-"],objective:[12,1,0,"-"],ooc:[12,1,0,"-"],parasail:[12,1,0,"-"],parsers:[12,1,0,"-"],pascal:[12,1,0,"-"],pawn:[12,1,0,"-"],perl:[12,1,0,"-"],php:[12,1,0,"-"],praat:[12,1,0,"-"],prolog:[12,1,0,"-"],python:[12,1,0,"-"],qvt:[12,1,0,"-"],r:[12,1,0,"-"],rdf:[12,1,0,"-"],rebol:[12,1,0,"-"],resource:[12,1,0,"-"],rnc:[12,1,0,"-"],roboconf:[12,1,0,"-"],robotframework:[12,1,0,"-"],ruby:[12,1,0,"-"],rust:[12,1,0,"-"],sas:[12,1,0,"-"],scripting:[12,1,0,"-"],shell:[12,1,0,"-"],smalltalk:[12,1,0,"-"],smv:[12,1,0,"-"],snobol:[12,1,0,"-"],special:[12,1,0,"-"],sql:[12,1,0,"-"],stata:[12,1,0,"-"],supercollider:[12,1,0,"-"],tcl:[12,1,0,"-"],templates:[12,1,0,"-"],testing:[12,1,0,"-"],textedit:[12,1,0,"-"],textfmts:[12,1,0,"-"],theorem:[12,1,0,"-"],trafficscript:[12,1,0,"-"],typoscript:[12,1,0,"-"],urbi:[12,1,0,"-"],varnish:[12,1,0,"-"],verification:[12,1,0,"-"],webmisc:[12,1,0,"-"],whiley:[12,1,0,"-"],x10:[12,1,0,"-"],xorg:[12,1,0,"-"]},"pygments.lexers.actionscript":{ActionScript3Lexer:[12,0,1,""],ActionScriptLexer:[12,0,1,""],MxmlLexer:[12,0,1,""]},"pygments.lexers.algebra":{BCLexer:[12,0,1,""],GAPLexer:[12,0,1,""],MathematicaLexer:[12,0,1,""],MuPADLexer:[12,0,1,""]},"pygments.lexers.ambient":{AmbientTalkLexer:[12,0,1,""]},"pygments.lexers.ampl":{AmplLexer:[12,0,1,""]},"pygments.lexers.apl":{APLLexer:[12,0,1,""]},"pygments.lexers.archetype":{AdlLexer:[12,0,1,""],CadlLexer:[12,0,1,""],OdinLexer:[12,0,1,""]},"pygments.lexers.asm":{CObjdumpLexer:[12,0,1,""],Ca65Lexer:[12,0,1,""],CppObjdumpLexer:[12,0,1,""],DObjdumpLexer:[12,0,1,""],GasLexer:[12,0,1,""],HsailLexer:[12,0,1,""],LlvmLexer:[12,0,1,""],NasmLexer:[12,0,1,""],NasmObjdumpLexer:[12,0,1,""],ObjdumpLexer:[12,0,1,""],TasmLexer:[12,0,1,""]},"pygments.lexers.automation":{AutoItLexer:[12,0,1,""],AutohotkeyLexer:[12,0,1,""]},"pygments.lexers.basic":{BlitzBasicLexer:[12,0,1,""],BlitzMaxLexer:[12,0,1,""],CbmBasicV2Lexer:[12,0,1,""],MonkeyLexer:[12,0,1,""],QBasicLexer:[12,0,1,""]},"pygments.lexers.bibtex":{BSTLexer:[12,0,1,""],BibTeXLexer:[12,0,1,""]},"pygments.lexers.business":{ABAPLexer:[12,0,1,""],CobolFreeformatLexer:[12,0,1,""],CobolLexer:[12,0,1,""],GoodDataCLLexer:[12,0,1,""],MaqlLexer:[12,0,1,""],OpenEdgeLexer:[12,0,1,""]},"pygments.lexers.c_cpp":{CLexer:[12,0,1,""],CppLexer:[12,0,1,""]},"pygments.lexers.c_like":{ArduinoLexer:[12,0,1,""],ClayLexer:[12,0,1,""],CudaLexer:[12,0,1,""],ECLexer:[12,0,1,""],MqlLexer:[12,0,1,""],NesCLexer:[12,0,1,""],PikeLexer:[12,0,1,""],SwigLexer:[12,0,1,""],ValaLexer:[12,0,1,""]},"pygments.lexers.capnproto":{CapnProtoLexer:[12,0,1,""]},"pygments.lexers.chapel":{ChapelLexer:[12,0,1,""]},"pygments.lexers.clean":{CleanLexer:[12,0,1,""]},"pygments.lexers.configs":{ApacheConfLexer:[12,0,1,""],Cfengine3Lexer:[12,0,1,""],DockerLexer:[12,0,1,""],IniLexer:[12,0,1,""],KconfigLexer:[12,0,1,""],LighttpdConfLexer:[12,0,1,""],NginxConfLexer:[12,0,1,""],PacmanConfLexer:[12,0,1,""],PkgConfigLexer:[12,0,1,""],PropertiesLexer:[12,0,1,""],RegeditLexer:[12,0,1,""],SquidConfLexer:[12,0,1,""],TermcapLexer:[12,0,1,""],TerminfoLexer:[12,0,1,""],TerraformLexer:[12,0,1,""]},"pygments.lexers.console":{PyPyLogLexer:[12,0,1,""],VCTreeStatusLexer:[12,0,1,""]},"pygments.lexers.crystal":{CrystalLexer:[12,0,1,""]},"pygments.lexers.csound":{CsoundDocumentLexer:[12,0,1,""],CsoundOrchestraLexer:[12,0,1,""],CsoundScoreLexer:[12,0,1,""]},"pygments.lexers.css":{CssLexer:[12,0,1,""],LessCssLexer:[12,0,1,""],SassLexer:[12,0,1,""],ScssLexer:[12,0,1,""]},"pygments.lexers.d":{CrocLexer:[12,0,1,""],DLexer:[12,0,1,""],MiniDLexer:[12,0,1,""]},"pygments.lexers.dalvik":{SmaliLexer:[12,0,1,""]},"pygments.lexers.data":{JsonBareObjectLexer:[12,0,1,""],JsonLdLexer:[12,0,1,""],JsonLexer:[12,0,1,""],YamlLexer:[12,0,1,""]},"pygments.lexers.diff":{DarcsPatchLexer:[12,0,1,""],DiffLexer:[12,0,1,""],WDiffLexer:[12,0,1,""]},"pygments.lexers.dotnet":{BooLexer:[12,0,1,""],CSharpAspxLexer:[12,0,1,""],CSharpLexer:[12,0,1,""],FSharpLexer:[12,0,1,""],NemerleLexer:[12,0,1,""],VbNetAspxLexer:[12,0,1,""],VbNetLexer:[12,0,1,""]},"pygments.lexers.dsls":{AlloyLexer:[12,0,1,""],BroLexer:[12,0,1,""],CrmshLexer:[12,0,1,""],FlatlineLexer:[12,0,1,""],MscgenLexer:[12,0,1,""],PanLexer:[12,0,1,""],ProtoBufLexer:[12,0,1,""],PuppetLexer:[12,0,1,""],RslLexer:[12,0,1,""],SnowballLexer:[12,0,1,""],ThriftLexer:[12,0,1,""],VGLLexer:[12,0,1,""]},"pygments.lexers.dylan":{DylanConsoleLexer:[12,0,1,""],DylanLexer:[12,0,1,""],DylanLidLexer:[12,0,1,""]},"pygments.lexers.ecl":{ECLLexer:[12,0,1,""]},"pygments.lexers.eiffel":{EiffelLexer:[12,0,1,""]},"pygments.lexers.elm":{ElmLexer:[12,0,1,""]},"pygments.lexers.erlang":{ElixirConsoleLexer:[12,0,1,""],ElixirLexer:[12,0,1,""],ErlangLexer:[12,0,1,""],ErlangShellLexer:[12,0,1,""]},"pygments.lexers.esoteric":{AheuiLexer:[12,0,1,""],BefungeLexer:[12,0,1,""],BrainfuckLexer:[12,0,1,""],CAmkESLexer:[12,0,1,""],CapDLLexer:[12,0,1,""],RedcodeLexer:[12,0,1,""]},"pygments.lexers.ezhil":{EzhilLexer:[12,0,1,""]},"pygments.lexers.factor":{FactorLexer:[12,0,1,""]},"pygments.lexers.fantom":{FantomLexer:[12,0,1,""]},"pygments.lexers.felix":{FelixLexer:[12,0,1,""]},"pygments.lexers.forth":{ForthLexer:[12,0,1,""]},"pygments.lexers.fortran":{FortranFixedLexer:[12,0,1,""],FortranLexer:[12,0,1,""]},"pygments.lexers.foxpro":{FoxProLexer:[12,0,1,""]},"pygments.lexers.go":{GoLexer:[12,0,1,""]},"pygments.lexers.grammar_notation":{AbnfLexer:[12,0,1,""],BnfLexer:[12,0,1,""],JsgfLexer:[12,0,1,""]},"pygments.lexers.graph":{CypherLexer:[12,0,1,""]},"pygments.lexers.graphics":{AsymptoteLexer:[12,0,1,""],GLShaderLexer:[12,0,1,""],GnuplotLexer:[12,0,1,""],HLSLShaderLexer:[12,0,1,""],PostScriptLexer:[12,0,1,""],PovrayLexer:[12,0,1,""]},"pygments.lexers.haskell":{AgdaLexer:[12,0,1,""],CryptolLexer:[12,0,1,""],HaskellLexer:[12,0,1,""],IdrisLexer:[12,0,1,""],KokaLexer:[12,0,1,""],LiterateAgdaLexer:[12,0,1,""],LiterateCryptolLexer:[12,0,1,""],LiterateHaskellLexer:[12,0,1,""],LiterateIdrisLexer:[12,0,1,""]},"pygments.lexers.haxe":{HaxeLexer:[12,0,1,""],HxmlLexer:[12,0,1,""]},"pygments.lexers.hdl":{SystemVerilogLexer:[12,0,1,""],VerilogLexer:[12,0,1,""],VhdlLexer:[12,0,1,""]},"pygments.lexers.hexdump":{HexdumpLexer:[12,0,1,""]},"pygments.lexers.html":{DtdLexer:[12,0,1,""],HamlLexer:[12,0,1,""],HtmlLexer:[12,0,1,""],PugLexer:[12,0,1,""],ScamlLexer:[12,0,1,""],XmlLexer:[12,0,1,""],XsltLexer:[12,0,1,""]},"pygments.lexers.idl":{IDLLexer:[12,0,1,""]},"pygments.lexers.igor":{IgorLexer:[12,0,1,""]},"pygments.lexers.inferno":{LimboLexer:[12,0,1,""]},"pygments.lexers.installers":{DebianControlLexer:[12,0,1,""],NSISLexer:[12,0,1,""],RPMSpecLexer:[12,0,1,""],SourcesListLexer:[12,0,1,""]},"pygments.lexers.int_fiction":{Inform6Lexer:[12,0,1,""],Inform6TemplateLexer:[12,0,1,""],Inform7Lexer:[12,0,1,""],Tads3Lexer:[12,0,1,""]},"pygments.lexers.iolang":{IoLexer:[12,0,1,""]},"pygments.lexers.j":{JLexer:[12,0,1,""]},"pygments.lexers.javascript":{CoffeeScriptLexer:[12,0,1,""],DartLexer:[12,0,1,""],EarlGreyLexer:[12,0,1,""],JavascriptLexer:[12,0,1,""],JuttleLexer:[12,0,1,""],KalLexer:[12,0,1,""],LassoLexer:[12,0,1,""],LiveScriptLexer:[12,0,1,""],MaskLexer:[12,0,1,""],ObjectiveJLexer:[12,0,1,""],TypeScriptLexer:[12,0,1,""]},"pygments.lexers.julia":{JuliaConsoleLexer:[12,0,1,""],JuliaLexer:[12,0,1,""]},"pygments.lexers.jvm":{AspectJLexer:[12,0,1,""],CeylonLexer:[12,0,1,""],ClojureLexer:[12,0,1,""],ClojureScriptLexer:[12,0,1,""],GoloLexer:[12,0,1,""],GosuLexer:[12,0,1,""],GosuTemplateLexer:[12,0,1,""],GroovyLexer:[12,0,1,""],IokeLexer:[12,0,1,""],JasminLexer:[12,0,1,""],JavaLexer:[12,0,1,""],KotlinLexer:[12,0,1,""],PigLexer:[12,0,1,""],ScalaLexer:[12,0,1,""],XtendLexer:[12,0,1,""]},"pygments.lexers.lisp":{CPSALexer:[12,0,1,""],CommonLispLexer:[12,0,1,""],EmacsLispLexer:[12,0,1,""],FennelLexer:[12,0,1,""],HyLexer:[12,0,1,""],NewLispLexer:[12,0,1,""],RacketLexer:[12,0,1,""],SchemeLexer:[12,0,1,""],ShenLexer:[12,0,1,""],XtlangLexer:[12,0,1,""]},"pygments.lexers.make":{BaseMakefileLexer:[12,0,1,""],CMakeLexer:[12,0,1,""],MakefileLexer:[12,0,1,""]},"pygments.lexers.markup":{BBCodeLexer:[12,0,1,""],GroffLexer:[12,0,1,""],MarkdownLexer:[12,0,1,""],MoinWikiLexer:[12,0,1,""],MozPreprocCssLexer:[12,0,1,""],MozPreprocHashLexer:[12,0,1,""],MozPreprocJavascriptLexer:[12,0,1,""],MozPreprocPercentLexer:[12,0,1,""],MozPreprocXulLexer:[12,0,1,""],RstLexer:[12,0,1,""],TexLexer:[12,0,1,""]},"pygments.lexers.matlab":{MatlabLexer:[12,0,1,""],MatlabSessionLexer:[12,0,1,""],OctaveLexer:[12,0,1,""],ScilabLexer:[12,0,1,""]},"pygments.lexers.ml":{OcamlLexer:[12,0,1,""],OpaLexer:[12,0,1,""],SMLLexer:[12,0,1,""]},"pygments.lexers.modeling":{BugsLexer:[12,0,1,""],JagsLexer:[12,0,1,""],ModelicaLexer:[12,0,1,""],StanLexer:[12,0,1,""]},"pygments.lexers.modula2":{Modula2Lexer:[12,0,1,""]},"pygments.lexers.monte":{MonteLexer:[12,0,1,""]},"pygments.lexers.ncl":{NCLLexer:[12,0,1,""]},"pygments.lexers.nimrod":{NimrodLexer:[12,0,1,""]},"pygments.lexers.nit":{NitLexer:[12,0,1,""]},"pygments.lexers.nix":{NixLexer:[12,0,1,""]},"pygments.lexers.oberon":{ComponentPascalLexer:[12,0,1,""]},"pygments.lexers.objective":{LogosLexer:[12,0,1,""],ObjectiveCLexer:[12,0,1,""],ObjectiveCppLexer:[12,0,1,""],SwiftLexer:[12,0,1,""]},"pygments.lexers.ooc":{OocLexer:[12,0,1,""]},"pygments.lexers.parasail":{ParaSailLexer:[12,0,1,""]},"pygments.lexers.parsers":{AntlrActionScriptLexer:[12,0,1,""],AntlrCSharpLexer:[12,0,1,""],AntlrCppLexer:[12,0,1,""],AntlrJavaLexer:[12,0,1,""],AntlrLexer:[12,0,1,""],AntlrObjectiveCLexer:[12,0,1,""],AntlrPerlLexer:[12,0,1,""],AntlrPythonLexer:[12,0,1,""],AntlrRubyLexer:[12,0,1,""],EbnfLexer:[12,0,1,""],RagelCLexer:[12,0,1,""],RagelCppLexer:[12,0,1,""],RagelDLexer:[12,0,1,""],RagelEmbeddedLexer:[12,0,1,""],RagelJavaLexer:[12,0,1,""],RagelLexer:[12,0,1,""],RagelObjectiveCLexer:[12,0,1,""],RagelRubyLexer:[12,0,1,""],TreetopLexer:[12,0,1,""]},"pygments.lexers.pascal":{AdaLexer:[12,0,1,""],DelphiLexer:[12,0,1,""]},"pygments.lexers.pawn":{PawnLexer:[12,0,1,""],SourcePawnLexer:[12,0,1,""]},"pygments.lexers.perl":{Perl6Lexer:[12,0,1,""],PerlLexer:[12,0,1,""]},"pygments.lexers.php":{PhpLexer:[12,0,1,""],ZephirLexer:[12,0,1,""]},"pygments.lexers.praat":{PraatLexer:[12,0,1,""]},"pygments.lexers.prolog":{LogtalkLexer:[12,0,1,""],PrologLexer:[12,0,1,""]},"pygments.lexers.python":{CythonLexer:[12,0,1,""],DgLexer:[12,0,1,""],NumPyLexer:[12,0,1,""],Python3Lexer:[12,0,1,""],Python3TracebackLexer:[12,0,1,""],PythonConsoleLexer:[12,0,1,""],PythonLexer:[12,0,1,""],PythonTracebackLexer:[12,0,1,""]},"pygments.lexers.qvt":{QVToLexer:[12,0,1,""]},"pygments.lexers.r":{RConsoleLexer:[12,0,1,""],RdLexer:[12,0,1,""],SLexer:[12,0,1,""]},"pygments.lexers.rdf":{SparqlLexer:[12,0,1,""],TurtleLexer:[12,0,1,""]},"pygments.lexers.rebol":{RebolLexer:[12,0,1,""],RedLexer:[12,0,1,""]},"pygments.lexers.resource":{ResourceLexer:[12,0,1,""]},"pygments.lexers.rnc":{RNCCompactLexer:[12,0,1,""]},"pygments.lexers.roboconf":{RoboconfGraphLexer:[12,0,1,""],RoboconfInstancesLexer:[12,0,1,""]},"pygments.lexers.robotframework":{RobotFrameworkLexer:[12,0,1,""]},"pygments.lexers.ruby":{FancyLexer:[12,0,1,""],RubyConsoleLexer:[12,0,1,""],RubyLexer:[12,0,1,""]},"pygments.lexers.rust":{RustLexer:[12,0,1,""]},"pygments.lexers.sas":{SASLexer:[12,0,1,""]},"pygments.lexers.scripting":{AppleScriptLexer:[12,0,1,""],ChaiscriptLexer:[12,0,1,""],EasytrieveLexer:[12,0,1,""],HybrisLexer:[12,0,1,""],JclLexer:[12,0,1,""],LSLLexer:[12,0,1,""],LuaLexer:[12,0,1,""],MOOCodeLexer:[12,0,1,""],MoonScriptLexer:[12,0,1,""],RexxLexer:[12,0,1,""]},"pygments.lexers.shell":{BashLexer:[12,0,1,""],BashSessionLexer:[12,0,1,""],BatchLexer:[12,0,1,""],FishShellLexer:[12,0,1,""],MSDOSSessionLexer:[12,0,1,""],PowerShellLexer:[12,0,1,""],PowerShellSessionLexer:[12,0,1,""],TcshLexer:[12,0,1,""],TcshSessionLexer:[12,0,1,""]},"pygments.lexers.smalltalk":{NewspeakLexer:[12,0,1,""],SmalltalkLexer:[12,0,1,""]},"pygments.lexers.smv":{NuSMVLexer:[12,0,1,""]},"pygments.lexers.snobol":{SnobolLexer:[12,0,1,""]},"pygments.lexers.special":{RawTokenLexer:[12,0,1,""],TextLexer:[12,0,1,""]},"pygments.lexers.sql":{MySqlLexer:[12,0,1,""],PlPgsqlLexer:[12,0,1,""],PostgresConsoleLexer:[12,0,1,""],PostgresLexer:[12,0,1,""],RqlLexer:[12,0,1,""],SqlLexer:[12,0,1,""],SqliteConsoleLexer:[12,0,1,""],TransactSqlLexer:[12,0,1,""]},"pygments.lexers.stata":{StataLexer:[12,0,1,""]},"pygments.lexers.supercollider":{SuperColliderLexer:[12,0,1,""]},"pygments.lexers.tcl":{TclLexer:[12,0,1,""]},"pygments.lexers.templates":{Angular2HtmlLexer:[12,0,1,""],Angular2Lexer:[12,0,1,""],CheetahHtmlLexer:[12,0,1,""],CheetahJavascriptLexer:[12,0,1,""],CheetahLexer:[12,0,1,""],CheetahXmlLexer:[12,0,1,""],ColdfusionCFCLexer:[12,0,1,""],ColdfusionHtmlLexer:[12,0,1,""],ColdfusionLexer:[12,0,1,""],CssDjangoLexer:[12,0,1,""],CssErbLexer:[12,0,1,""],CssGenshiLexer:[12,0,1,""],CssPhpLexer:[12,0,1,""],CssSmartyLexer:[12,0,1,""],DjangoLexer:[12,0,1,""],ErbLexer:[12,0,1,""],EvoqueHtmlLexer:[12,0,1,""],EvoqueLexer:[12,0,1,""],EvoqueXmlLexer:[12,0,1,""],GenshiLexer:[12,0,1,""],GenshiTextLexer:[12,0,1,""],HandlebarsHtmlLexer:[12,0,1,""],HandlebarsLexer:[12,0,1,""],HtmlDjangoLexer:[12,0,1,""],HtmlGenshiLexer:[12,0,1,""],HtmlPhpLexer:[12,0,1,""],HtmlSmartyLexer:[12,0,1,""],JavascriptDjangoLexer:[12,0,1,""],JavascriptErbLexer:[12,0,1,""],JavascriptGenshiLexer:[12,0,1,""],JavascriptPhpLexer:[12,0,1,""],JavascriptSmartyLexer:[12,0,1,""],JspLexer:[12,0,1,""],LassoCssLexer:[12,0,1,""],LassoHtmlLexer:[12,0,1,""],LassoJavascriptLexer:[12,0,1,""],LassoXmlLexer:[12,0,1,""],LiquidLexer:[12,0,1,""],MakoCssLexer:[12,0,1,""],MakoHtmlLexer:[12,0,1,""],MakoJavascriptLexer:[12,0,1,""],MakoLexer:[12,0,1,""],MakoXmlLexer:[12,0,1,""],MasonLexer:[12,0,1,""],MyghtyCssLexer:[12,0,1,""],MyghtyHtmlLexer:[12,0,1,""],MyghtyJavascriptLexer:[12,0,1,""],MyghtyLexer:[12,0,1,""],MyghtyXmlLexer:[12,0,1,""],RhtmlLexer:[12,0,1,""],SmartyLexer:[12,0,1,""],SspLexer:[12,0,1,""],TeaTemplateLexer:[12,0,1,""],TwigHtmlLexer:[12,0,1,""],TwigLexer:[12,0,1,""],VelocityHtmlLexer:[12,0,1,""],VelocityLexer:[12,0,1,""],VelocityXmlLexer:[12,0,1,""],XmlDjangoLexer:[12,0,1,""],XmlErbLexer:[12,0,1,""],XmlPhpLexer:[12,0,1,""],XmlSmartyLexer:[12,0,1,""],YamlJinjaLexer:[12,0,1,""]},"pygments.lexers.testing":{GherkinLexer:[12,0,1,""],TAPLexer:[12,0,1,""]},"pygments.lexers.textedit":{AwkLexer:[12,0,1,""],VimLexer:[12,0,1,""]},"pygments.lexers.textfmts":{GettextLexer:[12,0,1,""],HttpLexer:[12,0,1,""],IrcLogsLexer:[12,0,1,""],TodotxtLexer:[12,0,1,""]},"pygments.lexers.theorem":{CoqLexer:[12,0,1,""],IsabelleLexer:[12,0,1,""],LeanLexer:[12,0,1,""]},"pygments.lexers.trafficscript":{RtsLexer:[12,0,1,""]},"pygments.lexers.typoscript":{TypoScriptCssDataLexer:[12,0,1,""],TypoScriptHtmlDataLexer:[12,0,1,""],TypoScriptLexer:[12,0,1,""]},"pygments.lexers.urbi":{UrbiscriptLexer:[12,0,1,""]},"pygments.lexers.varnish":{VCLLexer:[12,0,1,""],VCLSnippetLexer:[12,0,1,""]},"pygments.lexers.verification":{BoogieLexer:[12,0,1,""],SilverLexer:[12,0,1,""]},"pygments.lexers.webmisc":{CirruLexer:[12,0,1,""],DuelLexer:[12,0,1,""],QmlLexer:[12,0,1,""],SlimLexer:[12,0,1,""],XQueryLexer:[12,0,1,""]},"pygments.lexers.whiley":{WhileyLexer:[12,0,1,""]},"pygments.lexers.x10":{X10Lexer:[12,0,1,""]},"pygments.lexers.xorg":{XorgLexer:[12,0,1,""]},"pygments.styles":{get_all_styles:[0,2,1,""],get_style_by_name:[0,2,1,""]},"pygments.util":{OptionError:[0,6,1,""],get_bool_opt:[0,2,1,""],get_choice_opt:[0,2,1,""],get_int_opt:[0,2,1,""],get_list_opt:[0,2,1,""]},pygments:{format:[0,2,1,""],formatter:[0,1,0,"-"],formatters:[0,1,0,"-"],highlight:[0,2,1,""],lex:[0,2,1,""],lexer:[0,1,0,"-"],lexers:[0,1,0,"-"],styles:[0,1,0,"-"],token:[18,1,0,"-"],util:[0,1,0,"-"]}},objnames:{"0":["py","class","Python class"],"1":["py","module","Python module"],"2":["py","function","Python function"],"3":["py","attribute","Python attribute"],"4":["py","method","Python method"],"5":["py","staticmethod","Python static method"],"6":["py","exception","Python exception"]},objtypes:{"0":"py:class","1":"py:module","2":"py:function","3":"py:attribute","4":"py:method","5":"py:staticmethod","6":"py:exception"},terms:{"0000aa":6,"00ff00":7,"00m":17,"01m":17,"01mhello":17,"0b101010":18,"0f0":17,"0x20":12,"0xb785decc":5,"0xdeadbeef":18,"14px":7,"16m":[2,7],"42d":18,"42l":18,"6pl":12,"6pm":12,"beno\u00eet":1,"boolean":[0,2],"break":7,"byte":[2,7,15,19],"case":[0,2,3,4,5,7,11,19,21],"char":[2,11,12,18],"cl\u00e9ment":1,"class":[0,2,3,4,5,6,10,12,13,14,15,17,18],"const":18,"dani\u00ebl":1,"default":[0,1,2,3,5,7,11,12,15,17,19],"enum":12,"export":2,"final":[2,11],"float":[0,2,18],"function":[0,2,4,5,6,11,12,14,15,17,18,21],"g\u00f3rny":1,"goto":18,"guti\u00e9rrez":1,"hegg\u00f8":1,"helles\u00f8i":1,"import":[2,4,5,6,7,10,11,12,15,17,18,19],"int":[5,18],"joaqu\u00edn":1,"jos\u00e9":1,"kl\u00e4rck":1,"ko\u017ear":1,"long":[2,18],"lyngst\u00f8l":1,"maik\u00e4fer":2,"micha\u0142":1,"new":[0,2,3,4,5,6,7,10,12,14,17,18,19,22],"null":[7,12],"pr\u00e9vost":1,"public":[2,12],"ren\u00e9":1,"return":[0,5,6,7,11,12,15],"s\u00e9bastien":1,"schneegl\u00f6ckchen":2,"short":[0,3,7,11,12],"static":[0,18],"strau\u00dfenei":2,"super":11,"switch":12,"true":[0,2,5,6,7,11,12,13,15,18],"try":6,"unsch\u00e4rf":2,"var":[12,18],"while":[2,3,6,11,12,15,21],Abe:1,Added:[2,12],And:11,BAS:12,But:11,DOS:12,EXE:12,For:[0,3,5,6,7,11,12,13,15,17,18,20,21],Gas:12,IDE:21,IDEs:2,Its:[3,21],One:11,SAS:[1,2],That:[0,4,7,11,14,17,21],The:[2,3,4,5,6,7,8,9,10,12,15,17,18,19,20,21,23],Then:[7,11],There:[2,5,11,14,15,17],These:[7,9,12],Use:[2,8,12],Used:7,Using:[7,8],Vos:1,Will:0,With:[2,7,18],XDS:12,__all__:11,__doc__:18,__init__:[0,4,6,11,18],_by_:2,_format_lin:7,_lua_builtin:12,_php_builtin:12,_style:6,_toc335818775:12,_wrap_cod:7,aa22ff:15,aaaaack:12,aamann:12,aaron:1,abandon:11,abap:[1,2,12],abaplex:12,abil:2,abl:[1,2,12],abnf:12,abnflex:12,about:[2,3,8,11,14],abov:[3,11],absolut:7,abysm:2,academ:12,accept:[5,7,12,13,15,19],access:[4,6,7,12,18],accordingli:7,accur:2,acm:12,aconf:12,act:12,action:11,actionscript3:12,actionscript3lex:12,actionscript:[2,23],actionscriptlex:12,activ:[1,12],activest:21,actual:[2,12],ada2005:12,ada95:12,ada:[1,2,12,23],adalex:12,adam:[1,2,12],adapt:[5,9,16],adb:12,add:[0,2,5,7,11,14,21],add_filt:[4,5],added:[2,3,4,7,11,17,21,22],adding:[11,14],addit:[2,6,7,11,12,15,21],addition:[4,6,7,11,13],address:22,adjust:4,adl:12,adlf:12,adllex:12,adlx:12,ado:12,adob:12,ads:12,adt:12,advanc:10,affect:[2,7,17],affix:[2,18],afshar:1,after:[2,3,7,11,12,18],again:[6,7,11],against:11,agda:[1,2,12],agdalex:12,aglassing:1,aglet:12,aheui:12,aheui_:12,aheuilex:12,ahk:12,ahkl:12,aim:12,alain:1,alastair:1,alex:1,alexand:1,algol:[2,12],algol_nu:12,algorithm:[7,12],ali:1,alia:[0,2,14,15],alias:[0,2,11,12,14,18],alias_filenam:0,align:7,all:[0,1,2,3,4,5,6,7,11,13,15,17,18,19,20,21],alloi:[2,12],allow:[0,2,5,7,9,11,12,17],alloylex:12,almost:[11,12],along:3,alphabet:[1,12],alreadi:[0,5,11,12,18],als:12,also:[0,2,3,4,7,11,12,13,16,17,18,19,21,22,23],altern:[2,7,11],alwai:[2,4,12,22],amann:[1,2,12],ambient:12,ambienttalk:2,ambienttalklex:12,ambigu:15,among:[0,15,22],amount:[5,11],ampl:[1,2],ampllex:12,ana:[1,2],analog:2,analys:[0,19],analyse_text:[0,2,15],analysi:2,anchor:7,anchorlineno:[1,2,7],andr:[1,2],andrea:[1,2,12],andrei:1,andrew:1,android:12,angl:5,angu:1,angular2:12,angular2htmllex:12,angular2lex:12,angular:12,ani:[0,2,3,7,11,12,17,18,19],annamalai:1,annot:[5,12],anonym:11,anoth:[2,5,11,18,19,21],ansi:[1,2,7,12,15,17,21,22],ansiblu:17,ansicolor:17,ansigreen:17,ansir:17,antlr:[1,2,12,23],antlractionscriptlex:12,antlrcpplex:12,antlrcsharplex:12,antlrjavalex:12,antlrlex:12,antlrobjectiveclex:12,antlrperllex:12,antlrpythonlex:12,antlrrubylex:12,antonio:9,anymor:2,anyth:[2,3,7,11,12],apach:[2,10,12,23],apache2:12,apacheconf:12,apacheconflex:12,api:[8,11,15],apl:[1,2],apllex:12,apostroph:2,appaiah:1,appear:6,append:11,applescript:[1,2,12,23],applescriptlex:12,appli:5,applic:[2,12,22],approach:[11,12],appropri:[7,11,12],apt:12,arbitrari:11,archetyp:[1,2],arduino:[1,2,12],arduinolex:12,area:7,aren:[6,11,17,18],arexx:12,arg:[0,2,3,7],argument:[0,2,3,4,5,6,7,11,15],armin:[1,22],armstrong:1,arnold:1,around:[2,3,12],arrow:12,art:12,artem:1,articl:7,artifactid:10,as3:[2,12],asax:12,ascii:[3,7,12,19],asciidoc:21,ascx:12,ashkena:1,ashx:12,asi:12,ask:2,aslak:1,aslakhellesoi:12,asm:[2,12],asmx:12,asp:[2,12],aspectj:[1,2,12],aspectjlex:12,aspx:12,assembl:[1,2,23],assign:12,assist:12,associ:11,assum:[7,12,21],assumpt:12,asterisk:11,asymptot:[1,2,12,23],asymptotelex:12,async:2,atom:12,atria:1,attach:[13,18],attent:22,attribut:[0,2,3,6,7,11,12,14,15,18,19],au3:12,aug:2,aust:[1,12],author:[12,18,21],autodeleg:12,autodetect:12,autohandl:12,autohotkei:[1,2,12],autohotkeylex:12,autoit:[1,2,12],autoitlex:12,autolisp:12,automat:[2,4,7,11,12,17,19],autopygment:2,aux:12,avail:[0,2,8,11,15,18,21,22],avoid:[2,15],await:2,awar:2,awk:[1,2,12,23],awklex:12,axd:12,b3d:12,background:[2,5,6,7,17],backquot:2,backreferenc:11,backslash:[2,12],backtick:18,backtrack:2,backward:[2,18],bajolet:1,bangert:[1,2],bar:[5,7,11],barfoo:11,baruchel:1,bas:12,base:[0,1,2,7,11,12,18,21,22,23],baselex:11,baselin:7,basemak:12,basemakefilelex:12,bash:[2,12,18,23],bashcomp:9,bashlex:[2,12],bashrc:12,bashsessionlex:[2,12],basic:[0,2,6,11,15,21,23],bat:12,batch:[2,12,23],batchlex:12,battcher:1,baumann:1,baumgart:1,bayer:1,baz:5,bazaar:21,bazbam:12,bb4444:15,bbcode:[1,2,7,12,21,23],bbcodeformatt:7,bbcodelex:12,bclexer:12,beal:1,beauti:21,becaus:[0,2,3,4,6,7,11,12,14,17,18,19],been:[2,5,7,10,11,22],befor:[2,7,12,19],befung:[2,12,23],befungelex:[11,12],begin:[7,11,12],behavior:[2,4,17,19],being:[11,15,17],below:[11,18,22],ben:[1,2],benediktsson:1,benjamin:1,bergeron:1,bernat:1,bertel:1,bertrand:1,best:19,better:[2,12],between:[2,7,11,12,17],bgcolor:6,bib:12,bibtex:1,bibtexlex:12,big:12,bigaret:1,billingslei:[1,2],bin:[15,18],binari:[2,12,18],bind:12,bird:12,birkenfeld:[2,20],bit:[2,7],bitbucket:[2,11,20,21,22],bitmap:7,bitstream:7,black:17,blackwhitestyl:2,blame:12,blink:12,blinkinsop:[1,2,12],blitzbas:[1,2,12],blitzbasiclex:12,blitzmax:[1,2,12],blitzmaxlex:12,block:[2,7,12],blue:[6,17],bmax:12,bmp:[2,7],bmpimageformatt:7,bmx:12,bnflexer:12,board:[7,21],bob:1,bold:[6,7,15,17,18],boldfac:[12,17],bom:19,bommel:1,boo:[2,12,18,23],boogi:[1,2,12],boogielex:12,bool:5,boolex:12,border:[6,7,17],borland:12,both:[11,12,15,17],bourdon:[1,2],bpl:12,bplu:12,bpython:21,brace:12,bracket:12,brainfuck:[12,23],brainfucklex:[11,12],branch:21,brandl:[1,22],brian:1,brillouin:2,bro:[1,2,12],broken:7,brolex:12,brown:17,brows:20,browser:[7,11,21],bruce:[1,21],bruno:1,bryan:1,bsd:[2,12,21],bsdmake:12,bst:12,bstlexer:12,buffer:[1,2,6,12],bug:[1,2,5,8,12,22],bugfix:[1,2],bugslex:12,build:[12,21],builder:21,built:[2,7,12,15],builtin:[0,2,7,8,11,12,15],builtinshighlight:12,bulletin:7,bundl:[9,12],bussonni:1,bygroup:11,bz2:[7,12],bzrfruit:21,c99:2,c_cpp:12,c_like:12,ca65:12,ca65lex:12,cacer:1,cach:[2,6,12],cadl:12,cadllex:12,call:[0,2,7,11,12,13,15,17,18,19,20],callaghan:1,caller:11,cambridg:12,camil:1,camk:[1,2,12],camkeslex:12,can:[0,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,22],cangiano:9,cannot:11,canon:12,cap:2,capabl:2,capdl:[2,12],capdllex:12,capit:5,capnp:12,capnproto:12,capnprotolex:12,caption:7,captur:11,care:[0,11],carlo:1,cascad:12,cat:1,catalog:[2,12,23],categori:[3,12],caus:[2,7,12],cbl:12,cbm:12,cbmba:12,cbmbasicv2lex:12,cdf:12,cdl:12,cell:7,central:10,certain:[2,7,11],cetera:16,ceylon:[1,2,12],ceylonlex:12,cf3:12,cfc:[2,12],cfengine3:[1,2,12],cfengine3lex:12,cfg:[11,12],cfm:12,cfml:12,cfs:12,chai:12,chain:[2,12],chaiscript:[2,12],chaiscriptlex:12,chanc:14,chang:[2,7,12,15,20],changelog:[8,20],channel:22,chapel:[1,2],chapellex:12,charact:[2,3,5,7,11,12,18,19],chardet:[12,19],charl:1,charna:2,chdr:12,chebee7i:1,check:[2,4,11,12],checkspac:12,chee:1,cheetah:[1,2,12,23],cheetahhtmllex:12,cheetahjavascriptlex:12,cheetahlex:12,cheetahxmllex:12,child:[2,11],chines:21,chirino:1,chpl:12,christian:1,christoph:[1,2,12],cirru:[2,12],cirrulex:12,clai:[1,2,12],clariti:7,clash:7,class_too:4,classnotfound:[0,2],classprefix:7,classtoo:4,claylex:12,clean:[1,2],cleanlex:12,clear:22,clexer:[2,12],cli:18,click:7,client:22,clipper:12,clj:12,clobber:2,clojur:[1,2,9,12,21,23],clojurelex:12,clojurescript:12,clojurescriptlex:12,clone:[11,20],close:[6,11],closingcommentdelim:12,cls:12,cluster:12,clygment:[9,21],cmake:[2,12,23],cmakelex:12,cmakelist:12,cmd:12,cmdline:1,cob:12,cobjdumplex:12,cobol:12,cobolfre:12,cobolfreeformatlex:12,cobollex:12,cocoa:2,code:[0,2,5,7,9,10,11,13,15,16,17,18,20,21,22],codecov:21,codehtmlformatt:7,codenam:2,codetag:[2,5,7],codetagfilt:5,codetagifi:5,coffe:12,coffeescript:[1,2,12,23],coffeescriptlex:12,coldfus:[2,12,23],coldfusioncfclex:12,coldfusionhtmllex:12,coldfusionlex:12,colin:1,collabor:21,collis:2,colon:[3,11],color:[2,3,4,5,6,7,9,12,13,15,17,21],colorama:2,colorfulstyl:17,colorschem:7,colour:7,column:7,com:[1,12,21],combin:[0,2,7,11,12],come:[5,17],comma:[2,3],command:[0,2,7,8,9,11,14,18,19,20,21,22],commandchar:7,commandlin:12,commandprefix:[2,7],comment:[2,5,6,7,11,12,15,17],commit:2,common:[1,2,12,21,23],commonli:12,commonlisplex:12,commun:[21,22],compar:[12,18],compat:[2,7,18],compens:21,compil:12,complet:[2,7,11,21],complex:[6,11,12],compon:[2,8,12,15],componentpasc:12,componentpascallex:12,compress:[0,7,12],comput:1,concaten:11,concept:15,concret:12,concurr:12,conf:[2,12],config:[1,2,13,23],configur:[2,13,18,23],conflict:2,confus:[4,11,12],connect:22,consecut:[5,6],consid:[12,17],consider:[0,12],consist:[2,11],consol:[1,2,3,7,21,23],console16m:7,console256:7,constant:[12,18],constitut:2,construct:[2,7,11,18],constructor:[0,5],consum:12,contact:[8,21,23],contain:[0,2,3,5,6,7,9,11,12,15,21],content:[0,2,7,10,11,12,15],context:[2,11,12],continu:[2,11],contribut:[1,12,23],contributor:8,control:[0,1,2,7,12,20,21,23],convers:12,convert:[0,2,4,5,7,12,15,17,18,21],cookbook:21,cooper:1,coordin:7,copi:[7,9,11,12,13,16],copyright:12,coq:[2,12,23],coqlex:12,corbett:1,corbin:1,corcoran:1,corei:1,corner:2,coroutin:12,correct:[0,2],correctli:[2,7,11,21],correspond:[11,12,17],could:[3,4,7,11,12,15,17],count:12,coupl:2,courier:7,cours:[18,21],cover:[12,14],coverag:21,cpp:12,cppcommentlex:11,cpplexer:12,cppobjdumplex:12,cps:12,cpsa:[1,12],cpsalex:12,cpy:12,cpython:12,crash:[2,11],creat:[2,3,6,7,9,10,11,15,18,21],creation:12,creutzig:[1,2,12],crmsh:[1,2,12],crmshlexer:12,croc:[2,12],croclex:12,crocsrc:12,crompton:1,cross:21,crunchi:2,cry:12,cryptol2:12,cryptol:[1,2,12,23],cryptollex:12,crystal:[1,2,23],crystallex:12,csail:12,csd:12,csh:12,csharp:12,csharpaspxlex:12,csharplex:[2,12],csound:[1,2],csounddocumentlex:12,csoundorchestralex:12,csoundscorelex:12,csrc:12,css:[0,2,3,6,7,13,15,17,23],cssclass:[2,7,15],cssdjangolex:12,csserblex:12,cssfile:7,cssgenshilex:12,csslexer:12,cssphplexer:12,csssmartylex:12,cssstyle:7,ctag:[1,2,7],ctx:11,cucumb:[2,12,23],cuda:[1,2,12],cudalex:12,cuh:12,curli:12,current:[0,3,6,7,11,12,13,18,20],curri:1,curs:21,custom:[2,7,11,16,17],customformatt:[0,3],customlex:[0,3,11],cxx:12,cyp:12,cypher:[2,12],cypherlex:12,cython:[2,12,23],cythonlex:12,dalvik:2,dan:1,daniel:1,darc:[1,2,12],darcspatch:12,darcspatchlex:12,dark:[2,6,7,17],darkbg:7,darkblu:17,darkgrai:17,darkgreen:17,darkr:17,dart:[1,2,12,23],dartlex:12,dash:[1,2],data:[2,6,11,13,18,19],databas:12,date:18,davi:1,david:1,dba:12,dcl:12,debcontrol:12,debian:[1,2,12,23],debiancontrollex:12,debsourc:12,debug:[12,21],debugg:21,dec:2,decid:12,decis:2,decl:12,declar:[0,2,7,12,18],decod:19,decompress:12,decor:[2,18],deepcopi:2,deepli:11,def:[0,2,4,6,7,11,12],default_styl:17,deferrari:1,defin:[0,2,6,7,11,12,14,17,18],definit:[0,2,3,7,11,14,17,18],degener:2,dejan:1,delai:2,deleg:12,delegatinglex:[11,12],delet:[11,18],delimit:[2,7,11,12,18],delphi:[12,23],delphilex:12,delroth:2,demonstr:21,denni:[1,2],depend:[0,7,10,12,17],deploi:10,deriv:[0,2,12],derivedlex:11,describ:[0,7],descript:12,design:12,desir:[5,7],desis:12,detail:[3,11,21,22,23],detect:[2,12],determin:[0,2,12,15],develop:[1,3,12,21,22,23],dglexer:12,dhandler:12,dialect:2,dialectopt:12,dialecttag:12,diamanda:21,dict:[6,18,19],dictionari:[0,7,11],didn:3,diego:1,dietmar:1,diff:[2,11,23],differ:[2,5,7,11,12,15,17,19,21],differenti:12,difflex:[11,12,18],digia:12,direct3d:12,direct:[2,7,11,12,13,16,21],directli:[2,11,12],directori:[0,2,3,11,13,17],disabl:7,disabled_modul:12,disabledmodul:12,disallow:2,disappoint:12,displai:[2,7,16],disrupt:5,distinct:7,distinguish:12,distribut:[2,9,11,13,14,16,17,20],div:[7,10,15],divis:12,django:[12,21,23],djangolex:12,dlexer:12,dmitri:1,do_insert:2,dobjdumplex:12,doc:[2,7,12,17,18,19,21,23],docclass:7,docker:[2,12],dockerfil:12,dockerlex:12,docstr:[2,5],doctest:12,doctyp:[2,7],document:[2,3,7,10,11,12,14,15,18,21,22],docutil:2,doe:[2,7,11,12,19],doesn:[2,3,4,6,7,11,12,14,18],domen:1,dominik:1,don:[0,2,3,6,7,11,12,15,17,18,19,22],done:[2,11],doren:1,dos:12,dosbatch:12,doscon:12,dosini:12,dot:[2,5],dotal:11,dotnet:12,doubl:[5,6,18],doug:1,down:11,download:[8,22],dpast:21,dpatch:12,dpr:12,drawn:7,dreiundzwanzig:2,drop:[0,2,5,17,21],dsrc:12,dtd:[1,2,12,23],dtdlexer:12,dubi:12,dubinska:1,due:[0,2],duel:[1,2,12],duelengin:12,duellex:12,duplic:2,dure:12,durni:1,dustin:1,dutton:1,dyl:12,dylan:[1,2,23],dylanconsolelex:12,dylanlex:12,dylanlidlex:12,dynam:12,each:[7,11,18],earl:12,earlgrei:12,earlgreylex:12,earlier:[7,12],easi:[2,4,6,7,11,22,23],easier:[10,21],easiest:11,easili:[2,6,11,12,16,21,22],easytriev:[1,2,12],easytrievelex:12,eat:[2,5],ebnf:[1,2,12],ebnflex:12,ebuild:12,echdr:12,ecl:2,eclass:12,eclex:12,ecllex:12,ecsrc:12,edg:7,edit:13,edoardo:1,edu:12,edward:1,eed:7,eee:17,eeeeeee:6,effect:7,efford:1,effting:1,egg:11,egorkin:1,eiffel:[1,2],eiffellex:12,either:[2,6,7,11,15,17],element:[7,11,18],elf:12,elia:1,elisp:12,elixir:[1,2,12],elixirconsolelex:12,elixirlex:12,ellipsi:2,elm:[2,23],elmlex:12,els:[6,7,11,12,15,18],elseif:11,emac:[1,2,3,12,17],emacslisplex:12,embed:21,emit:11,emph:18,emphas:18,empti:[2,7,11],emul:17,enabl:[3,7,16],enclos:[3,7,12,18],encod:[2,7,8,10,12,15,17],encount:[11,19],encyclopedia:21,end:[2,4,6,7,11,12,18,21],enforc:5,engin:[2,11,21],english:21,enhanc:[1,2],enough:[7,11,12],enriqu:1,ensur:11,ensurenl:[2,12],enter:[11,12],entir:11,entiti:[11,18],entri:[3,11,15],environ:[2,7,12],envnam:[2,7],eps:12,equal:[2,3,11],equal_sign:11,equival:[0,11,12],erb:[12,23],erblex:12,eric:1,erick:1,erl:12,erlang:[1,2,23],erlanglex:12,erlangshelllex:12,erron:11,error:[0,2,5,7,11,12,17,18,21],error_color:7,errortoken:5,es6:2,escap:[2,7,11,12,15,17,18],escapeinsid:7,escript:12,esoter:[2,11],especi:[12,18],etc:[2,3,5,6,18],eval:[0,11],even:[7,11,12,22],event:12,ever:23,everi:[0,2,5,7,11,15,17,22],everybodi:11,everyth:[11,12,14],evoqu:[1,2,12],evoquehtmllex:12,evoquelex:12,evoquexmllex:12,exact:17,exactli:[0,11],exampl:[0,3,4,5,6,7,10,11,12,13,17,18,19,21],examplefil:11,examplelex:11,excclass:5,except:[0,2,5,7,11,12,17,18],exclud:18,exec:10,exher:12,exhibit:2,exhypotheticlex:11,exist:[2,6,7,11,15,18],exlib:12,expand:[5,12],expans:3,expect:[0,3,11],experi:21,experiment:[2,7],explain:[6,14,15],explan:[3,18],explicit:[3,7],explicitli:[3,11],explor:7,express:[2,11,12,18],exrc:12,exs:12,ext:14,extempor:[1,2,12],extemporelang:12,extend:[2,7,11,12,17],extens:[2,3,11,12,15],extern:[2,7,9,12,13,16],extra:[7,12],extra_keyword:11,extract:[12,14],extrem:11,ezhil:[1,2,23],ezhillex:12,ezt:12,f00:17,f03:12,f90:12,facil:[1,12],fact:[0,12],factor:[1,2,23],factorlex:12,fail:2,failur:2,fallback:12,fallenstein:12,fals:[0,2,5,7,12,18],famili:[2,7],famlii:7,fan:12,fanci:[1,2,12,23],fancylex:12,fancypack:12,fancysrc:12,fancyvrb:7,fantom:[1,2],fantomlex:12,faq:22,far:11,faschingskrapfn:2,fast:[21,22],faster:2,fastest:12,favor:2,favorit:11,fayaa:21,fear:[11,22],featur:[2,7,11,12],feb:2,fed:5,feel:11,felix:1,felixlex:12,fennel:[1,2,12,23],fennellex:12,fernandez:1,few:[2,11,15,17,23],fext:7,ff0000:[6,17],ffffff:17,fhtml:12,ficarra:1,field:12,file:[0,1,2,3,6,7,9,10,11,13,15,17,18,19,21,23],filenam:[0,2,3,7,11,12,13,14,15],filetext:2,filetyp:12,filter:[2,8,12,14,15,18],find:[2,8,11,21],find_lexer_class:0,find_lexer_class_by_nam:[0,2],fine:12,finish:11,first:[0,2,5,6,7,11,12,15,18],firstchild:7,fish:[1,2,12],fisher:1,fishshel:12,fishshelllex:12,fix:[1,2,5,7,11,12,22],fixm:12,flag:[3,5,12,17],flatlin:[1,2,12],flatlinelex:12,flexibl:2,florian:1,fluidic:21,flx:12,flxh:12,fmarc:2,fmter:7,fname:7,fnl:12,fnmatch:0,focus:21,fold:12,follow:[0,3,6,7,10,11,12,15,17,18,19],font:[2,6,7,15],font_nam:7,font_siz:[2,7],fontfac:7,fontfamili:7,fontsiz:7,foo:[2,5,7,11,12,18],foobar:[11,12],foreground:[7,17],forev:2,form:[0,1,3,6,7,11,12,17],formal:12,format:[0,2,3,6,7,15,21,22],formatt:[1,2,8,10,11,14,17,19],formatternam:0,forth:[1,12],forthlex:12,fortran:[1,2,23],fortranfix:12,fortranfixedlex:12,fortranlex:12,forum:22,forward:[5,12],found:[0,2,3,7,9,11,12,15,22],four:[2,15],fourth:15,foxpro:[1,2,23],foxprolex:12,frag:12,fragment:[12,15],frame:2,framework:[1,2,21,23],free:[11,12,21],freenod:22,freepasc:12,freewar:12,friendli:[7,12,17],frit:1,from:[0,1,2,3,4,5,6,7,10,12,13,14,15,16,17,18,19,20],front:21,frt:12,fruiti:2,fsharp:12,fsharplex:12,fsi:12,fuchsia:17,fulfil:11,full:[2,3,7,8,11,12,15],fulli:2,fulton:1,fun:[12,23],func_name_highlight:12,funcnamehighlight:12,funki:11,further:[7,18],furthermor:[12,17],fusesourc:12,futur:[6,12,18],galdino:1,galloi:1,gap:[1,2,12,23],gaplex:12,garg:1,gas:12,gaslex:12,gautier:1,gave:2,gawk:12,gaynor:1,gdc:12,gemfil:12,gemspec:12,gener:[0,2,5,7,11,17,21,22],genshi:[1,12,23],genshilex:12,genshitext:12,genshitextlex:12,gentoo:2,geo:12,georg:[1,22],gerd:1,gerkin:1,gerwin:1,get:[0,2,5,7,10,11,12,13,18,19,20],get_:2,get_all_filt:5,get_all_lex:[0,12],get_all_styl:[0,17],get_bool_opt:[0,4],get_choice_opt:0,get_formatter_by_nam:[0,15],get_formatter_for_filenam:[0,15],get_int_opt:0,get_lexer_by_nam:[0,2,12,14,15],get_lexer_for_filenam:[0,15],get_lexer_for_mimetyp:[0,15],get_list_opt:0,get_style_by_nam:[0,17],get_style_def:[0,2,3,6,7,15],get_syntax_def:7,get_token:[0,2],get_tokens_unprocess:[0,11],getpreferredencod:19,gettext:[2,12,23],gettextlex:12,gherkin:[1,2,12,23],gherkinlex:12,giedriu:1,gif:[2,7],gifimageformatt:7,gilbert:1,gild:1,git:[2,21],github:12,give:[2,3,5,7,11,15],given:[0,2,3,5,7,11,12,15,19],global:[11,18],glshaderlex:12,glsl:[2,12],glslsrc:12,glue:12,gm2:12,gnu:[2,12],gnumakefil:12,gnuplot:[2,12,23],gnuplotlex:12,gobbl:5,gobblefilt:5,goe:11,goetzmann:1,goj:[1,2],golex:12,golo:[2,12],gololex:12,golovizin:1,good:[1,2,6],gooddata:[1,2,12],gooddatacllex:12,googl:[1,2],gordon:1,gosrc:12,goss:1,gosu:[2,12],gosulex:12,gosutemplatelex:12,gotthardt:1,govern:17,gracefulli:2,gradl:12,grai:6,grammar:[11,12],grammar_not:12,graph:21,graphic:7,greater:12,greatli:2,green:17,greg:1,grei:[5,12],groff:[2,12,23],grofflex:12,groovi:[1,2,12,23],groovylex:12,group:11,groupid:10,grow:23,gsp:12,gst:12,gsx:12,guarante:18,guess:[0,2,3,7,12,19],guess_lex:[0,2,15],guess_lexer_for_filenam:[0,15],gui:[12,21],guib:1,guid:[5,12],gvimrc:12,hack:[8,14],hagelberg:1,hahn:1,half:7,haml:[1,2,12],hamllex:12,handl:[0,1,2,7,12,19],handlebar:[2,12],handlebarshtmllex:12,handlebarsj:12,handlebarslex:12,handlecodeblock:12,happen:11,harder:2,harriman:1,harrison:1,has:[0,2,3,4,6,7,9,10,11,12,19],hash:2,hashbang:18,haskel:[1,2,23],haskelllex:12,hatch:[1,2,22],have:[0,2,3,4,5,6,7,8,11,12,13,14,15,17,18,19,21,22],haven:[3,19],hax:[1,2],haxelex:12,haxeml:12,hazel:1,hbs:12,hdl:12,hdp:12,hdr:12,head:[3,11,12,18],header:2,headlin:[11,18],headline_callback:11,height:7,hello:[3,10,15,17],help:[0,11,21,22],helper:[2,11],hendershott:1,hendrick:1,herbstzeitlos:2,here:[6,7,8,9,10,11,14,15,17,20,21,23],heredoc:[2,18],hermoso:1,hess:1,hex:[2,6,12,18],hexadecim:[6,18],hexcat:12,hexdump:[1,2,12],hexdumplex:12,hierarchi:18,high:[12,14],higher:[7,21],highest:[0,15],highlight:[0,2,3,5,7,9,10,11,12,13,14,15,17,18,21,22],highlightt:7,hilit:21,hint:8,hiram:1,hiremath:1,hiroaki:1,histori:12,hl_color:[2,7],hl_line:[2,7],hlsl:[1,2,12,23],hlsli:12,hlslshaderlex:12,hoelz:1,hogan:1,hold:11,holli:1,home:22,hong:1,horizont:7,horn:1,host:[12,21,22],houghton:1,how:[0,2,6,7,8,10,11,12,15,16,17],howard:1,howett:1,howev:[2,7,15,21],hpp:12,hrl:12,hsa:12,hsail:[1,2,12],hsaillex:12,htaccess:12,htdoc:13,htm:[7,11,12],html5:2,html:[0,1,2,3,7,11,13,15,17,18,21,22,23],htmlcheetah:12,htmldjango:12,htmldjangolex:12,htmlformatt:[0,2,6,7,10,15,17,19],htmlgenshilex:12,htmllexer:[11,12],htmlphplexer:[11,12],htmlsmartylex:12,http:[1,2,10,12,20,21,23],httpd:12,httplexer:[2,12],huge:11,human:[0,12],hundr:11,hurl:21,hxml:12,hxmllexer:12,hxsl:12,hxx:12,hyb:12,hybri:[1,2,12],hybrislex:12,hylang:12,hylex:12,hyperlink:7,hypothet:11,hypotheticlex:11,i18n:2,i6t:12,i7x:12,iOS:2,ian:[1,2],icl:12,icu:12,icw:12,idc:12,idea:[2,10],ideal:12,identifi:[0,2,12,18],idl4:12,idl:[1,2,23],idllex:12,idr:12,idri:[1,2,12],idrislex:12,iec:12,ieee:12,ietf:12,iex:12,ignor:[6,7,12],ignorecas:11,igor:[1,2],igorexchang:12,igorlex:12,igorpro:12,ijs:12,imag:[1,2,7,12],image_format:7,image_pad:7,imageformatt:[2,7],img:7,immedi:0,implement:[0,2,6,7,12],implicit:18,imposs:11,improv:[1,2,5,7],inc:[1,12],incl:23,includ:[0,2,3,7,11,13,15,16,19,20,21],inclus:11,incollo:21,incompat:2,incomplet:[2,21],incorrect:2,incorrectli:12,increas:[7,11,22],incred:11,indent:[2,5,7,12],index:[0,7,11,20],indexerror:11,indic:[2,7,11],individu:7,industri:12,inencod:[2,3,19],inf:12,infer:3,inferno:1,infinit:2,influenc:11,info:[8,12],inform6:12,inform6lex:12,inform6templatelex:12,inform7:12,inform7lex:12,inform:[1,2,3,7,11,12,14,15,18],ing:2,inherit:[1,2,11,17],ini:[2,11,12,23],inilex:[11,12],initi:[2,5,6,11],initialis:11,inlin:[2,6,7,15],inlinestyl:13,ino:12,inozemtsev:1,input:[0,2,3,7,11,12,15,19],inputenc:7,insensit:[0,2],insert:[2,11,18],insid:[7,11,18],instal:[2,3,7,8,11,19,21],instanc:[0,2,4,5,10,11,12,13,17,18],instanti:[0,4,6,11],instead:[2,6,7,11,12,15,17,21],instruct:12,instrument:22,int_fict:12,integ:[0,12,18],integr:[2,7,12,21],intel:[2,12],intellig:21,interact:2,interchang:12,interfac:[0,2,8,12],intern:[4,11,15,19],internet:7,interpol:[2,18],interpret:[0,10],intr:12,introduc:[7,11,18],introduct:8,invalid:2,invari:11,invoc:7,iok:[1,2,12],iokelex:12,iokesrc:12,iolang:12,iolex:12,iosrc:12,ipf:12,ipython:2,irb:[12,23],irc:[2,7,12,21,22,23],ircformatt:7,irclog:12,irclogslex:12,irssi:[12,23],is_token_subtyp:18,isabel:[1,2,12],isabellelex:12,isn:[2,5,6,11,12],iso:12,issu:[2,22],ital:[6,7,12,17],italic:7,item:[6,11,14],iter:[0,2,5,6,7,11,17],itoh:1,its:[0,2,11,12,15,17,19],itself:11,ivan:1,jackson:1,jade:[1,12],jag:[1,2,12],jagslex:12,jame:1,jan:2,jann:1,januari:12,jar:10,jarrett:[1,2],jasmin:[1,2,12],jasminlex:12,jasminxt:12,java:[2,8,12,18,21,23],javalex:12,javascript:[2,7,11,18,23],javascriptdjangolex:12,javascripterblex:12,javascriptgenshilex:12,javascriptlex:[2,11,12],javascriptphplex:12,javascriptsmartylex:12,jbst:[1,2,12],jcl:[1,2,12],jcllexer:12,jeffrei:1,jeremi:[1,12],jerith:12,jerom:1,jesper:1,jinja2:2,jinja:[12,23],jlcon:12,jlexer:12,job:12,jochen:1,joe:1,joerg:1,john:1,join:[2,6,22],jon:1,jona:1,jordi:1,jpeg:7,jpg:[2,7],jpgimageformatt:7,jproperti:12,jsgf:[1,2,12],jsgflexer:12,jsm:12,json:[1,2,12],jsonbareobjectlex:12,jsonld:12,jsonldlex:12,jsonlex:12,jsonml:12,jsp:[12,23],jspeech:12,jsplexer:12,julia:[1,2],juliaconsolelex:12,julialex:12,jun:2,just:[2,6,7,11,12,17,18,22],justin:1,juttl:12,juttlelex:12,jython:[2,10,21],kaarsemak:[1,2],kabak:1,kal:[1,2,12],kallex:12,kalnitski:1,kashif:1,kconfig:[1,2,12],kconfiglex:12,keep:[2,7],kei:[0,6,11,12,17],ken:[1,12],kept:11,kernel:12,keyboardinterrupt:2,keyword:[0,2,4,5,6,12,15,17],keywordcas:[3,5],keywordcasefilt:5,kid:12,kif:12,kind:[2,18],kiril:[1,2],kirk:[1,2],kit:1,kki:12,klein:1,knibb:1,know:[2,15,18,21],knowledg:22,known:[0,3,5,11,17,21],koka:[2,12],kokalex:12,koltsov:1,konrad:1,koprowski:1,korean:12,kotlin:[1,2,12],kotlinlex:12,kowarsch:1,krekel:1,kriegisch:1,kristian:1,krzysiek:[1,2],kschutt:12,ksh:12,kubica:[1,2],kumar:1,kupperschmidt:1,kurt:1,kurzbach:1,label:[2,18],lack:23,lagda:12,lang:12,lang_builtin:11,languag:[0,2,11,15,18,22],language_lex:11,larger:[7,13],larim:1,lasso:[1,2,12,23],lassocsslex:12,lassohtmllex:12,lassojavascriptlex:12,lassolex:12,lassoscript:12,lassoxmllex:12,lassu:1,last:[3,6,11,12,19],lasttyp:6,lastval:6,later:[6,7,11],latest:[20,22,23],latex:[1,2,7,12,15,17,21,22],latexformatt:[2,6,7],latin1:[2,3,19],latin:12,latter:[2,6,7],laurent:1,layman:1,layout:12,lazi:12,lcry:12,lcryptol:12,lead:[2,11,12,15],leaf:1,lean:[2,12],leanlex:12,learn:22,ledru:1,lee:1,left:[6,12],length:[7,11,12],lenient:12,less:[2,4,12],lesscss:1,lesscsslex:12,lessfilt:2,let:[6,12,15,22],letter:[5,7,12],level:12,lex:[0,2,11,12,21,22],lexem:12,lexer:[1,2,4,5,6,7,8,10,13,14,17,18,19,21,22,23],lexercontext:11,lexernam:0,lgt:12,lhaskel:12,lhs:12,librari:[2,6,7,9,12,15,19,21,22],licens:[2,18,21],lid:[2,12],lidr:12,lidri:12,life:12,light:[6,7,17],lightbg:7,lightgrai:17,lighti:12,lighttpd:[2,12,23],lighttpdconflex:12,like:[0,2,3,6,7,9,10,11,15,16,18,21,22],limbo:[1,2,12],limbolex:12,linden:12,line:[0,2,5,7,8,11,12,14,18,19,21,22],line_numb:7,line_number_bg:7,line_number_bold:7,line_number_char:7,line_number_fg:7,line_number_ital:7,line_number_pad:7,line_number_separ:7,line_number_start:[2,7],line_number_step:7,line_pad:7,lineanchor:[2,7],lineno:[2,3,7,15],linenospeci:7,linenostart:7,linenostep:7,linenumb:7,linesepar:7,linespan:[2,7],linewis:12,linh:1,link:[2,7,12,21],linux:[12,20],liquid:[2,12],liquidlex:12,lisp:[1,2,12,18,23],list:[0,2,3,5,7,8,12,14,15,20,21,22,23],listen:2,liter:[1,2,6,7,11,12,23],literateagdalex:12,literatecryptollex:12,literatehaskelllex:12,literateidrislex:12,litstyl:12,littl:[2,12],live:12,livescript:[1,2,12],livescriptlex:12,llvm:[2,12,23],llvmlexer:12,load:[0,1,2,3,11,12],load_formatter_from_fil:[0,2],load_lexer_from_fil:[0,2,11],local:[2,3,11,19],locat:2,log:[1,2,12,22,23],logo:[1,2,12],logoslex:12,logtalk:[1,2,12,23],logtalklex:12,longer:[2,11],longest:11,longnam:0,look:[0,3,5,7,8,10,11,12,15,17,18,21,22,23],lookup:[0,11,14],loop:[2,15],lorentz:1,lot:[2,10,11],loui:1,lovelac:[1,2],lower:5,lowercas:[5,12],lsl:[2,12],lsllexer:12,lsp:12,lua:[1,2,12,23],lualex:[11,12],lubomir:1,luca:1,luka:1,m2iso:12,m2pim:12,m2r10:12,mabei:1,mac:[2,12],macarthur:1,machineri:21,macro:[6,7,12],made:[2,11],magic:[2,18],mai:[0,2,3,5,7,11,12,15,17,23],mail:[21,22],main:[2,3,7,11,12,20],mainfram:12,mainli:12,maintain:[1,17,22],major:[1,2,20],mak:12,make:[2,4,7,10,11,12,15,17,19],makefil:[2,23],makefilelex:12,mako:[1,2,12,23],makocsslex:12,makohtmllex:12,makojavascriptlex:12,makolex:12,makoxmllex:12,malform:12,malzeug:2,man:12,manag:[12,20,21],mandatori:0,mandel:1,mani:[1,2,7,11,16,17,22],manpag:[2,12],manual:12,mao:12,map:[2,7,11,12,13,15,17],mapfil:11,maql:[1,12],maqllex:12,mar:2,marchand:1,marek:[1,2],margaritelli:1,margin:7,mario:1,mark:[1,5,11,18],markdown:[1,2,12],markdownlex:12,marker:12,markup:[2,6,7,13,15,18,21],martin:1,mask:12,maskj:[1,2],masklex:12,mason:[1,2,12,23],masonlex:12,master:12,match:[0,2,11,12,15,18],math:[2,7,12],mathematica:[2,12],mathematicalex:12,mathescap:7,matlab:[1,2,23],matlablex:12,matlabsess:12,matlabsessionlex:12,matt:[1,2],matteo:1,matter:14,matthew:1,matthia:[1,12],mauricio:1,maven:10,mawk:12,max:1,maxim:12,maximum:11,mayb:12,mcdonald:[1,2],mcgregor:1,mckamei:1,mckenna:1,mclaughlin:1,mean:[0,2,3,5,7,11,12,14,16,19,21],meant:18,mechan:[0,7,15,22],media:2,member:[11,12],mention:14,menu:9,menuconfig:12,mercuri:[20,21,22],merg:[2,5,11],messag:18,meta:[7,12],metacharact:11,metaclass:[0,6],metadata:14,metamodel:12,method:[0,2,3,4,5,6,7,11,12,15,18],meuser:1,mher:1,mhtml:12,michael:1,michiel:1,microsoft:7,middl:5,might:[6,11,12,17,19],miikka:1,mike:1,miller:1,mime:[0,2,12],mimetyp:[0,2,12],minhe:1,minid:[1,2,12,23],minidlex:12,minidsrc:12,minim:[6,12],minor:2,mior:1,mirc:1,misc:2,misdetect:2,mishandl:2,mishighlight:2,miss:[2,11,12],mit:12,mitchen:1,mixtur:12,mli:12,mll:12,mly:12,mma:12,mod:12,mode:[2,7,12],modelica:[1,2,12,23],modelicalex:12,modelin:[1,2],modelvers:10,modif:11,modifi:[0,7,15],modul:[0,2,4,5,7,11,12,14,15,18],modula2:12,modula2lex:12,modula:[1,2,23],modulo:12,mof:12,moin:[2,12,13],moinmoin:[2,8,12,23],moinwikilex:12,mondrian:17,mondrianstyl:17,monkei:[2,12],monkeylex:12,mono:[2,7],monofont:7,monokai:[1,2],monospac:7,mont:[1,2],montelex:12,moo:12,moocod:[1,2,12],moocodelex:12,moon:12,moonscript:[1,2,12],moonscriptlex:12,morai:1,more:[2,3,6,7,10,11,12,15,22],morton:1,most:[0,2,6,7,11,12,17,20,22],moura:1,movsisyan:1,mozhashpreproc:12,mozilla:[2,12],mozpercentpreproc:12,mozpreproc:12,mozpreproccsslex:12,mozpreprochashlex:12,mozpreprocjavascriptlex:12,mozpreprocpercentlex:12,mozpreprocxullex:12,mq4:12,mq5:12,mqh:12,mql4:12,mql5:12,mql:[2,12],mqllexer:12,msc:12,mscgen:[1,2,12],mscgenlex:12,msdo:[1,2,12],msdossessionlex:12,much:[2,11,12],muhamedag:1,multi:[2,11,18],multilin:[2,11,18],multipl:[2,7,12],mupad:[1,2,12,23],mupadlex:12,must:[0,3,5,6,7,11,12,15,17],muthiah:1,mxml:[1,2],mxmllexer:12,myghti:[1,2,12,23],myghtycsslex:12,myghtyhtmllex:12,myghtyjavascriptlex:12,myghtylex:12,myghtyxmllex:12,mygthi:12,mylex:11,mynewlex:11,mypythonlex:11,mysql:[2,12,23],mysqllex:12,mystyl:17,myt:12,nafu:7,nam:1,name:[0,2,4,5,7,11,12,13,14,15,17],namehighlightfilt:[2,5],namespac:[1,2,18],nasm:[2,12],nasmlex:12,nasmobjdumplex:12,nathan:1,nativ:[7,12],naveen:1,nawk:12,nbp:12,nbsp:18,ncar:2,ncl:12,ncllexer:12,nearest:7,necessari:7,need:[0,2,4,6,7,11,12,14,15,21,22],needl:11,nelson:[1,2],nemerl:[1,2,12,23],nemerlelex:12,neo4j:12,nesc:[1,2,12],nesclex:12,nescsrc:12,nest:[2,11,12],net:[2,22,23],network:22,neufeld:1,neujahr:2,never:11,nevertheless:11,new_stat:11,newest:2,newli:[11,18],newlin:[2,5,7,11,12],newlisp:[2,12],newlisplex:12,newspeak:[2,12],newspeaklanguag:12,newspeaklex:12,next:[11,12],ng2:12,nginx:[2,12,23],nginxconflex:[2,12],nguyen:1,nick:1,nil:[1,12],nimrod:[1,2,23],nimrodlex:12,nit:[1,2],nitlex:12,nix:[1,2,7],nixlex:12,nobackground:7,nobodi:18,nobold:17,noclass:[2,7],noclobber_cssfil:[2,7],noehr:1,noinherit:17,noital:17,nolta:1,non:[2,3,7,11,17,19],none:[0,4,6,7,11,12,18],nonempti:7,nontermin:12,nonzero:5,normal:[0,3,4,5,11,12,18],norman:1,north:1,notabl:12,note:[4,5,7,11,12,14,15,17,18,19,23],notebook:2,noth:11,notifi:22,nounderlin:17,nov:2,now:[2,7,11,12,19],nowrap:7,nprint:15,nqp:12,nresult:10,nroff:12,ns2:12,nsh:12,nsi:[2,12],nsislex:12,nth:7,nullformatt:[6,7],number:[2,3,5,6,7,11,12,15,17,18,21,22],numer:[2,12],numpi:[1,2,12],numpylex:12,nusmv:[1,2,12],nusmvlex:12,nvidia:12,obei:7,obj:12,objc:[2,12],objdumb:12,objdump:[2,12],objdumplex:12,object:[0,1,2,5,6,7,11,15,18,19,23],objectivec:[1,2,12],objectiveclex:12,objectivecpplex:12,objectivej:12,objectivejlex:12,objectpasc:12,objj:12,objm2:12,obrist:1,obviou:11,ocaml:[2,12,23],ocamllex:12,occasion:19,occur:11,oct:[2,18],octal:18,octav:[1,2,12,23],octavelex:12,odbc:12,odd:2,odin:12,odinlex:12,off:[0,5,12],offload:2,offset:7,often:[11,16],old:[2,18],oldhtmlformatt:6,oleh:1,oliva:1,olivi:1,olov:1,omg:12,omit:3,onclick:7,one:[0,2,3,5,6,7,11,12,15,17,19],ones:[0,11,12],onli:[0,2,3,7,11,12,15,18,21],onlin:20,onto:11,ooc:2,ooclex:12,opa:[1,2,12],opalang:12,opalex:12,open:[6,11,14,22],openbug:12,opencobol:[1,2,12],openedg:[1,2,12],openedgelex:12,opengl:12,openingcommentdelim:12,oper:[1,2,11,17],optim:[2,11],option:[1,2,4,5,6,9,11,12,13,17,19],optionerror:0,optnam:0,orc:12,orchestra:12,order:[2,12,15,21],ordinari:12,org:[1,2,10,12,20,22],origin:[2,12],other:[1,2,7,11,13,17,18,19,21,22],otherlex:11,otherst:11,otherwis:[0,7,11,12],our:22,out:[2,3,5,10],outencod:[2,3,7,19],outfil:[0,6,7,15],outlin:21,output:[0,2,3,4,5,6,7,11,13,15,18,19,21,22],outsid:[11,12],over:[0,2,6,7,11,15,17,22],overhaul:1,overload:18,overrid:[0,2,3,4,6,7,11,12,19],overridden:0,overview:[15,17],overwrit:6,overwritten:7,owen:1,own:[0,5,7,8,18,23],oxford:1,ozarowski:2,p6l:12,p6m:12,pace:22,pacemak:12,packag:[2,7,11,18],pacman:12,pacmanconf:12,pacmanconflex:12,pad:7,page:[0,2,7,10,11,12,13,14,15,23],paid:22,paint:21,pair:[0,11],pan:[2,12],panlex:12,pannuto:1,paper:12,paramet:[6,11],parasail:[1,2],parasaillex:12,parent:[6,11,18],parenthesi:11,paris:1,pars:[2,6,12,21],parser:[2,13,18],part:[6,11,12,18],partial:2,particular:[3,7,12],partner:12,pas:[3,12],pascal:[2,3,5],pass:[2,3,4,6,7,11,12,15,17,19],past:[7,12],pastebin:[12,21],pastebox:21,pat:1,patch:[1,2,18],path:[7,11,12,18,21],patrick:1,pattern:[0,2,7,11,14,15],patx:21,paul:1,paulo:1,pawn:2,pawnlex:12,pcmk:12,pdf:[12,21],peculiar:2,pekka:1,peopl:16,pep:2,pepijn:1,per:[2,3,12,17,19],percent:12,perfect:7,perform:[2,11,12,18],perl6:12,perl6lex:12,perl:[1,2,15,18,22,23],perllex:[12,15],permit:12,persist:12,pete:1,peterson:1,pfannschmidt:1,pgsql:12,phil:1,philosophi:17,php3:12,php4:12,php5:12,php:[1,2,9,11,18,21,23],phpbb:7,phplexer:[11,12],phpygment:[9,21],phtml:12,picheta:1,pick:7,pida:21,piec:[7,15],pierr:[1,2],pig:[1,2,12],piglex:12,pigment:21,pike:[1,2,12],pikelex:12,pil:[2,7],pilcrow:5,pim:12,pinkham:1,piotr:2,pip:20,pipe:[12,15],pixel:7,pixmap:7,pkg:12,pkg_resourc:2,pkgbuild:12,pkgconfig:12,pkgconfiglex:12,pl6:12,place:[2,12,20,22],plain:[2,12,15],platform:[12,20,21],pleas:[7,8,14,21],plot:2,plpgsql:12,plpgsqllexer:12,plrm:12,plt:12,plu:[2,7,11,12,23],plugin:[8,12,13,17,21],pm6:12,pmod:12,png:[2,7],pocoo:22,pod:2,point:[5,7,11],polici:12,pom:10,pop:11,popular:12,port:2,pos:11,posh:12,posit:[0,2,11],possibl:[2,6,7,10,11,12,15,18,19,21],post:7,postgr:12,postgresconsolelex:12,postgreslex:12,postgresql:[1,2,12],postmarkup:21,postscr:12,postscript:[1,2,12,23],postscriptlex:12,pot:12,pov:[2,12,23],povrai:[12,23],povraylex:12,power:[11,21],powershel:[1,2,12,23],powershelllex:12,powershellsessionlex:12,praat:[1,2],praatlex:12,pre:[2,6,7,10,12,15],preambl:7,preced:[2,11],prefer:11,prefix:[2,7,11,12,14,18],preimplement:11,prepar:11,prepend:[3,7],preproc:18,preprocess:12,preprocessor:[2,9,11,12,18],present:[2,12,21],preserv:7,prestyl:[2,7],prettifi:22,prevent:[11,17],previou:11,previous:2,prg:12,primari:[12,15,22],primit:12,principl:18,print:[3,7,10,12,15,17,18,21],printabl:12,println:10,privaci:21,pro:[1,2],probabl:[0,4,12],problem:[2,7],proc:12,procedur:[2,11,12],process:[2,3,11],processor:[1,2,9],produc:[0,2,7,11,12,15],profil:12,progopedia:21,program:[2,16,18,22],progress:12,project:[2,10,12,21,22],prolog:[2,23],prologlex:12,prompt:[2,12,18],proof:12,proper:11,properli:[2,21],properti:[2,7,12],propertieslex:12,propos:18,proprietari:12,proto:2,protobuf:12,protobuflex:12,protocol:[1,2,12],prototyp:12,prover:12,provid:[0,2,3,6,7,9,11,12,17],prs:12,prynn:1,prypin:1,ps1:12,ps1con:12,psc:12,pseudo:[11,12,18],psi:12,psl:12,psm1:12,psql:12,pth:2,publicli:11,publish:12,pudb:21,pug:12,puglex:12,pull:[2,22],pumbaa80:2,punctuat:12,puppet:[1,2,12],puppetlex:12,pure:12,purpl:17,purpos:[6,12,15],push:11,put:[7,11,12,13,17],pwn:12,pxd:12,pxi:12,py3:12,py3tb:12,pybtex:12,pycon:12,pygment:[1,3,4,5,6,7,11,14,15,17,18,19,20,22,23],pykleur:2,pypi:[1,2,7,12,20],pypylog:12,pypyloglex:12,pyrex:12,pytb:12,python3:[2,12],python3lex:[12,17],python3tracebacklex:[2,12],python:[1,2,3,7,9,10,11,13,15,16,18,20,21,22,23],pythonconsolelex:[2,12],pythoninterpret:10,pythonlex:[5,10,11,12,15,19],pythontracebacklex:[2,12],pyw:12,pyx:12,qbasic:[2,12],qbasiclex:12,qbs:12,qbzr:21,qdeclarativeintroduct:12,qml:[1,2,12],qmllexer:12,qualifi:12,qualiti:22,quickstart:[2,8],quit:[2,4,7,21,22],quot:[2,3,10,15,18],quotat:5,qvt:[1,2],qvto:12,qvtolex:12,r10:12,r5r:12,rabel:1,racket:[1,2,12],racketlex:12,ragel:[1,2,12,23],ragelclex:12,ragelcpplex:12,rageldlex:12,ragelembeddedlex:12,rageljavalex:12,ragellex:12,ragelobjectiveclex:12,ragelrubylex:12,rai:[2,23],raichoo:1,rainbow:[1,2],rais:[0,2,5,7,12],raiseonerror:5,raiseonerrortokenfilt:[2,5],rake:12,rakefil:12,rang:[0,12,21,22,23],rasul:1,rather:11,raw:[2,7,12,18],rawtokenformatt:[2,7,12],rawtokenlex:[7,12],raytrac:12,rbcon:12,rbnf:12,rbw:12,rbx:12,rconsol:12,rconsolelex:12,rdlexer:12,rdoc:2,read:[7,11,12,22],readabl:0,readili:6,realli:[7,11,12,14,18],reason:12,reb:12,rebol:[1,2,23],rebollex:12,rebuild:11,receiv:2,recent:12,recogn:[0,2,3,11,12],recognis:[7,12,18],recommend:[7,20],recreat:12,recurs:11,red:[2,6,7,12,15,17,23],redcod:[1,2,12,23],redcodelex:12,redlex:12,redund:15,reed:1,refactor:1,refer:[2,4,6,7,8,11,12,15],reg:12,regard:3,regedit:12,regeditlex:12,regex:[2,18,22],regist:[0,2,4,5,8,12,13,17],registri:[2,12],regress:2,regular:[2,7,11,18,19],reidi:1,rel:[0,3,7,11],relas:2,relaxng:12,releas:[2,20,22,23],reli:14,remov:[2,7,11],renam:13,render:[2,7,9,11,12,17],renviron:12,repeat:11,repl:12,replac:[2,5,7,11],report:12,repositori:[21,22],repr:7,repres:[15,18],represent:7,request:[2,7,21,22],requir:[2,11,12,14,22],requiredelimit:12,research:12,reserv:[12,18],resolv:11,resort:[3,19],resourcebundl:[2,12],resourcelex:12,respect:[2,7,17],respons:13,rest:[2,5,8,11,12,22,23],restrict:12,restructur:2,restructuredtext:[2,12,21],result:[0,2,7,10,11,12,15,17,19],retain:2,reuben:1,review:21,revis:12,rewrit:[1,2],rewritten:12,rewrot:2,rex:12,rexx:[1,2,12],rexxlex:12,rgb:17,rhistori:12,rhtml:12,rhtmllexer:12,richard:1,richardson:1,right:[5,19],rigor:12,rintel:1,rkt:12,rktd:12,rktl:12,rnc:12,rnccompactlex:12,rng:12,rob:1,roberg:[1,2],robert:1,roboconf:[1,2],roboconfgraphlex:12,roboconfinstanceslex:12,robot:[1,2,23],robotframework:12,robotframeworklex:12,roff:12,rolling:1,roman:2,ronach:[1,22],ronni:1,roo:1,root:[7,11,12],root_lex:11,roughli:7,rout:12,roux:21,row:7,rpf:12,rpm:[2,12,23],rpmspeclex:12,rprofil:12,rql:[2,12],rqllexer:12,rrggbb:6,rrt:2,rsl:[1,2,12],rsllexer:12,rss:12,rst2pdf:21,rst:[12,16,18],rstlexer:12,rtf:[1,2,7,12,15,21,22],rtfformatt:7,rts:12,rtslexer:12,rubi:[1,2,9,11,18,21,23],rubiniu:12,rubyconsolelex:[2,12],rubylex:[12,15],rudolph:1,ruggier:1,rule:[2,3,7,11,12,13,18],run:[0,7,10,11,12,21],runtim:10,runtimeerror:[7,18],rust:[1,2,23],rustlex:12,rvt:12,sage:12,salminen:1,salt:12,saltstack:12,sam:1,same:[2,3,5,6,7,11,12,17,18],sampl:[9,11,13,16],samplemanag:12,san:[2,7],sandalski:1,sane:7,sap:12,sas:12,saslex:12,sass:[1,2,12],sasslex:12,sasso:1,save:[2,11],sbl:12,scala:[1,2,12,23],scalalex:12,scalat:12,scaml:[1,12],scamllex:12,scd:12,sce:12,scenario:8,scene:[2,23],schafer:1,schemaloc:10,scheme:[1,2,12,23],schemelex:12,schutt:[1,12],schwaiger:1,schweizer:1,schweyer:1,sci:12,scientif:12,scilab:[1,2,12,23],scilablex:12,scm:12,sco:12,sconscript:12,sconstruct:12,scope:[10,21],score:12,screen:13,script:[2,3,11,14,15,16,21,23],scss:[2,12],scsslexer:12,search:[2,11],sebastian:1,second:[2,11,12],secondari:15,section:[11,21],see:[0,2,3,5,6,7,11,12,15,17,19,21,22],seem:11,seen:3,sel4:12,select:[0,2,3,7,11,12,15],selector:[2,3,7,15],self:[0,4,6,7,11,12,18],semant:15,semicolon:2,send:[6,11,12,19,22],sensit:2,sep:2,separ:[2,3,7,11,12],sequenc:[0,2,7,15,17,18,21,22],sequenti:12,serial:12,server:[2,12,23],servic:[1,21],session:[1,2,23],set:[2,6,7,9,10,11,12,13,15,17,18,19],setup:3,setuptool:14,sever:[2,11,12],shade:17,shader:[12,23],shadow:12,share:21,shaw:1,sheet:[3,12],shell:[1,2,3,21,23],shellscript:12,shellsess:[1,12],shellsessionlex:2,shen:[1,2,12],shenlex:12,ship:[6,9,11,13,16,17],shorten:12,should:[0,2,5,6,7,11,12,13,14,17],shouldn:[2,11],show:[2,7,11,12],shown:[7,11],siafoo:21,sieker:1,sig:12,sign:[2,3,5,11],signatur:18,sil:12,silver:[2,12],silverlex:12,similar:[2,11,15,18],simmon:1,simon:1,simonov:[1,2],simpl:[2,9,10,11,22],simplefilt:4,simpli:11,simplifi:2,simplist:12,simpson:1,sinc:[0,2,3,4,7,9,10,11,12,15,17,19],sing:1,singl:[2,11,18,19],singlelin:11,singleton:18,site:21,size:[6,7],skip:11,slash:[11,14],slexer:12,slightli:2,slim:[2,12],slimlex:12,slowdown:12,slowish:2,sls:12,smali:[1,2,12],smalilex:12,small:[2,12,15,17],smaller:2,smalltalk:[1,2,23],smalltalklex:12,smart:[3,19],smarter:2,smarti:[12,23],smartylex:12,smishlajev:1,sml:12,smllexer:[11,12],snapshot:10,snippet:[12,15,16,17,21],snobol4:12,snobol:[1,2,23],snobollex:12,snowbal:[1,2,12],snowballlex:12,softwar:[1,12],solvabl:11,some:[0,2,4,6,7,11,12,15,17,18,21],somelex:[3,11],someth:[6,10,11,15,18],sometim:[7,11],somewhat:12,sound:11,sourc:[1,2,5,7,9,11,13,14,15,16,19,21,22],sourcecod:[2,7,12,16],sourcepawn:[1,2,12],sourcepawnlex:12,sourceslist:12,sourceslistlex:12,space:[2,3,5,7,11,12,17,23],spacehack:7,spam:[11,15],span:[2,3,7,10,15],sparql:[1,2,12],sparqllex:12,spec:[2,12,23],special:[2,3,5,7,11,18,22],specif:[2,3,11],specifi:[0,3,6,7,11,12,17,18],speed:2,spell:11,sphinx:[2,21],spigarelli:1,spitfir:[2,12],split:[0,2,3,15,17,18],splitlin:2,splu:12,spt:12,sql:[1,2,23],sqlite3:[2,12],sqlite:23,sqliteconsolelex:12,sqllexer:12,squeak:12,squid:[1,2,12,23],squidconf:12,squidconflex:12,src:12,ssp:[2,12],ssplexer:12,stabl:22,stack:11,stan:[1,2,12],stand:21,standalon:10,standard:[0,1,2,3,6,7,12,15,21],standard_typ:18,standardml:12,stanlex:12,stap:1,star:11,start:[0,2,6,7,8,11,12,18],starter:11,startinlin:12,stata:[1,2],statalex:12,state1:11,state2:11,state:[2,12],statement:[0,2,12],staticmethod:0,statist:2,statu:12,stdin:12,stdout:[3,19],stefan:[1,12],step:[7,11,21],stepan:1,stephen:1,steve:1,steven:1,still:[2,7,11,18,19],stingrai:12,stolen:12,store:[7,11,21],stou:1,strachan:1,straightforward:6,strang:11,stream:[0,2,3,4,5,6,7,12,15,19],strict:2,string:[0,2,3,5,6,7,10,11,12,15,17,18,19],string_to_tokentyp:18,stringio:7,strip:[11,12,15],stripal:[0,12,15],stripnl:[0,2,12],strong:18,strongli:12,structur:12,stuart:1,studio:[2,12],stuff:7,style:[0,1,2,5,7,8,11,14,15,18,23],style_map:[0,17],stylebegin:6,styleend:6,styleguid:5,stylemap:6,stylenameclass:17,stylesheet:[2,3,7,13,15],styleshet:12,subclass:[0,2,7,12,17],subdirectori:13,subhead:[11,18],subheadlin:18,subpackag:[2,17],subsequ:[0,7,12],subset:12,subsystem:12,subtoken:17,subtyp:18,successor:[21,23],suffix:[2,11],suggest:8,suit:[1,2,11],suitabl:[0,2,7,22],sullivan:1,supercollid:[1,2],supercolliderlex:12,superset:12,supertoken:17,suppli:18,support:[1,2,3,6,7,11,12,15,16,17,18,22],suppos:[7,15],suppress:2,sure:[3,11,12,22],surpris:2,sven:1,svg:[1,2,7,12],svgformatt:7,svh:12,svn:12,swallow:2,swg:12,swift:[1,2,12],swiftlex:12,swig:[1,2,12],swiglex:12,sybas:12,sylvestr:1,symbol:[2,12,18],synonym:11,syntact:[18,21],syntax:[2,3,7,11,17,18,21,22],syntaxerror:2,sys:[3,19],system:[3,7,10,11,20],systemverilog:[1,2,12],systemveriloglex:12,sysutil:12,tab:[2,5,7,12],tabl:[2,7],tabsiz:[0,5,12],tac:12,tad:[1,2,12],tads3:12,tads3lex:12,tag:[2,3,5,6,7,11,12,15,18],tagsfil:7,tagurlformat:7,tail:12,take:[0,2,5,7,11,12,15,20,21,22,23],taken:[0,2,12],tamil:[12,23],tango:[1,2],tanner:1,tap:[1,12],taplex:12,tarbal:[2,11],target:12,task:12,tasm:12,tasmlex:12,tassilo:1,tcl:[1,2,23],tcllexer:12,tcsh:[1,2,12,23],tcshcon:12,tcshlexer:12,tcshsessionlex:12,tea:[1,2,12,23],teal:17,team:[8,12,17,22],teatemplatelex:12,techniqu:11,ted:1,tell:[7,11],templat:[0,2,11,15],tenani:1,teng:[1,2],term:[2,11,15],termcap:12,termcaplex:12,termin:[1,2,3,7,12,15,19],terminal16m:7,terminal256:[1,2,7],terminal256formatt:[7,17],terminalformatt:[2,3,7],terminaltruecolorformatt:7,terminfo:12,terminfolex:12,ternari:2,terraform:[1,2,12],terraformi:12,terraformlex:12,test:[1,2,3,15,18],testcas:7,testcaseformatt:7,tex:[7,12,23],texcom:7,texlex:12,text:[0,2,3,7,11,15,16,17,18,19,21,22],textedit:12,textfmt:12,textlex:12,than:[2,9,11,17],thank:[1,2,7,10],thei:[0,2,6,7,11,12,14,15,17,18],them:[0,2,5,7,11,12,15,18,21,22,23],theme:[2,17],themselv:11,theori:7,therefor:[3,7,12],thi:[0,2,3,5,6,7,10,11,12,13,14,15,16,17,18,19,20,22,23],thing:11,think:[0,19],third:11,thoma:1,thoroughli:21,those:[6,11,12,14,18],though:[12,21],three:2,thrift:[1,2,12],thriftlex:12,through:[3,11,15],thu:[7,17],thurgood:[1,12],thy:12,tiberiu:[1,2],ticket:[2,22],tiffin:1,tim:[1,2,22],time:[2,7,11],timhatch:1,timothi:1,titl:[0,7],tmp:11,tmpl:12,toc:12,todo:[2,5,12],todotxt:12,todotxtlex:12,togeth:[7,12,15],toggl:7,token:[0,2,3,4,5,6,7,8,12,15,17],token_typ:6,tokenmerg:5,tokenmergefilt:5,tokensourc:[0,6],tokenstr:7,tokentyp:[0,5,7,11],tolbert:1,toler:11,tom:1,too:[2,3,11,12],tool:[2,12,21,22],top:[7,11,13],toplevel:11,topmost:11,total:[5,11],totaldownload:12,tpl:12,trac:[2,12,21,23],traceback:[1,2,12,18,23],tracker:[2,21,22],traffic:12,trafficscript:1,trail:[12,15],trailer:2,trait:12,transact:[1,12],transactsqllex:12,transcript:12,transform:12,translat:2,transpar:17,treat:17,treat_stdlib_adts_as_builtin:12,tree:12,treetop:[1,2,12],treetoplex:12,trevor:1,tri:[2,3,11,19],trick:[8,15],tricki:11,trigger:7,troff:12,trust:11,trute:1,tryzelaar:1,tspan:7,tsql:12,tst:12,tsx:12,ttl:12,ttype:[4,6],tupl:[0,6,7,11,12],turbo:12,turbopasc:12,turn:12,turquois:17,turtl:[1,2,12],turtlelex:12,tutori:10,twig:[2,12],twightmllex:12,twiglex:12,two:[6,7,11,12,15],twowaybind:12,txt:[2,7,12],type:[0,2,5,6,7,11,12,15,17,18],typescript:[1,2,12],typescriptlex:12,typeset:[7,12],typic:12,typo3:12,typo3cm:12,typoscript:[1,2],typoscriptcssdata:12,typoscriptcssdatalex:12,typoscripthtmldata:12,typoscripthtmldatalex:12,typoscriptlex:12,typoscriptrefer:12,udalov:1,udiff:[2,12],unabl:11,unbalanc:12,unchang:7,uncolor:4,uncolorfilt:4,under:[11,20,21],underlin:[6,7,12,17],underscor:2,understand:14,undocu:12,unexpect:19,unfold:12,unfortun:11,unhandl:12,unicod:[2,5,7,8,11,12,15],unicodedecodeerror:19,unicodeerror:2,unicodelevel:12,unifi:[2,12],uniqu:[0,15],unistr:2,unit:[2,12],univers:[1,21],unix:12,unknown:12,unless:7,unlex:12,unlimit:18,unmatch:12,unmodifi:11,unnecessari:11,unnecessarili:12,unpack:11,unquot:2,unsign:2,unstyl:18,until:11,untouch:12,unus:18,updat:[1,2,12],upper:[3,5],uppercas:[5,15,18],urbi:12,urbiscript:[1,2],urbiscriptlex:12,usabl:[0,6,17,21,22],usag:[0,3,21],use:[2,3,4,5,6,7,10,11,12,13,14,15,16,17,18,19,22],used:[0,2,3,4,5,6,7,11,12,13,14,15,17,18,21],useful:[2,5,7,12,18,21],usepackag:7,user:[0,7,9,12],uses:[0,2,4,7,9,10,11,15],usesyslog:12,using:[0,2,3,4,7,11,12,15,16,17,18,19,20,21],usr:15,usual:[7,15,20],utf8:2,utf:[2,7,10,12,19],util:[0,2,4,21],v4_0_0:10,vala:[1,2,12,23],valalex:12,valentin:1,valid:[0,12,21],vallentin:1,valu:[0,2,3,4,5,6,7,11,12,14,17,18],valueerror:2,van:1,vapi:12,vari:17,variabl:[2,7,10,11,12,18],variant:[12,17],varieti:17,variou:[0,2,8,23],vark:12,varnish:[1,2],varrazzo:1,varun:1,vba:12,vbnet:12,vbnetaspxlex:12,vbnetlex:12,vcl:12,vcllexer:12,vclsnippet:12,vclsnippetlex:12,vclsrc:12,vctreestatu:12,vctreestatuslex:12,veloc:12,velocityhtmllex:12,velocitylex:12,velocityxmllex:12,vera:7,verbatim:[2,7],verbopt:7,verbosepkglist:12,veri:[0,4,11,12,22],verilog:[2,12,23],veriloglex:12,version:[0,3,4,5,7,10,11,12,15,17,18,19,21,23],vert:12,vfp:12,vgl:[1,2,12],vgllexer:12,vhd:12,vhdl:[1,2,12,23],vhdllexer:12,via:[7,9,12,19],view:[11,12,22],viewer:[7,21],viewvc:21,vim:[1,2,12,23],viml:12,vimlex:12,vimrc:12,vincent:1,vinot:1,visibl:[2,5],visiblewhitespacefilt:[2,5,18],vision:12,visit:15,visual:[1,2,23],vnd:12,voelker:1,volunt:22,vpr:12,wai:[2,7,11,17,18,19],wait:21,want:[3,5,7,10,11,12,13,14,15,17,18],wasn:11,watch:23,wavemetr:12,wdiff:[1,2,12],wdifflex:12,web:[11,21],webmisc:12,websit:2,weechat:[2,12],weechatlog:12,weight:[7,15],weizenbaum:1,welcom:15,well:[2,6,7,12,21,23],were:[2,14],what:[2,3,15],when:[2,5,7,11,12,15,17,22],where:[0,6,7,11,13,15,17,22],whether:[0,2,7],whetsel:1,which:[0,2,3,5,7,10,11,12,14,15,17,18,19,20],whilei:[1,2],whileylex:12,white:17,whitespac:[0,2,5,7,11,12,15,17,18],whitnei:1,whole:[6,7,11],whose:[2,12,13,15],why:[4,21,23],wide:[12,21,22],width:7,wiki:[2,12,13,21,22,23],wikipedia:21,wildcard:3,william:1,willing:13,winbatch:12,winbug:12,window:[2,7,12,23],winkler:1,winner:2,winston:2,winter:[1,12],wish:21,within:[0,7,12],without:[0,2,7,11,12,14,18],wlua:12,wolfram:12,won:[3,4,7,11],word:[2,3,5,7,11,12,18],wordpress:21,work:[2,3,5,7,10,11,12,15,17,20],workaround:7,world:[3,10,15,17],would:[5,6,7,10,11,12,18],wouldn:7,wppygment:21,wpygment:21,wrap:[2,6,7,15],wrapper:[2,7,21],write:[0,2,5,7,8,12,14,15,18,19,21,23],written:[0,1,2,3,7,11,14,15,17,19,21],wrong:19,wsdl:12,wsf:12,wstokentyp:5,www:[10,12],wxhtmlpygment:21,wybir:1,x10:1,x10lexer:12,x1b:17,x1z:12,xbase:12,xchat:[2,12],xcode:2,xds:12,xhtml:[12,21],xmi:12,xml:[2,7,10,18,23],xmldjangolex:12,xmlerblex:12,xmllexer:12,xmln:10,xmlphplexer:12,xmlschema:10,xmlsmartylex:12,xoffset:7,xorglex:12,xpl:12,xql:12,xqm:12,xqueri:[1,2,12,23],xquerylex:12,xqy:12,xsd:[10,12],xsi:10,xsl:12,xslt:[1,2,12,23],xsltlexer:12,xten:12,xtend:[1,2,12],xtendlex:12,xtlang:12,xtlanglex:12,xtm:12,xul:12,xwiki:21,xxd:12,xxx:5,yai:2,yaml:[1,2,12,23],yamljinjalex:12,yamllex:12,yellow:17,yes:[0,11],yet:[2,3],yield:[0,2,4,6,7,11,12],yml:12,yoffset:7,you:[0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22],young:1,your:[3,5,7,8,9,12,13,14,16,17,18,22,23],your_formatt:3,your_lex:[3,11],your_lexer_fil:11,your_named_lex:11,yourapp:17,yourfilt:14,yourformatt:14,yourlex:14,yourmodul:[14,17],yourself:[11,21],yourstyl:[14,17],ystep:7,zamboni:1,zamudio:1,zeitdilat:2,zep:12,zephir:[12,23],zephirlex:12,zero:12,zerodivisionerror:12,zimin:1,zimmerman:1,zimtstern:2,zip:12,zsh:12,zshrc:12,zurczak:1},titles:["The full Pygments API","Full contributor list","Pygments changelog","Command Line Interface","Write your own filter","Filters","Write your own formatter","Available formatters","Pygments documentation","Using Pygments in various scenarios","Use Pygments in Java","Write your own lexer","Available lexers","Using Pygments with MoinMoin","Register Plugins","Introduction and Quickstart","Using Pygments in ReST documents","Styles","Builtin Tokens","Unicode and Encodings","Download and installation","Pygments FAQ","Welcome!","Supported languages"],titleterms:{"0rc1":2,"6rc1":2,"class":[7,11],"new":[11,21],Adding:11,RTS:12,SAS:12,The:[0,11,14,22],Use:[10,14],Using:[4,9,11,13,16],actionscript:12,advanc:11,algebra:12,all:[12,23],ambienttalk:12,ampl:12,api:0,apl:12,archetyp:12,architectur:15,assembl:12,author:22,autom:12,avail:[7,12,17],bash:9,basic:12,bibliographi:12,bibtex:12,bnf:12,bug:21,builtin:[5,17,18],busi:12,callback:11,can:21,cap:12,chang:11,changelog:2,chapel:12,clean:12,code:12,come:21,command:[3,12,15],comment:18,common:7,compact:12,complet:9,comput:12,config:12,configur:12,consol:12,contribut:22,contributor:1,core:14,creat:17,crystal:12,csound:12,css:12,custom:3,dalvik:12,data:12,decor:4,definit:[6,12],deleg:11,deriv:11,descriptor:12,develop:20,dialect:12,diff:12,document:[8,16],doe:21,domain:12,download:20,dsl:12,dump:12,dylan:12,ecl:12,eiffel:12,elm:12,embed:12,encod:[3,19],engin:12,entrypoint:14,erlang:12,esoter:12,exampl:15,extend:14,extendedregexlex:11,ezhil:12,factor:12,famili:12,fantom:12,faq:21,featur:21,felix:12,fiction:12,file:12,filter:[3,4,5],flag:11,format:12,formatt:[0,3,6,7,15],formerli:12,fortran:12,foxpro:12,framework:12,from:[11,21],full:[0,1],gener:[3,6,12,18],get:[3,17],googl:12,grammer:12,graph:12,graphic:12,guess:15,handl:11,hardwar:12,haskel:12,hax:12,help:3,hexadecim:12,high:0,how:[14,21],html:[6,12],idl:12,igor:12,includ:12,inferno:12,instal:[12,20],interact:12,interfac:3,intermedi:12,introduct:15,iter:12,ivl:12,java:10,javascript:12,julia:12,jvm:12,keyword:[11,18],known:12,languag:[9,12,21,23],level:0,lexer:[0,3,11,12,15],like:12,line:[3,15],lispi:12,list:[1,11,17],liter:18,lookup:15,make:21,makefil:12,markdown:9,markup:[12,23],matlab:12,microsoft:12,misc:12,model:12,modifi:11,modula:12,moinmoin:13,mont:12,multi:12,multipl:11,mxml:12,name:[3,18,21],ncar:12,net:12,nim:12,nimrod:12,nit:12,nix:12,nixo:12,non:12,notat:12,note:3,oberon:12,object:12,onc:11,ooc:12,oper:[12,18],option:[0,3,7,15],orient:12,other:[9,12,23],output:12,over:12,own:[4,6,11,17],packag:[12,20],parasail:12,parser:12,pascal:12,patch:12,pawn:12,perl:12,php:12,plot:12,plugin:14,praat:12,pro:12,process:[0,12,21],program:[12,21,23],prolog:12,proto:12,prove:12,punctuat:18,pygment:[0,2,8,9,10,12,13,16,21],python:12,queri:12,quickstart:[6,15],qvt:12,rdf:12,rebol:12,regex:11,regexlex:11,regist:14,relat:12,relax:12,report:21,requir:21,resourc:12,rest:16,riverb:12,roboconf:12,robot:12,rubi:12,rule:17,rust:12,scan:11,scenario:9,schema:12,script:12,semant:12,session:12,shell:12,similar:12,simpl:12,smalltalk:12,smv:12,snobol:12,sourc:[12,20],special:12,specif:12,sql:12,stata:12,state:11,stream:11,stuff:12,style:[3,6,12,17,21],stylesheet:12,subclass:[4,11],suggest:21,supercollid:12,support:[21,23],syntax:12,system:[12,21],tcl:12,templat:[12,23],termin:17,test:[11,12],text:12,textmat:9,than:12,theorem:12,thi:21,token:[11,18],trafficscript:12,trick:11,typoscript:12,unicod:19,urbiscript:12,usag:15,use:21,uses:21,variou:[9,12],varnish:12,verif:12,version:[2,20],visual:12,want:21,web:12,welcom:22,what:21,where:21,whilei:12,who:21,wrapper:9,write:[4,6,11],x10:12,xml:12,xorg:12,your:[4,6,11]}}) \ No newline at end of file diff --git a/doc/docs/quickstart.rst b/doc/docs/quickstart.rst index dba7698..3a823e7 100644 --- a/doc/docs/quickstart.rst +++ b/doc/docs/quickstart.rst @@ -39,7 +39,7 @@ Here is a small example for highlighting Python code: from pygments.formatters import HtmlFormatter code = 'print "Hello World"' - print highlight(code, PythonLexer(), HtmlFormatter()) + print(highlight(code, PythonLexer(), HtmlFormatter())) which prints something like this: @@ -56,7 +56,7 @@ can be produced by: .. sourcecode:: python - print HtmlFormatter().get_style_defs('.highlight') + print(HtmlFormatter().get_style_defs('.highlight')) The argument to :func:`get_style_defs` is used as an additional CSS selector: the output may look like this: diff --git a/doc/faq.rst b/doc/faq.rst index f375828..172929e 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -35,8 +35,8 @@ and in this case, source code! What are the system requirements? --------------------------------- -Pygments only needs a standard Python install, version 2.6 or higher or version -3.3 or higher for Python 3. No additional libraries are needed. +Pygments only needs a standard Python install, version 2.7 or higher or version +3.5 or higher for Python 3. No additional libraries are needed. How can I use Pygments? ----------------------- diff --git a/doc/languages.rst b/doc/languages.rst index 7fa8eb2..e539940 100644 --- a/doc/languages.rst +++ b/doc/languages.rst @@ -37,6 +37,7 @@ Programming languages * `Ezhil `_ Ezhil - A Tamil programming language * Factor * Fancy +* `Fennel `_ * Fortran * F# * GAP @@ -44,6 +45,7 @@ Programming languages * GL shaders * Groovy * `Haskell `_ (incl. Literate Haskell) +* HLSL * IDL * Io * Java diff --git a/pygments/__init__.py b/pygments/__init__.py index 394a85f..19aafde 100644 --- a/pygments/__init__.py +++ b/pygments/__init__.py @@ -29,7 +29,7 @@ import sys from pygments.util import StringIO, BytesIO -__version__ = '2.2.0' +__version__ = '2.3.0' __docformat__ = 'restructuredtext' __all__ = ['lex', 'format', 'highlight'] diff --git a/pygments/cmdline.py b/pygments/cmdline.py index 5e1f39e..2f6c140 100644 --- a/pygments/cmdline.py +++ b/pygments/cmdline.py @@ -11,6 +11,7 @@ from __future__ import print_function +import os import sys import getopt from textwrap import dedent @@ -25,6 +26,7 @@ from pygments.formatters.latex import LatexEmbeddedLexer, LatexFormatter from pygments.formatters import get_all_formatters, get_formatter_by_name, \ load_formatter_from_file, get_formatter_for_filename, find_formatter_class from pygments.formatters.terminal import TerminalFormatter +from pygments.formatters.terminal256 import Terminal256Formatter from pygments.filters import get_all_filters, find_filter_class from pygments.styles import get_all_styles, get_style_by_name @@ -460,7 +462,10 @@ def main_inner(popts, args, usage): return 1 else: if not fmter: - fmter = TerminalFormatter(**parsed_opts) + if '256' in os.environ.get('TERM', ''): + fmter = Terminal256Formatter(**parsed_opts) + else: + fmter = TerminalFormatter(**parsed_opts) if sys.version_info > (3,): # Python 3: we have to use .buffer to get a binary stream outfile = sys.stdout.buffer diff --git a/pygments/lexers/_lua_builtins.py b/pygments/lexers/_lua_builtins.py index c60bf5a..0561725 100644 --- a/pygments/lexers/_lua_builtins.py +++ b/pygments/lexers/_lua_builtins.py @@ -288,7 +288,7 @@ if __name__ == '__main__': # pragma: no cover print('>> %s' % full_function_name) m = get_function_module(full_function_name) modules.setdefault(m, []).append(full_function_name) - modules = {k: tuple(v) for k, v in modules.iteritems()} + modules = dict((k, tuple(v)) for k, v in modules.iteritems()) regenerate(__file__, modules) diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py index ea54241..9ccc761 100644 --- a/pygments/lexers/_mapping.py +++ b/pygments/lexers/_mapping.py @@ -153,6 +153,7 @@ LEXERS = { 'FancyLexer': ('pygments.lexers.ruby', 'Fancy', ('fancy', 'fy'), ('*.fy', '*.fancypack'), ('text/x-fancysrc',)), 'FantomLexer': ('pygments.lexers.fantom', 'Fantom', ('fan',), ('*.fan',), ('application/x-fantom',)), 'FelixLexer': ('pygments.lexers.felix', 'Felix', ('felix', 'flx'), ('*.flx', '*.flxh'), ('text/x-felix',)), + 'FennelLexer': ('pygments.lexers.lisp', 'Fennel', ('fennel', 'fnl'), ('*.fnl',), ()), 'FishShellLexer': ('pygments.lexers.shell', 'Fish', ('fish', 'fishshell'), ('*.fish', '*.load'), ('application/x-fish',)), 'FlatlineLexer': ('pygments.lexers.dsls', 'Flatline', ('flatline',), (), ('text/x-flatline',)), 'ForthLexer': ('pygments.lexers.forth', 'Forth', ('forth',), ('*.frt', '*.fs'), ('application/x-forth',)), @@ -174,6 +175,7 @@ LEXERS = { 'GosuTemplateLexer': ('pygments.lexers.jvm', 'Gosu Template', ('gst',), ('*.gst',), ('text/x-gosu-template',)), 'GroffLexer': ('pygments.lexers.markup', 'Groff', ('groff', 'nroff', 'man'), ('*.[1234567]', '*.man'), ('application/x-troff', 'text/troff')), 'GroovyLexer': ('pygments.lexers.jvm', 'Groovy', ('groovy',), ('*.groovy', '*.gradle'), ('text/x-groovy',)), + 'HLSLShaderLexer': ('pygments.lexers.graphics', 'HLSL', ('hlsl',), ('*.hlsl', '*.hlsli'), ('text/x-hlsl',)), 'HamlLexer': ('pygments.lexers.html', 'Haml', ('haml',), ('*.haml',), ('text/x-haml',)), 'HandlebarsHtmlLexer': ('pygments.lexers.templates', 'HTML+Handlebars', ('html+handlebars',), ('*.handlebars', '*.hbs'), ('text/html+handlebars', 'text/x-handlebars-template')), 'HandlebarsLexer': ('pygments.lexers.templates', 'Handlebars', ('handlebars',), (), ()), @@ -367,7 +369,7 @@ LEXERS = { 'RtsLexer': ('pygments.lexers.trafficscript', 'TrafficScript', ('rts', 'trafficscript'), ('*.rts',), ()), 'RubyConsoleLexer': ('pygments.lexers.ruby', 'Ruby irb session', ('rbcon', 'irb'), (), ('text/x-ruby-shellsession',)), 'RubyLexer': ('pygments.lexers.ruby', 'Ruby', ('rb', 'ruby', 'duby'), ('*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec', '*.rbx', '*.duby', 'Gemfile'), ('text/x-ruby', 'application/x-ruby')), - 'RustLexer': ('pygments.lexers.rust', 'Rust', ('rust',), ('*.rs', '*.rs.in'), ('text/rust',)), + 'RustLexer': ('pygments.lexers.rust', 'Rust', ('rust', 'rs'), ('*.rs', '*.rs.in'), ('text/rust',)), 'SASLexer': ('pygments.lexers.sas', 'SAS', ('sas',), ('*.SAS', '*.sas'), ('text/x-sas', 'text/sas', 'application/x-sas')), 'SLexer': ('pygments.lexers.r', 'S', ('splus', 's', 'r'), ('*.S', '*.R', '.Rhistory', '.Rprofile', '.Renviron'), ('text/S-plus', 'text/S', 'text/x-r-source', 'text/x-r', 'text/x-R', 'text/x-r-history', 'text/x-r-profile')), 'SMLLexer': ('pygments.lexers.ml', 'Standard ML', ('sml',), ('*.sml', '*.sig', '*.fun'), ('text/x-standardml', 'application/x-standardml')), @@ -417,7 +419,7 @@ LEXERS = { 'TurtleLexer': ('pygments.lexers.rdf', 'Turtle', ('turtle',), ('*.ttl',), ('text/turtle', 'application/x-turtle')), 'TwigHtmlLexer': ('pygments.lexers.templates', 'HTML+Twig', ('html+twig',), ('*.twig',), ('text/html+twig',)), 'TwigLexer': ('pygments.lexers.templates', 'Twig', ('twig',), (), ('application/x-twig',)), - 'TypeScriptLexer': ('pygments.lexers.javascript', 'TypeScript', ('ts', 'typescript'), ('*.ts',), ('text/x-typescript',)), + 'TypeScriptLexer': ('pygments.lexers.javascript', 'TypeScript', ('ts', 'typescript'), ('*.ts', '*.tsx'), ('text/x-typescript',)), 'TypoScriptCssDataLexer': ('pygments.lexers.typoscript', 'TypoScriptCssData', ('typoscriptcssdata',), (), ()), 'TypoScriptHtmlDataLexer': ('pygments.lexers.typoscript', 'TypoScriptHtmlData', ('typoscripthtmldata',), (), ()), 'TypoScriptLexer': ('pygments.lexers.typoscript', 'TypoScript', ('typoscript',), ('*.ts', '*.txt'), ('text/x-typoscript',)), @@ -444,6 +446,7 @@ LEXERS = { 'XmlLexer': ('pygments.lexers.html', 'XML', ('xml',), ('*.xml', '*.xsl', '*.rss', '*.xslt', '*.xsd', '*.wsdl', '*.wsf'), ('text/xml', 'application/xml', 'image/svg+xml', 'application/rss+xml', 'application/atom+xml')), 'XmlPhpLexer': ('pygments.lexers.templates', 'XML+PHP', ('xml+php',), (), ('application/xml+php',)), 'XmlSmartyLexer': ('pygments.lexers.templates', 'XML+Smarty', ('xml+smarty',), (), ('application/xml+smarty',)), + 'XorgLexer': ('pygments.lexers.xorg', 'Xorg', ('xorg.conf',), ('xorg.conf',), ()), 'XsltLexer': ('pygments.lexers.html', 'XSLT', ('xslt',), ('*.xsl', '*.xslt', '*.xpl'), ('application/xsl+xml', 'application/xslt+xml')), 'XtendLexer': ('pygments.lexers.jvm', 'Xtend', ('xtend',), ('*.xtend',), ('text/x-xtend',)), 'XtlangLexer': ('pygments.lexers.lisp', 'xtlang', ('extempore',), ('*.xtm',), ()), diff --git a/pygments/lexers/ampl.py b/pygments/lexers/ampl.py index d439cb1..638d025 100644 --- a/pygments/lexers/ampl.py +++ b/pygments/lexers/ampl.py @@ -3,7 +3,7 @@ pygments.lexers.ampl ~~~~~~~~~~~~~~~~~~~~ - Lexers for the ampl language. + Lexers for the AMPL language. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. @@ -18,7 +18,7 @@ __all__ = ['AmplLexer'] class AmplLexer(RegexLexer): """ - For AMPL source code. + For `AMPL `_ source code. .. versionadded:: 2.2 """ diff --git a/pygments/lexers/asm.py b/pygments/lexers/asm.py index 9c58478..5b8cab8 100644 --- a/pygments/lexers/asm.py +++ b/pygments/lexers/asm.py @@ -265,7 +265,7 @@ class HsailLexer(RegexLexer): ], 'comments': [ (r'/\*.*?\*/', Comment.Multiline), - (r'//.*?\n', Comment.Singleline), + (r'//.*?\n', Comment.Single), ], 'keyword': [ # Types diff --git a/pygments/lexers/automation.py b/pygments/lexers/automation.py index be1ec12..3ef42e4 100644 --- a/pygments/lexers/automation.py +++ b/pygments/lexers/automation.py @@ -31,8 +31,8 @@ class AutohotkeyLexer(RegexLexer): 'root': [ (r'^(\s*)(/\*)', bygroups(Text, Comment.Multiline), 'incomment'), (r'^(\s*)(\()', bygroups(Text, Generic), 'incontinuation'), - (r'\s+;.*?$', Comment.Singleline), - (r'^;.*?$', Comment.Singleline), + (r'\s+;.*?$', Comment.Single), + (r'^;.*?$', Comment.Single), (r'[]{}(),;[]', Punctuation), (r'(in|is|and|or|not)\b', Operator.Word), (r'\%[a-zA-Z_#@$][\w#@$]*\%', Name.Variable), diff --git a/pygments/lexers/c_like.py b/pygments/lexers/c_like.py index f7ba7e8..3882721 100644 --- a/pygments/lexers/c_like.py +++ b/pygments/lexers/c_like.py @@ -105,7 +105,7 @@ class ClayLexer(RegexLexer): tokens = { 'root': [ (r'\s', Text), - (r'//.*?$', Comment.Singleline), + (r'//.*?$', Comment.Single), (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline), (r'\b(public|private|import|as|record|variant|instance' r'|define|overload|default|external|alias' diff --git a/pygments/lexers/configs.py b/pygments/lexers/configs.py index 1717a56..4af2adb 100644 --- a/pygments/lexers/configs.py +++ b/pygments/lexers/configs.py @@ -15,6 +15,7 @@ from pygments.lexer import RegexLexer, default, words, bygroups, include, using from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ Number, Punctuation, Whitespace, Literal from pygments.lexers.shell import BashLexer +from pygments.lexers.data import JsonLexer __all__ = ['IniLexer', 'RegeditLexer', 'PropertiesLexer', 'KconfigLexer', 'Cfengine3Lexer', 'ApacheConfLexer', 'SquidConfLexer', @@ -539,20 +540,25 @@ class DockerLexer(RegexLexer): filenames = ['Dockerfile', '*.docker'] mimetypes = ['text/x-dockerfile-config'] - _keywords = (r'(?:FROM|MAINTAINER|CMD|EXPOSE|ENV|ADD|ENTRYPOINT|' - r'VOLUME|WORKDIR)') - + _keywords = (r'(?:FROM|MAINTAINER|EXPOSE|WORKDIR|USER|STOPSIGNAL)') + _bash_keywords = (r'(?:RUN|CMD|ENTRYPOINT|ENV|ARG|LABEL|ADD|COPY)') + _lb = r'(?:\s*\\?\s*)' # dockerfile line break regex flags = re.IGNORECASE | re.MULTILINE tokens = { 'root': [ - (r'^(ONBUILD)(\s+)(%s)\b' % (_keywords,), - bygroups(Name.Keyword, Whitespace, Keyword)), - (r'^(%s)\b(.*)' % (_keywords,), bygroups(Keyword, String)), (r'#.*', Comment), - (r'RUN', Keyword), # Rest of line falls through + (r'(ONBUILD)(%s)' % (_lb,), bygroups(Keyword, using(BashLexer))), + (r'(HEALTHCHECK)((%s--\w+=\w+%s)*)' % (_lb, _lb), + bygroups(Keyword, using(BashLexer))), + (r'(VOLUME|ENTRYPOINT|CMD|SHELL)(%s)(\[.*?\])' % (_lb,), + bygroups(Keyword, using(BashLexer), using(JsonLexer))), + (r'(LABEL|ENV|ARG)((%s\w+=\w+%s)*)' % (_lb, _lb), + bygroups(Keyword, using(BashLexer))), + (r'(%s|VOLUME)\b(.*)' % (_keywords), bygroups(Keyword, String)), + (r'(%s)' % (_bash_keywords,), Keyword), (r'(.*\\\n)*.+', using(BashLexer)), - ], + ] } @@ -584,7 +590,7 @@ class TerraformLexer(RegexLexer): (r'(.*?)(\s*)(=)', bygroups(Name.Attribute, Text, Operator)), (words(('variable', 'resource', 'provider', 'provisioner', 'module'), prefix=r'\b', suffix=r'\b'), Keyword.Reserved, 'function'), - (words(('ingress', 'egress', 'listener', 'default', 'connection'), + (words(('ingress', 'egress', 'listener', 'default', 'connection', 'alias'), prefix=r'\b', suffix=r'\b'), Keyword.Declaration), ('\$\{', String.Interpol, 'var_builtin'), ], diff --git a/pygments/lexers/css.py b/pygments/lexers/css.py index 29d8370..ce97730 100644 --- a/pygments/lexers/css.py +++ b/pygments/lexers/css.py @@ -125,7 +125,7 @@ _css_properties = ( 'wrap-flow', 'wrap-inside', 'wrap-through', 'writing-mode', 'z-index', ) -# List of keyword values obtained from: +# List of keyword values obtained from: # http://cssvalues.com/ _keyword_values = ( 'absolute', 'alias', 'all', 'all-petite-caps', 'all-scroll', @@ -263,7 +263,7 @@ _time_units = ( 's', 'ms', ) _all_units = _angle_units + _frequency_units + _length_units + \ - _resolution_units + _time_units + _resolution_units + _time_units class CssLexer(RegexLexer): @@ -322,16 +322,18 @@ class CssLexer(RegexLexer): include('urls'), (r'('+r'|'.join(_functional_notation_keyword_values)+r')(\()', bygroups(Name.Builtin, Punctuation), 'function-start'), - (r'([a-zA-Z_][\w-]+)(\()', bygroups(Name.Function, Punctuation), 'function-start'), + (r'([a-zA-Z_][\w-]+)(\()', + bygroups(Name.Function, Punctuation), 'function-start'), (words(_keyword_values, suffix=r'\b'), Keyword.Constant), (words(_other_keyword_values, suffix=r'\b'), Keyword.Constant), (words(_color_keywords, suffix=r'\b'), Keyword.Constant), - (words(_css_properties, suffix=r'\b'), Keyword), # for transition-property etc. + # for transition-property etc. + (words(_css_properties, suffix=r'\b'), Keyword), (r'\!important', Comment.Preproc), (r'/\*(?:.|\n)*?\*/', Comment), include('numeric-values'), - + (r'[~^*!%&<>|+=@:./?-]+', Operator), (r'[\[\](),]+', Punctuation), (r'"(\\\\|\\"|[^"])*"', String.Double), @@ -351,7 +353,8 @@ class CssLexer(RegexLexer): # function-start may be entered recursively (r'(' + r'|'.join(_functional_notation_keyword_values) + r')(\()', bygroups(Name.Builtin, Punctuation), 'function-start'), - (r'([a-zA-Z_][\w-]+)(\()', bygroups(Name.Function, Punctuation), 'function-start'), + (r'([a-zA-Z_][\w-]+)(\()', + bygroups(Name.Function, Punctuation), 'function-start'), (r'/\*(?:.|\n)*?\*/', Comment), include('numeric-values'), @@ -373,8 +376,8 @@ class CssLexer(RegexLexer): 'numeric-values': [ (r'\#[a-zA-Z0-9]{1,6}', Number.Hex), (r'[+\-]?[0-9]*[.][0-9]+', Number.Float, 'numeric-end'), - (r'[+\-]?[0-9]+', Number.Integer, 'numeric-end'), - ], + (r'[+\-]?[0-9]+', Number.Integer, 'numeric-end'), + ], 'numeric-end': [ (words(_all_units, suffix=r'\b'), Keyword.Type), (r'%', Keyword.Type), @@ -466,9 +469,9 @@ common_sass_tokens = { ], 'string-single': [ - (r"(\\.|#(?=[^\n{])|[^\n'#])+", String.Double), + (r"(\\.|#(?=[^\n{])|[^\n'#])+", String.Single), (r'#\{', String.Interpol, 'interpolation'), - (r"'", String.Double, '#pop'), + (r"'", String.Single, '#pop'), ], 'string-url': [ diff --git a/pygments/lexers/graphics.py b/pygments/lexers/graphics.py index c8af9f9..fa5aa37 100644 --- a/pygments/lexers/graphics.py +++ b/pygments/lexers/graphics.py @@ -15,7 +15,7 @@ from pygments.token import Text, Comment, Operator, Keyword, Name, \ Number, Punctuation, String __all__ = ['GLShaderLexer', 'PostScriptLexer', 'AsymptoteLexer', 'GnuplotLexer', - 'PovrayLexer'] + 'PovrayLexer', 'HLSLShaderLexer'] class GLShaderLexer(RegexLexer): @@ -75,6 +75,160 @@ class GLShaderLexer(RegexLexer): } +class HLSLShaderLexer(RegexLexer): + """ + HLSL (Microsoft Direct3D Shader) lexer. + + .. versionadded:: 2.3 + """ + name = 'HLSL' + aliases = ['hlsl'] + filenames = ['*.hlsl', '*.hlsli'] + mimetypes = ['text/x-hlsl'] + + tokens = { + 'root': [ + (r'^#.*', Comment.Preproc), + (r'//.*', Comment.Single), + (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline), + (r'\+|-|~|!=?|\*|/|%|<<|>>|<=?|>=?|==?|&&?|\^|\|\|?', + Operator), + (r'[?:]', Operator), # quick hack for ternary + (r'\bdefined\b', Operator), + (r'[;{}(),.\[\]]', Punctuation), + # FIXME when e is present, no decimal point needed + (r'[+-]?\d*\.\d+([eE][-+]?\d+)?f?', Number.Float), + (r'[+-]?\d+\.\d*([eE][-+]?\d+)?f?', Number.Float), + (r'0[xX][0-9a-fA-F]*', Number.Hex), + (r'0[0-7]*', Number.Oct), + (r'[1-9][0-9]*', Number.Integer), + (r'"', String, 'string'), + (words(( + 'asm','asm_fragment','break','case','cbuffer','centroid','class', + 'column_major','compile','compile_fragment','const','continue', + 'default','discard','do','else','export','extern','for','fxgroup', + 'globallycoherent','groupshared','if','in','inline','inout', + 'interface','line','lineadj','linear','namespace','nointerpolation', + 'noperspective','NULL','out','packoffset','pass','pixelfragment', + 'point','precise','return','register','row_major','sample', + 'sampler','shared','stateblock','stateblock_state','static', + 'struct','switch','tbuffer','technique','technique10', + 'technique11','texture','typedef','triangle','triangleadj', + 'uniform','vertexfragment','volatile','while'), + prefix=r'\b', suffix=r'\b'), + Keyword), + (words(('true','false'), prefix=r'\b', suffix=r'\b'), + Keyword.Constant), + (words(( + 'auto','catch','char','const_cast','delete','dynamic_cast','enum', + 'explicit','friend','goto','long','mutable','new','operator', + 'private','protected','public','reinterpret_cast','short','signed', + 'sizeof','static_cast','template','this','throw','try','typename', + 'union','unsigned','using','virtual'), + prefix=r'\b', suffix=r'\b'), + Keyword.Reserved), + (words(( + 'dword','matrix','snorm','string','unorm','unsigned','void','vector', + 'BlendState','Buffer','ByteAddressBuffer','ComputeShader', + 'DepthStencilState','DepthStencilView','DomainShader', + 'GeometryShader','HullShader','InputPatch','LineStream', + 'OutputPatch','PixelShader','PointStream','RasterizerState', + 'RenderTargetView','RasterizerOrderedBuffer', + 'RasterizerOrderedByteAddressBuffer', + 'RasterizerOrderedStructuredBuffer','RasterizerOrderedTexture1D', + 'RasterizerOrderedTexture1DArray','RasterizerOrderedTexture2D', + 'RasterizerOrderedTexture2DArray','RasterizerOrderedTexture3D', + 'RWBuffer','RWByteAddressBuffer','RWStructuredBuffer', + 'RWTexture1D','RWTexture1DArray','RWTexture2D','RWTexture2DArray', + 'RWTexture3D','SamplerState','SamplerComparisonState', + 'StructuredBuffer','Texture1D','Texture1DArray','Texture2D', + 'Texture2DArray','Texture2DMS','Texture2DMSArray','Texture3D', + 'TextureCube','TextureCubeArray','TriangleStream','VertexShader'), + prefix=r'\b', suffix=r'\b'), + Keyword.Type), + (words(( + 'bool','double','float','int','half','min16float','min10float', + 'min16int','min12int','min16uint','uint'), + prefix=r'\b', suffix=r'([1-4](x[1-4])?)?\b'), + Keyword.Type), # vector and matrix types + (words(( + 'abort','abs','acos','all','AllMemoryBarrier', + 'AllMemoryBarrierWithGroupSync','any','AppendStructuredBuffer', + 'asdouble','asfloat','asin','asint','asuint','asuint','atan', + 'atan2','ceil','CheckAccessFullyMapped','clamp','clip', + 'CompileShader','ConsumeStructuredBuffer','cos','cosh','countbits', + 'cross','D3DCOLORtoUBYTE4','ddx','ddx_coarse','ddx_fine','ddy', + 'ddy_coarse','ddy_fine','degrees','determinant', + 'DeviceMemoryBarrier','DeviceMemoryBarrierWithGroupSync','distance', + 'dot','dst','errorf','EvaluateAttributeAtCentroid', + 'EvaluateAttributeAtSample','EvaluateAttributeSnapped','exp', + 'exp2','f16tof32','f32tof16','faceforward','firstbithigh', + 'firstbitlow','floor','fma','fmod','frac','frexp','fwidth', + 'GetRenderTargetSampleCount','GetRenderTargetSamplePosition', + 'GlobalOrderedCountIncrement','GroupMemoryBarrier', + 'GroupMemoryBarrierWithGroupSync','InterlockedAdd','InterlockedAnd', + 'InterlockedCompareExchange','InterlockedCompareStore', + 'InterlockedExchange','InterlockedMax','InterlockedMin', + 'InterlockedOr','InterlockedXor','isfinite','isinf','isnan', + 'ldexp','length','lerp','lit','log','log10','log2','mad','max', + 'min','modf','msad4','mul','noise','normalize','pow','printf', + 'Process2DQuadTessFactorsAvg','Process2DQuadTessFactorsMax', + 'Process2DQuadTessFactorsMin','ProcessIsolineTessFactors', + 'ProcessQuadTessFactorsAvg','ProcessQuadTessFactorsMax', + 'ProcessQuadTessFactorsMin','ProcessTriTessFactorsAvg', + 'ProcessTriTessFactorsMax','ProcessTriTessFactorsMin', + 'QuadReadLaneAt','QuadSwapX','QuadSwapY','radians','rcp', + 'reflect','refract','reversebits','round','rsqrt','saturate', + 'sign','sin','sincos','sinh','smoothstep','sqrt','step','tan', + 'tanh','tex1D','tex1D','tex1Dbias','tex1Dgrad','tex1Dlod', + 'tex1Dproj','tex2D','tex2D','tex2Dbias','tex2Dgrad','tex2Dlod', + 'tex2Dproj','tex3D','tex3D','tex3Dbias','tex3Dgrad','tex3Dlod', + 'tex3Dproj','texCUBE','texCUBE','texCUBEbias','texCUBEgrad', + 'texCUBElod','texCUBEproj','transpose','trunc','WaveAllBitAnd', + 'WaveAllMax','WaveAllMin','WaveAllBitOr','WaveAllBitXor', + 'WaveAllEqual','WaveAllProduct','WaveAllSum','WaveAllTrue', + 'WaveAnyTrue','WaveBallot','WaveGetLaneCount','WaveGetLaneIndex', + 'WaveGetOrderedIndex','WaveIsHelperLane','WaveOnce', + 'WavePrefixProduct','WavePrefixSum','WaveReadFirstLane', + 'WaveReadLaneAt'), + prefix=r'\b', suffix=r'\b'), + Name.Builtin), # built-in functions + (words(( + 'SV_ClipDistance','SV_ClipDistance0','SV_ClipDistance1', + 'SV_Culldistance','SV_CullDistance0','SV_CullDistance1', + 'SV_Coverage','SV_Depth','SV_DepthGreaterEqual', + 'SV_DepthLessEqual','SV_DispatchThreadID','SV_DomainLocation', + 'SV_GroupID','SV_GroupIndex','SV_GroupThreadID','SV_GSInstanceID', + 'SV_InnerCoverage','SV_InsideTessFactor','SV_InstanceID', + 'SV_IsFrontFace','SV_OutputControlPointID','SV_Position', + 'SV_PrimitiveID','SV_RenderTargetArrayIndex','SV_SampleIndex', + 'SV_StencilRef','SV_TessFactor','SV_VertexID', + 'SV_ViewportArrayIndex'), + prefix=r'\b', suffix=r'\b'), + Name.Decorator), # system-value semantics + (r'\bSV_Target[0-7]?\b', Name.Decorator), + (words(( + 'allow_uav_condition','branch','call','domain','earlydepthstencil', + 'fastopt','flatten','forcecase','instance','loop','maxtessfactor', + 'numthreads','outputcontrolpoints','outputtopology','partitioning', + 'patchconstantfunc','unroll'), + prefix=r'\b', suffix=r'\b'), + Name.Decorator), # attributes + (r'[a-zA-Z_]\w*', Name), + (r'\\$', Comment.Preproc), # backslash at end of line -- usually macro continuation + (r'\s+', Text), + ], + 'string': [ + (r'"', String, '#pop'), + (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|' + r'u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})', String.Escape), + (r'[^\\"\n]+', String), # all other characters + (r'\\\n', String), # line continuation + (r'\\', String), # stray backslash + ], + } + + class PostScriptLexer(RegexLexer): """ Lexer for PostScript files. diff --git a/pygments/lexers/idl.py b/pygments/lexers/idl.py index 9907897..2fc3931 100644 --- a/pygments/lexers/idl.py +++ b/pygments/lexers/idl.py @@ -249,7 +249,7 @@ class IDLLexer(RegexLexer): tokens = { 'root': [ - (r'^\s*;.*?\n', Comment.Singleline), + (r'^\s*;.*?\n', Comment.Single), (words(_RESERVED, prefix=r'\b', suffix=r'\b'), Keyword), (words(_BUILTIN_LIB, prefix=r'\b', suffix=r'\b'), Name.Builtin), (r'\+=|-=|\^=|\*=|/=|#=|##=|<=|>=|=', Operator), diff --git a/pygments/lexers/javascript.py b/pygments/lexers/javascript.py index 862535c..663557a 100644 --- a/pygments/lexers/javascript.py +++ b/pygments/lexers/javascript.py @@ -1500,8 +1500,10 @@ class JuttleLexer(RegexLexer): (r'^(?=\s|/)', Text, 'slashstartsregex'), include('commentsandwhitespace'), (r':\d{2}:\d{2}:\d{2}(\.\d*)?:', String.Moment), - (r':(now|beginning|end|forever|yesterday|today|tomorrow|(\d+(\.\d*)?|\.\d+)(ms|[smhdwMy])?):', String.Moment), - (r':\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d*)?)?(Z|[+-]\d{2}:\d{2}|[+-]\d{4})?:', String.Moment), + (r':(now|beginning|end|forever|yesterday|today|tomorrow|' + r'(\d+(\.\d*)?|\.\d+)(ms|[smhdwMy])?):', String.Moment), + (r':\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d*)?)?' + r'(Z|[+-]\d{2}:\d{2}|[+-]\d{4})?:', String.Moment), (r':((\d+(\.\d*)?|\.\d+)[ ]+)?(millisecond|second|minute|hour|day|week|month|year)[s]?' r'(([ ]+and[ ]+(\d+[ ]+)?(millisecond|second|minute|hour|day|week|month|year)[s]?)' r'|[ ]+(ago|from[ ]+now))*:', String.Moment), diff --git a/pygments/lexers/jvm.py b/pygments/lexers/jvm.py index f439283..ccff41c 100644 --- a/pygments/lexers/jvm.py +++ b/pygments/lexers/jvm.py @@ -801,7 +801,7 @@ class ClojureLexer(RegexLexer): # TODO / should divide keywords/symbols into namespace/rest # but that's hard, so just pretend / is part of the name - valid_name = r'(?!#)[\w!$%*+<=>?/.#-]+' + valid_name = r'(?!#)[\w!$%*+<=>?/.#|-]+' tokens = { 'root': [ diff --git a/pygments/lexers/lisp.py b/pygments/lexers/lisp.py index e258c34..4a1ce13 100644 --- a/pygments/lexers/lisp.py +++ b/pygments/lexers/lisp.py @@ -19,7 +19,7 @@ from pygments.lexers.python import PythonLexer __all__ = ['SchemeLexer', 'CommonLispLexer', 'HyLexer', 'RacketLexer', 'NewLispLexer', 'EmacsLispLexer', 'ShenLexer', 'CPSALexer', - 'XtlangLexer'] + 'XtlangLexer', 'FennelLexer'] class SchemeLexer(RegexLexer): @@ -2327,13 +2327,13 @@ class ShenLexer(RegexLexer): token = Name.Function if token == Literal else token yield index, token, value - raise StopIteration + return def _process_signature(self, tokens): for index, token, value in tokens: if token == Literal and value == '}': yield index, Punctuation, value - raise StopIteration + return elif token in (Literal, Name.Function): token = Name.Variable if value.istitle() else Keyword.Type yield index, token, value @@ -2619,3 +2619,75 @@ class XtlangLexer(RegexLexer): include('scheme') ], } + + +class FennelLexer(RegexLexer): + """A lexer for the `Fennel programming language `_. + + Fennel compiles to Lua, so all the Lua builtins are recognized as well + as the special forms that are particular to the Fennel compiler. + + .. versionadded:: 2.3 + """ + name = 'Fennel' + aliases = ['fennel', 'fnl'] + filenames = ['*.fnl'] + + # these two lists are taken from fennel-mode.el: + # https://gitlab.com/technomancy/fennel-mode + # this list is current as of Fennel version 0.1.0. + special_forms = ( + u'require-macros', u'eval-compiler', + u'do', u'values', u'if', u'when', u'each', u'for', u'fn', u'lambda', + u'λ', u'set', u'global', u'var', u'local', u'let', u'tset', u'doto', + u'set-forcibly!', u'defn', u'partial', u'while', u'or', u'and', u'true', + u'false', u'nil', u'.', u'+', u'..', u'^', u'-', u'*', u'%', u'/', u'>', + u'<', u'>=', u'<=', u'=', u'~=', u'#', u'...', u':', u'->', u'->>', + ) + + # Might be nicer to use the list from _lua_builtins.py but it's unclear how? + builtins = ( + u'_G', u'_VERSION', u'arg', u'assert', u'bit32', u'collectgarbage', + u'coroutine', u'debug', u'dofile', u'error', u'getfenv', + u'getmetatable', u'io', u'ipairs', u'load', u'loadfile', u'loadstring', + u'math', u'next', u'os', u'package', u'pairs', u'pcall', u'print', + u'rawequal', u'rawget', u'rawlen', u'rawset', u'require', u'select', + u'setfenv', u'setmetatable', u'string', u'table', u'tonumber', + u'tostring', u'type', u'unpack', u'xpcall' + ) + + # based on the scheme definition, but disallowing leading digits and commas + valid_name = r'[a-zA-Z_!$%&*+/:<=>?@^~|-][\w!$%&*+/:<=>?@^~|\.-]*' + + tokens = { + 'root': [ + # the only comment form is a semicolon; goes to the end of the line + (r';.*$', Comment.Single), + + (r'[,\s]+', Text), + (r'-?\d+\.\d+', Number.Float), + (r'-?\d+', Number.Integer), + + (r'"(\\\\|\\"|[^"])*"', String), + (r"'(\\\\|\\'|[^'])*'", String), + + # these are technically strings, but it's worth visually + # distinguishing them because their intent is different + # from regular strings. + (r':' + valid_name, String.Symbol), + + # special forms are keywords + (words(special_forms, suffix=' '), Keyword), + # lua standard library are builtins + (words(builtins, suffix=' '), Name.Builtin), + # special-case the vararg symbol + (r'\.\.\.', Name.Variable), + # regular identifiers + (valid_name, Name.Variable), + + # all your normal paired delimiters for your programming enjoyment + (r'(\(|\))', Punctuation), + (r'(\[|\])', Punctuation), + (r'(\{|\})', Punctuation), + ] + } diff --git a/pygments/lexers/markup.py b/pygments/lexers/markup.py index 92dc9e7..e6265f4 100644 --- a/pygments/lexers/markup.py +++ b/pygments/lexers/markup.py @@ -536,10 +536,9 @@ class MarkdownLexer(RegexLexer): # no lexer for this language. handle it like it was a code block if lexer is None: yield match.start(4), String, code - return - - for item in do_insertions([], lexer.get_tokens_unprocessed(code)): - yield item + else: + for item in do_insertions([], lexer.get_tokens_unprocessed(code)): + yield item yield match.start(5), String , match.group(5) diff --git a/pygments/lexers/perl.py b/pygments/lexers/perl.py index 4d5ab3b..db5a936 100644 --- a/pygments/lexers/perl.py +++ b/pygments/lexers/perl.py @@ -489,7 +489,7 @@ class Perl6Lexer(ExtendedRegexLexer): 'common': [ (r'#[`|=](?P(?P[' + ''.join(PERL6_BRACKETS) + r'])(?P=first_char)*)', brackets_callback(Comment.Multiline)), - (r'#[^\n]*$', Comment.Singleline), + (r'#[^\n]*$', Comment.Single), (r'^(\s*)=begin\s+(\w+)\b.*?^\1=end\s+\2', Comment.Multiline), (r'^(\s*)=for.*?\n\s*?\n', Comment.Multiline), (r'^=.*?\n\s*?\n', Comment.Multiline), @@ -558,7 +558,7 @@ class Perl6Lexer(ExtendedRegexLexer): # make sure that '#' characters in quotes aren't treated as comments (r"(? o_data : register(u0); + +// Sum up the outputs of all threads and store to the output location +static const uint threadGroupSize2D = 16; +static const uint threadGroupSize1D = threadGroupSize2D * threadGroupSize2D; +groupshared float g_partialSums[threadGroupSize1D]; +void SumAcrossThreadsAndStore(float value, uint iThreadInGroup) +{ + // First reduce within the threadgroup: partial sums of 2, 4, 8... elements + // are calculated by 1/2, 1/4, 1/8... of the threads, always keeping the + // active threads at the front of the group to minimize divergence. + + // NOTE: there are faster ways of doing this...but this is simple to code + // and good enough. + + g_partialSums[iThreadInGroup] = value; + GroupMemoryBarrierWithGroupSync(); + + [unroll] for (uint i = threadGroupSize1D / 2; i > 0; i /= 2) + { + if (iThreadInGroup < i) + { + g_partialSums[iThreadInGroup] += g_partialSums[iThreadInGroup + i]; + } + GroupMemoryBarrierWithGroupSync(); + } + + // Then reduce across threadgroups: one thread from each group adds the group + // total to the final output location, using a software transactional memory + // style since D3D11 doesn't support atomic add on floats. + // (Assumes the output value has been cleared to zero beforehand.) + + if (iThreadInGroup == 0) + { + float threadGroupSum = g_partialSums[0]; + uint outputValueRead = o_data[xyOutput]; + while (true) + { + uint newOutputValue = asuint(asfloat(outputValueRead) + threadGroupSum); + uint previousOutputValue; + InterlockedCompareExchange( + o_data[xyOutput], outputValueRead, newOutputValue, previousOutputValue); + if (previousOutputValue == outputValueRead) + break; + outputValueRead = previousOutputValue; + } + } +} + +void main( + in Vertex i_vtx, + out Vertex o_vtx, + out float3 o_vecCamera : CAMERA, + out float4 o_uvzwShadow : UVZW_SHADOW, + out float4 o_posClip : SV_Position) +{ + o_vtx = i_vtx; + o_vecCamera = g_posCamera - i_vtx.m_pos; + o_uvzwShadow = mul(float4(i_vtx.m_pos, 1.0), g_matWorldToUvzwShadow); + o_posClip = mul(float4(i_vtx.m_pos, 1.0), g_matWorldToClip); +} + +#pragma pack_matrix(row_major) + +struct Vertex +{ + float3 m_pos : POSITION; + float3 m_normal : NORMAL; + float2 m_uv : UV; +}; + +cbuffer CBFrame : CB_FRAME // matches struct CBFrame in test.cpp +{ + float4x4 g_matWorldToClip; + float4x4 g_matWorldToUvzwShadow; + float3x3 g_matWorldToUvzShadowNormal; + float3 g_posCamera; + + float3 g_vecDirectionalLight; + float3 g_rgbDirectionalLight; + + float2 g_dimsShadowMap; + float g_normalOffsetShadow; + float g_shadowSharpening; + + float g_exposure; // Exposure multiplier +} + +Texture2D g_texDiffuse : register(t0); +SamplerState g_ss : register(s0); + +void main( + in Vertex i_vtx, + in float3 i_vecCamera : CAMERA, + in float4 i_uvzwShadow : UVZW_SHADOW, + out float3 o_rgb : SV_Target) +{ + float3 normal = normalize(i_vtx.m_normal); + + // Sample shadow map + float shadow = EvaluateShadow(i_uvzwShadow, normal); + + // Evaluate diffuse lighting + float3 diffuseColor = g_texDiffuse.Sample(g_ss, i_vtx.m_uv); + float3 diffuseLight = g_rgbDirectionalLight * (shadow * saturate(dot(normal, g_vecDirectionalLight))); + diffuseLight += SimpleAmbient(normal); + + o_rgb = diffuseColor * diffuseLight; +} + +[domain("quad")] +void ds( + in float edgeFactors[4] : SV_TessFactor, + in float insideFactors[2] : SV_InsideTessFactor, + in OutputPatch inp, + in float2 uv : SV_DomainLocation, + out float4 o_pos : SV_Position) +{ + o_pos = lerp(lerp(inp[0].pos, inp[1].pos, uv.x), lerp(inp[2].pos, inp[3].pos, uv.x), uv.y); +} diff --git a/tests/examplefiles/example.tf b/tests/examplefiles/example.tf index d3f0277..5a85dbe 100644 --- a/tests/examplefiles/example.tf +++ b/tests/examplefiles/example.tf @@ -39,6 +39,16 @@ provider "aws" { */ +resource "aws_route53_record" "test" { + zone_id = "zone" + name = "name" + type = "A" + alias { + name = "alias name" + } +} + + # Single line comment resource "aws_instance" "example" { ami = "ami-408c7f28" diff --git a/tests/examplefiles/fennelview.fnl b/tests/examplefiles/fennelview.fnl new file mode 100644 index 0000000..fd0fc64 --- /dev/null +++ b/tests/examplefiles/fennelview.fnl @@ -0,0 +1,156 @@ +;; A pretty-printer that outputs tables in Fennel syntax. +;; Loosely based on inspect.lua: http://github.com/kikito/inspect.lua + +(local quote (fn [str] (.. '"' (: str :gsub '"' '\\"') '"'))) + +(local short-control-char-escapes + {"\a" "\\a" "\b" "\\b" "\f" "\\f" "\n" "\\n" + "\r" "\\r" "\t" "\\t" "\v" "\\v"}) + +(local long-control-char-esapes + (let [long {}] + (for [i 0 31] + (let [ch (string.char i)] + (when (not (. short-control-char-escapes ch)) + (tset short-control-char-escapes ch (.. "\\" i)) + (tset long ch (: "\\%03d" :format i))))) + long)) + +(fn escape [str] + (let [str (: str :gsub "\\" "\\\\") + str (: str :gsub "(%c)%f[0-9]" long-control-char-esapes)] + (: str :gsub "%c" short-control-char-escapes))) + +(fn sequence-key? [k len] + (and (= (type k) "number") + (<= 1 k) + (<= k len) + (= (math.floor k) k))) + +(local type-order {:number 1 :boolean 2 :string 3 :table 4 + :function 5 :userdata 6 :thread 7}) + +(fn sort-keys [a b] + (let [ta (type a) tb (type b)] + (if (and (= ta tb) (~= ta "boolean") + (or (= ta "string") (= ta "number"))) + (< a b) + (let [dta (. type-order a) + dtb (. type-order b)] + (if (and dta dtb) + (< dta dtb) + dta true + dtb false + :else (< ta tb)))))) + +(fn get-sequence-length [t] + (var len 1) + (each [i (ipairs t)] (set len i)) + len) + +(fn get-nonsequential-keys [t] + (let [keys {} + sequence-length (get-sequence-length t)] + (each [k (pairs t)] + (when (not (sequence-key? k sequence-length)) + (table.insert keys k))) + (table.sort keys sort-keys) + (values keys sequence-length))) + +(fn count-table-appearances [t appearances] + (if (= (type t) "table") + (when (not (. appearances t)) + (tset appearances t 1) + (each [k v (pairs t)] + (count-table-appearances k appearances) + (count-table-appearances v appearances))) + (when (and t (= t t)) ; no nans please + (tset appearances t (+ (or (. appearances t) 0) 1)))) + appearances) + + + +(var put-value nil) ; mutual recursion going on; defined below + +(fn puts [self ...] + (each [_ v (ipairs [...])] + (table.insert self.buffer v))) + +(fn tabify [self] (puts self "\n" (: self.indent :rep self.level))) + +(fn already-visited? [self v] (~= (. self.ids v) nil)) + +(fn get-id [self v] + (var id (. self.ids v)) + (when (not id) + (let [tv (type v)] + (set id (+ (or (. self.max-ids tv) 0) 1)) + (tset self.max-ids tv id) + (tset self.ids v id))) + (tostring id)) + +(fn put-sequential-table [self t length] + (puts self "[") + (set self.level (+ self.level 1)) + (for [i 1 length] + (puts self " ") + (put-value self (. t i))) + (set self.level (- self.level 1)) + (puts self " ]")) + +(fn put-key [self k] + (if (and (= (type k) "string") + (: k :find "^[-%w?\\^_`!#$%&*+./@~:|<=>]+$")) + (puts self ":" k) + (put-value self k))) + +(fn put-kv-table [self t] + (puts self "{") + (set self.level (+ self.level 1)) + (each [k v (pairs t)] + (tabify self) + (put-key self k) + (puts self " ") + (put-value self v)) + (set self.level (- self.level 1)) + (tabify self) + (puts self "}")) + +(fn put-table [self t] + (if (already-visited? self t) + (puts self "#") + (>= self.level self.depth) + (puts self "{...}") + :else + (let [(non-seq-keys length) (get-nonsequential-keys t) + id (get-id self t)] + (if (> (. self.appearances t) 1) + (puts self "#<" id ">") + (and (= (# non-seq-keys) 0) (= (# t) 0)) + (puts self "{}") + (= (# non-seq-keys) 0) + (put-sequential-table self t length) + :else + (put-kv-table self t))))) + +(set put-value (fn [self v] + (let [tv (type v)] + (if (= tv "string") + (puts self (quote (escape v))) + (or (= tv "number") (= tv "boolean") (= tv "nil")) + (puts self (tostring v)) + (= tv "table") + (put-table self v) + :else + (puts self "#<" (tostring v) ">"))))) + + + +(fn fennelview [root options] + (let [options (or options {}) + inspector {:appearances (count-table-appearances root {}) + :depth (or options.depth 128) + :level 0 :buffer {} :ids {} :max-ids {} + :indent (or options.indent " ")}] + (put-value inspector root) + (table.concat inspector.buffer))) diff --git a/tests/examplefiles/xorg.conf b/tests/examplefiles/xorg.conf new file mode 100644 index 0000000..e1f7164 --- /dev/null +++ b/tests/examplefiles/xorg.conf @@ -0,0 +1,48 @@ +Section "Files" + ModulePath "/usr/lib64/opengl/nvidia/extensions" + ModulePath "/usr/lib64/xorg/modules" +EndSection + +Section "ServerLayout" + Identifier "XFree86 Configured" + Screen "Screen" +EndSection + +Section "ServerFlags" + Option "AutoAddDevices" "false" +EndSection + +Section "Screen" + Identifier "Screen" + Device "Card0" + DefaultDepth 24 + SubSection "Display" + Depth 24 + EndSubSection + Option "UseEDIDDpi" "False" + Option "DPI" "96 x 96" +EndSection + +Section "Device" + Identifier "Card0" + Driver "nvidia" + VendorName "NVIDIA Corporation" # inline comment + #Option "RenderAccel" "true" + + #Option "NvAgp" "3" + #Option "AllowGLXWithComposite" "true" + #Option "AddARGBGLXVisuals" "true" + #Option "XAANoOffscreenPixmaps" "true" + #Option "DRI" "true" + + #Option "UseEvents" "false" + #Option "TripleBuffer" "1" + #Option "DamageEvents" "1" + ##Option "BackingStore" "1" + #Option "PixmapCacheSize" "70000" + #Option "OnDemandVBlankInterrupts" "true" +EndSection + +Section "Extensions" +# Option "Composite" "Disabled" +EndSection diff --git a/tests/test_markdown_lexer.py b/tests/test_markdown_lexer.py new file mode 100644 index 0000000..16d1f28 --- /dev/null +++ b/tests/test_markdown_lexer.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +""" + Pygments regex lexer tests + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" +import unittest + +from pygments.lexers.markup import MarkdownLexer + + +class SameTextTests(unittest.TestCase): + + lexer = MarkdownLexer() + + def assert_same_text(self, text): + """Show that lexed markdown does not remove any content. """ + tokens = list(self.lexer.get_tokens_unprocessed(text)) + output = ''.join(t[2] for t in tokens) + self.assertEqual(text, output) + + def test_code_fence(self): + self.assert_same_text(r'```\nfoo\n```\n') + + def test_code_fence_gsm(self): + self.assert_same_text(r'```markdown\nfoo\n```\n') + + def test_code_fence_gsm_with_no_lexer(self): + self.assert_same_text(r'```invalid-lexer\nfoo\n```\n')