pygments.rb 0.5.4 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +40 -0
- data/README.md +3 -0
- data/lexers +0 -0
- data/lib/pygments/popen.rb +3 -2
- data/lib/pygments/version.rb +1 -1
- data/pygments.rb.gemspec +2 -1
- data/vendor/pygments-main/AUTHORS +20 -1
- data/vendor/pygments-main/CHANGES +55 -3
- data/vendor/pygments-main/LICENSE +1 -1
- data/vendor/pygments-main/MANIFEST.in +1 -1
- data/vendor/pygments-main/Makefile +5 -8
- data/vendor/pygments-main/REVISION +1 -1
- data/vendor/pygments-main/doc/Makefile +153 -0
- data/vendor/pygments-main/doc/_static/favicon.ico +0 -0
- data/vendor/pygments-main/doc/_static/logo_new.png +0 -0
- data/vendor/pygments-main/doc/_static/logo_only.png +0 -0
- data/vendor/pygments-main/doc/_templates/docssidebar.html +3 -0
- data/vendor/pygments-main/doc/_templates/indexsidebar.html +25 -0
- data/vendor/pygments-main/doc/_themes/pygments14/layout.html +98 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/bodybg.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/docbg.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/listitem.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/logo.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/pocoo.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/pygments14.css_t +401 -0
- data/vendor/pygments-main/doc/_themes/pygments14/theme.conf +15 -0
- data/vendor/pygments-main/doc/conf.py +249 -0
- data/vendor/pygments-main/doc/docs/api.rst +316 -0
- data/vendor/pygments-main/doc/docs/authors.rst +4 -0
- data/vendor/pygments-main/doc/docs/changelog.rst +1 -0
- data/vendor/pygments-main/{docs/src/cmdline.txt → doc/docs/cmdline.rst} +9 -11
- data/vendor/pygments-main/{docs/src/filterdevelopment.txt → doc/docs/filterdevelopment.rst} +1 -1
- data/vendor/pygments-main/{docs/src/filters.txt → doc/docs/filters.rst} +4 -5
- data/vendor/pygments-main/{docs/src/formatterdevelopment.txt → doc/docs/formatterdevelopment.rst} +1 -1
- data/vendor/pygments-main/{docs/src/formatters.txt → doc/docs/formatters.rst} +6 -6
- data/vendor/pygments-main/doc/docs/index.rst +66 -0
- data/vendor/pygments-main/{docs/src/integrate.txt → doc/docs/integrate.rst} +3 -7
- data/vendor/pygments-main/{docs/src/java.txt → doc/docs/java.rst} +0 -0
- data/vendor/pygments-main/{docs/src/lexerdevelopment.txt → doc/docs/lexerdevelopment.rst} +13 -14
- data/vendor/pygments-main/{docs/src/lexers.txt → doc/docs/lexers.rst} +7 -5
- data/vendor/pygments-main/{docs/src/moinmoin.txt → doc/docs/moinmoin.rst} +0 -0
- data/vendor/pygments-main/{docs/src/plugins.txt → doc/docs/plugins.rst} +0 -0
- data/vendor/pygments-main/{docs/src/quickstart.txt → doc/docs/quickstart.rst} +22 -19
- data/vendor/pygments-main/{docs/src/rstdirective.txt → doc/docs/rstdirective.rst} +0 -0
- data/vendor/pygments-main/{docs/src/styles.txt → doc/docs/styles.rst} +2 -2
- data/vendor/pygments-main/{docs/src/tokens.txt → doc/docs/tokens.rst} +10 -7
- data/vendor/pygments-main/{docs/src/unicode.txt → doc/docs/unicode.rst} +8 -7
- data/vendor/pygments-main/doc/download.rst +41 -0
- data/vendor/pygments-main/doc/faq.rst +143 -0
- data/vendor/pygments-main/doc/index.rst +53 -0
- data/vendor/pygments-main/doc/languages.rst +151 -0
- data/vendor/pygments-main/doc/make.bat +190 -0
- data/vendor/pygments-main/{docs → doc}/pygmentize.1 +0 -0
- data/vendor/pygments-main/external/autopygmentize +65 -48
- data/vendor/pygments-main/external/markdown-processor.py +15 -15
- data/vendor/pygments-main/external/moin-parser.py +1 -1
- data/vendor/pygments-main/external/rst-directive.py +2 -3
- data/vendor/pygments-main/ez_setup.py +340 -234
- data/vendor/pygments-main/pygments/__init__.py +4 -4
- data/vendor/pygments-main/pygments/cmdline.py +81 -68
- data/vendor/pygments-main/pygments/console.py +1 -1
- data/vendor/pygments-main/pygments/filter.py +1 -1
- data/vendor/pygments-main/pygments/filters/__init__.py +11 -9
- data/vendor/pygments-main/pygments/formatter.py +3 -3
- data/vendor/pygments-main/pygments/formatters/__init__.py +5 -3
- data/vendor/pygments-main/pygments/formatters/_mapping.py +16 -5
- data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
- data/vendor/pygments-main/pygments/formatters/html.py +44 -26
- data/vendor/pygments-main/pygments/formatters/img.py +21 -14
- data/vendor/pygments-main/pygments/formatters/latex.py +104 -12
- data/vendor/pygments-main/pygments/formatters/other.py +53 -6
- data/vendor/pygments-main/pygments/formatters/rtf.py +30 -16
- data/vendor/pygments-main/pygments/formatters/svg.py +2 -2
- data/vendor/pygments-main/pygments/formatters/terminal.py +41 -1
- data/vendor/pygments-main/pygments/formatters/terminal256.py +2 -2
- data/vendor/pygments-main/pygments/lexer.py +59 -39
- data/vendor/pygments-main/pygments/lexers/__init__.py +38 -15
- data/vendor/pygments-main/pygments/lexers/_asybuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_clbuiltins.py +15 -15
- data/vendor/pygments-main/pygments/lexers/_cocoabuiltins.py +73 -0
- data/vendor/pygments-main/pygments/lexers/_lassobuiltins.py +11 -1
- data/vendor/pygments-main/pygments/lexers/_luabuiltins.py +14 -8
- data/vendor/pygments-main/pygments/lexers/_mapping.py +81 -30
- data/vendor/pygments-main/pygments/lexers/_openedgebuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_phpbuiltins.py +1067 -95
- data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +7 -7
- data/vendor/pygments-main/pygments/lexers/_robotframeworklexer.py +5 -4
- data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py +12 -7
- data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +112 -18
- data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/agile.py +644 -382
- data/vendor/pygments-main/pygments/lexers/asm.py +66 -29
- data/vendor/pygments-main/pygments/lexers/compiled.py +1643 -174
- data/vendor/pygments-main/pygments/lexers/dalvik.py +27 -6
- data/vendor/pygments-main/pygments/lexers/dotnet.py +45 -33
- data/vendor/pygments-main/pygments/lexers/foxpro.py +3 -3
- data/vendor/pygments-main/pygments/lexers/functional.py +1510 -570
- data/vendor/pygments-main/pygments/lexers/graph.py +81 -0
- data/vendor/pygments-main/pygments/lexers/hdl.py +29 -30
- data/vendor/pygments-main/pygments/lexers/inferno.py +96 -0
- data/vendor/pygments-main/pygments/lexers/jvm.py +622 -207
- data/vendor/pygments-main/pygments/lexers/math.py +438 -70
- data/vendor/pygments-main/pygments/lexers/other.py +885 -171
- data/vendor/pygments-main/pygments/lexers/parsers.py +24 -24
- data/vendor/pygments-main/pygments/lexers/qbasic.py +157 -0
- data/vendor/pygments-main/pygments/lexers/rdf.py +99 -0
- data/vendor/pygments-main/pygments/lexers/shell.py +28 -25
- data/vendor/pygments-main/pygments/lexers/special.py +7 -8
- data/vendor/pygments-main/pygments/lexers/sql.py +56 -23
- data/vendor/pygments-main/pygments/lexers/templates.py +377 -59
- data/vendor/pygments-main/pygments/lexers/text.py +208 -46
- data/vendor/pygments-main/pygments/lexers/web.py +729 -264
- data/vendor/pygments-main/pygments/modeline.py +1 -1
- data/vendor/pygments-main/pygments/plugin.py +1 -1
- data/vendor/pygments-main/pygments/scanner.py +1 -1
- data/vendor/pygments-main/pygments/sphinxext.py +153 -0
- data/vendor/pygments-main/pygments/style.py +3 -2
- data/vendor/pygments-main/pygments/styles/__init__.py +5 -1
- data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
- data/vendor/pygments-main/pygments/styles/borland.py +1 -1
- data/vendor/pygments-main/pygments/styles/bw.py +1 -1
- data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
- data/vendor/pygments-main/pygments/styles/default.py +1 -1
- data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
- data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
- data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
- data/vendor/pygments-main/pygments/styles/igor.py +29 -0
- data/vendor/pygments-main/pygments/styles/manni.py +1 -1
- data/vendor/pygments-main/pygments/styles/monokai.py +4 -4
- data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
- data/vendor/pygments-main/pygments/styles/native.py +1 -1
- data/vendor/pygments-main/pygments/styles/paraiso_dark.py +125 -0
- data/vendor/pygments-main/pygments/styles/paraiso_light.py +125 -0
- data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
- data/vendor/pygments-main/pygments/styles/perldoc.py +1 -1
- data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
- data/vendor/pygments-main/pygments/styles/tango.py +1 -1
- data/vendor/pygments-main/pygments/styles/trac.py +1 -1
- data/vendor/pygments-main/pygments/styles/vim.py +1 -1
- data/vendor/pygments-main/pygments/styles/vs.py +1 -1
- data/vendor/pygments-main/pygments/styles/xcode.py +51 -0
- data/vendor/pygments-main/pygments/token.py +4 -1
- data/vendor/pygments-main/pygments/unistring.py +6 -5
- data/vendor/pygments-main/pygments/util.py +35 -21
- data/vendor/pygments-main/scripts/check_sources.py +28 -44
- data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +5 -4
- data/vendor/pygments-main/scripts/find_codetags.py +27 -19
- data/vendor/pygments-main/scripts/find_error.py +16 -13
- data/vendor/pygments-main/scripts/get_vimkw.py +3 -3
- data/vendor/pygments-main/scripts/vim2pygments.py +9 -7
- data/vendor/pygments-main/setup.py +19 -19
- data/vendor/pygments-main/tests/examplefiles/99_bottles_of_beer.chpl +118 -0
- data/vendor/pygments-main/tests/examplefiles/Error.pmod +38 -0
- data/vendor/pygments-main/tests/examplefiles/FakeFile.pike +360 -0
- data/vendor/pygments-main/tests/examplefiles/{ANTLRv3.g → antlr_ANTLRv3.g} +0 -0
- data/vendor/pygments-main/tests/examplefiles/clojure-weird-keywords.clj +5 -0
- data/vendor/pygments-main/tests/examplefiles/core.cljs +52 -0
- data/vendor/pygments-main/tests/examplefiles/demo.cfm +13 -1
- data/vendor/pygments-main/tests/examplefiles/demo.hbs +12 -0
- data/vendor/pygments-main/tests/examplefiles/ember.handlebars +33 -0
- data/vendor/pygments-main/tests/examplefiles/example.als +217 -0
- data/vendor/pygments-main/tests/examplefiles/example.c +1 -1
- data/vendor/pygments-main/tests/examplefiles/example.chai +6 -0
- data/vendor/pygments-main/tests/examplefiles/example.coffee +27 -0
- data/vendor/pygments-main/tests/examplefiles/example.e +124 -0
- data/vendor/pygments-main/tests/examplefiles/example.f90 +8 -0
- data/vendor/pygments-main/tests/examplefiles/example.feature +16 -0
- data/vendor/pygments-main/tests/examplefiles/example.gd +23 -0
- data/vendor/pygments-main/tests/examplefiles/example.gi +64 -0
- data/vendor/pygments-main/tests/examplefiles/example.groovy +2 -0
- data/vendor/pygments-main/tests/examplefiles/example.hs +27 -0
- data/vendor/pygments-main/tests/examplefiles/example.hx +44 -1
- data/vendor/pygments-main/tests/examplefiles/example.i6t +32 -0
- data/vendor/pygments-main/tests/examplefiles/example.i7x +45 -0
- data/vendor/pygments-main/tests/examplefiles/example.inf +374 -0
- data/vendor/pygments-main/tests/examplefiles/example.j +564 -0
- data/vendor/pygments-main/tests/examplefiles/example.java +16 -0
- data/vendor/pygments-main/tests/examplefiles/example.kal +75 -0
- data/vendor/pygments-main/tests/examplefiles/example.liquid +42 -0
- data/vendor/pygments-main/tests/examplefiles/example.ma +8 -0
- data/vendor/pygments-main/tests/examplefiles/example.mq4 +187 -0
- data/vendor/pygments-main/tests/examplefiles/example.mqh +123 -0
- data/vendor/pygments-main/tests/examplefiles/example.ni +57 -0
- data/vendor/pygments-main/tests/examplefiles/example.nix +80 -0
- data/vendor/pygments-main/tests/examplefiles/example.pp +8 -0
- data/vendor/pygments-main/tests/examplefiles/example.red +257 -0
- data/vendor/pygments-main/tests/examplefiles/example.reds +150 -0
- data/vendor/pygments-main/tests/examplefiles/example.rkt +677 -29
- data/vendor/pygments-main/tests/examplefiles/example.sh +22 -0
- data/vendor/pygments-main/tests/examplefiles/example.slim +31 -0
- data/vendor/pygments-main/tests/examplefiles/example.sls +51 -0
- data/vendor/pygments-main/tests/examplefiles/example.stan +2 -0
- data/vendor/pygments-main/tests/examplefiles/example.todotxt +9 -0
- data/vendor/pygments-main/tests/examplefiles/exampleScript.cfc +241 -0
- data/vendor/pygments-main/tests/examplefiles/exampleTag.cfc +18 -0
- data/vendor/pygments-main/tests/examplefiles/example_elixir.ex +192 -350
- data/vendor/pygments-main/tests/examplefiles/hash_syntax.rb +5 -0
- data/vendor/pygments-main/tests/examplefiles/hello.at +6 -0
- data/vendor/pygments-main/tests/examplefiles/hello.golo +5 -0
- data/vendor/pygments-main/tests/examplefiles/hello.lsl +12 -0
- data/vendor/pygments-main/tests/examplefiles/{File.hy → hybris_File.hy} +0 -0
- data/vendor/pygments-main/tests/examplefiles/{mg_sample.pro → idl_sample.pro} +0 -0
- data/vendor/pygments-main/tests/examplefiles/iex_example +23 -0
- data/vendor/pygments-main/tests/examplefiles/inet_pton6.dg +24 -24
- data/vendor/pygments-main/tests/examplefiles/language.hy +165 -0
- data/vendor/pygments-main/tests/examplefiles/limbo.b +456 -0
- data/vendor/pygments-main/tests/examplefiles/livescript-demo.ls +3 -1
- data/vendor/pygments-main/tests/examplefiles/main.cmake +2 -0
- data/vendor/pygments-main/tests/examplefiles/objc_example.m +163 -16
- data/vendor/pygments-main/tests/examplefiles/{example.p → openedge_example} +0 -0
- data/vendor/pygments-main/tests/examplefiles/pawn_example +25 -0
- data/vendor/pygments-main/tests/examplefiles/qbasic_example +2 -0
- data/vendor/pygments-main/tests/examplefiles/r6rs-comments.scm +23 -0
- data/vendor/pygments-main/tests/examplefiles/{robotframework.txt → robotframework_test.txt} +0 -0
- data/vendor/pygments-main/tests/examplefiles/rql-queries.rql +34 -0
- data/vendor/pygments-main/tests/examplefiles/scope.cirru +43 -0
- data/vendor/pygments-main/tests/examplefiles/sparql.rq +23 -0
- data/vendor/pygments-main/tests/examplefiles/test.R +37 -5
- data/vendor/pygments-main/tests/examplefiles/test.apl +26 -0
- data/vendor/pygments-main/tests/examplefiles/test.cyp +123 -0
- data/vendor/pygments-main/tests/examplefiles/test.idr +93 -0
- data/vendor/pygments-main/tests/examplefiles/test.mask +41 -0
- data/vendor/pygments-main/tests/examplefiles/test.pan +54 -0
- data/vendor/pygments-main/tests/examplefiles/test.php +3 -1
- data/vendor/pygments-main/tests/examplefiles/test.pig +148 -0
- data/vendor/pygments-main/tests/examplefiles/test.pwn +253 -0
- data/vendor/pygments-main/tests/examplefiles/test.r3 +27 -7
- data/vendor/pygments-main/tests/examplefiles/test.rsl +111 -0
- data/vendor/pygments-main/tests/examplefiles/test.swift +65 -0
- data/vendor/pygments-main/tests/examplefiles/test.zep +33 -0
- data/vendor/pygments-main/tests/examplefiles/unicode.go +10 -0
- data/vendor/pygments-main/tests/examplefiles/{test.bas → vbnet_test.bas} +0 -0
- data/vendor/pygments-main/tests/examplefiles/vctreestatus_hg +4 -0
- data/vendor/pygments-main/tests/examplefiles/vimrc +21 -0
- data/vendor/pygments-main/tests/run.py +14 -19
- data/vendor/pygments-main/tests/string_asserts.py +22 -0
- data/vendor/pygments-main/tests/test_basic_api.py +28 -14
- data/vendor/pygments-main/tests/test_cfm.py +46 -0
- data/vendor/pygments-main/tests/test_clexer.py +208 -3
- data/vendor/pygments-main/tests/test_cmdline.py +6 -5
- data/vendor/pygments-main/tests/test_examplefiles.py +30 -19
- data/vendor/pygments-main/tests/test_html_formatter.py +15 -13
- data/vendor/pygments-main/tests/test_latex_formatter.py +4 -2
- data/vendor/pygments-main/tests/test_lexers_other.py +11 -11
- data/vendor/pygments-main/tests/test_objectiveclexer.py +81 -0
- data/vendor/pygments-main/tests/test_perllexer.py +1 -1
- data/vendor/pygments-main/tests/test_qbasiclexer.py +43 -0
- data/vendor/pygments-main/tests/test_regexlexer.py +8 -1
- data/vendor/pygments-main/tests/test_rtf_formatter.py +109 -0
- data/vendor/pygments-main/tests/test_string_asserts.py +39 -0
- data/vendor/pygments-main/tests/test_token.py +3 -3
- data/vendor/pygments-main/tests/test_using_api.py +1 -1
- data/vendor/pygments-main/tests/test_util.py +1 -1
- metadata +138 -51
- data/vendor/pygments-main/docs/generate.py +0 -472
- data/vendor/pygments-main/docs/src/api.txt +0 -270
- data/vendor/pygments-main/docs/src/authors.txt +0 -5
- data/vendor/pygments-main/docs/src/changelog.txt +0 -5
- data/vendor/pygments-main/docs/src/index.txt +0 -69
- data/vendor/pygments-main/docs/src/installation.txt +0 -71
- data/vendor/pygments-main/external/rst-directive-old.py +0 -77
- data/vendor/pygments-main/scripts/reindent.py +0 -291
- data/vendor/pygments-main/tests/examplefiles/import.hs +0 -4
- data/vendor/pygments-main/tests/examplefiles/objc_example2.m +0 -24
- data/vendor/pygments-main/tests/old_run.py +0 -138
@@ -0,0 +1,15 @@
|
|
1
|
+
[theme]
|
2
|
+
inherit = basic
|
3
|
+
stylesheet = pygments14.css
|
4
|
+
pygments_style = friendly
|
5
|
+
|
6
|
+
[options]
|
7
|
+
green = #66b55e
|
8
|
+
darkgreen = #36852e
|
9
|
+
darkgray = #666666
|
10
|
+
border = #66b55e
|
11
|
+
yellow = #f4cd00
|
12
|
+
darkyellow = #d4ad00
|
13
|
+
lightyellow = #fffbe3
|
14
|
+
background = #f9f9f9
|
15
|
+
font = PT Sans
|
@@ -0,0 +1,249 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Pygments documentation build configuration file, created by
|
4
|
+
# sphinx-quickstart on Sat Jan 18 17:07:37 2014.
|
5
|
+
#
|
6
|
+
# This file is execfile()d with the current directory set to its containing dir.
|
7
|
+
#
|
8
|
+
# Note that not all possible configuration values are present in this
|
9
|
+
# autogenerated file.
|
10
|
+
#
|
11
|
+
# All configuration values have a default; values that are commented out
|
12
|
+
# serve to show the default.
|
13
|
+
|
14
|
+
import sys, os
|
15
|
+
|
16
|
+
# If extensions (or modules to document with autodoc) are in another directory,
|
17
|
+
# add these directories to sys.path here. If the directory is relative to the
|
18
|
+
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
19
|
+
sys.path.insert(0, os.path.abspath('..'))
|
20
|
+
|
21
|
+
import pygments
|
22
|
+
|
23
|
+
# -- General configuration -----------------------------------------------------
|
24
|
+
|
25
|
+
# If your documentation needs a minimal Sphinx version, state it here.
|
26
|
+
#needs_sphinx = '1.0'
|
27
|
+
|
28
|
+
# Add any Sphinx extension module names here, as strings. They can be extensions
|
29
|
+
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
30
|
+
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'pygments.sphinxext']
|
31
|
+
|
32
|
+
# Add any paths that contain templates here, relative to this directory.
|
33
|
+
templates_path = ['_templates']
|
34
|
+
|
35
|
+
# The suffix of source filenames.
|
36
|
+
source_suffix = '.rst'
|
37
|
+
|
38
|
+
# The encoding of source files.
|
39
|
+
#source_encoding = 'utf-8-sig'
|
40
|
+
|
41
|
+
# The master toctree document.
|
42
|
+
master_doc = 'index'
|
43
|
+
|
44
|
+
# General information about the project.
|
45
|
+
project = u'Pygments'
|
46
|
+
copyright = u'2014, Georg Brandl'
|
47
|
+
|
48
|
+
# The version info for the project you're documenting, acts as replacement for
|
49
|
+
# |version| and |release|, also used in various other places throughout the
|
50
|
+
# built documents.
|
51
|
+
#
|
52
|
+
# The short X.Y version.
|
53
|
+
version = pygments.__version__
|
54
|
+
# The full version, including alpha/beta/rc tags.
|
55
|
+
release = version
|
56
|
+
|
57
|
+
# The language for content autogenerated by Sphinx. Refer to documentation
|
58
|
+
# for a list of supported languages.
|
59
|
+
#language = None
|
60
|
+
|
61
|
+
# There are two options for replacing |today|: either, you set today to some
|
62
|
+
# non-false value, then it is used:
|
63
|
+
#today = ''
|
64
|
+
# Else, today_fmt is used as the format for a strftime call.
|
65
|
+
#today_fmt = '%B %d, %Y'
|
66
|
+
|
67
|
+
# List of patterns, relative to source directory, that match files and
|
68
|
+
# directories to ignore when looking for source files.
|
69
|
+
exclude_patterns = ['_build']
|
70
|
+
|
71
|
+
# The reST default role (used for this markup: `text`) to use for all documents.
|
72
|
+
#default_role = None
|
73
|
+
|
74
|
+
# If true, '()' will be appended to :func: etc. cross-reference text.
|
75
|
+
#add_function_parentheses = True
|
76
|
+
|
77
|
+
# If true, the current module name will be prepended to all description
|
78
|
+
# unit titles (such as .. function::).
|
79
|
+
#add_module_names = True
|
80
|
+
|
81
|
+
# If true, sectionauthor and moduleauthor directives will be shown in the
|
82
|
+
# output. They are ignored by default.
|
83
|
+
#show_authors = False
|
84
|
+
|
85
|
+
# The name of the Pygments (syntax highlighting) style to use.
|
86
|
+
#pygments_style = 'sphinx'
|
87
|
+
|
88
|
+
# A list of ignored prefixes for module index sorting.
|
89
|
+
#modindex_common_prefix = []
|
90
|
+
|
91
|
+
|
92
|
+
# -- Options for HTML output ---------------------------------------------------
|
93
|
+
|
94
|
+
# The theme to use for HTML and HTML Help pages. See the documentation for
|
95
|
+
# a list of builtin themes.
|
96
|
+
html_theme = 'pygments14'
|
97
|
+
|
98
|
+
# Theme options are theme-specific and customize the look and feel of a theme
|
99
|
+
# further. For a list of options available for each theme, see the
|
100
|
+
# documentation.
|
101
|
+
#html_theme_options = {}
|
102
|
+
|
103
|
+
# Add any paths that contain custom themes here, relative to this directory.
|
104
|
+
html_theme_path = ['_themes']
|
105
|
+
|
106
|
+
# The name for this set of Sphinx documents. If None, it defaults to
|
107
|
+
# "<project> v<release> documentation".
|
108
|
+
#html_title = None
|
109
|
+
|
110
|
+
# A shorter title for the navigation bar. Default is the same as html_title.
|
111
|
+
#html_short_title = None
|
112
|
+
|
113
|
+
# The name of an image file (relative to this directory) to place at the top
|
114
|
+
# of the sidebar.
|
115
|
+
#html_logo = None
|
116
|
+
|
117
|
+
# The name of an image file (within the static path) to use as favicon of the
|
118
|
+
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
119
|
+
# pixels large.
|
120
|
+
html_favicon = 'favicon.ico'
|
121
|
+
|
122
|
+
# Add any paths that contain custom static files (such as style sheets) here,
|
123
|
+
# relative to this directory. They are copied after the builtin static files,
|
124
|
+
# so a file named "default.css" will overwrite the builtin "default.css".
|
125
|
+
html_static_path = ['_static']
|
126
|
+
|
127
|
+
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
128
|
+
# using the given strftime format.
|
129
|
+
#html_last_updated_fmt = '%b %d, %Y'
|
130
|
+
|
131
|
+
# If true, SmartyPants will be used to convert quotes and dashes to
|
132
|
+
# typographically correct entities.
|
133
|
+
#html_use_smartypants = True
|
134
|
+
|
135
|
+
# Custom sidebar templates, maps document names to template names.
|
136
|
+
html_sidebars = {'index': 'indexsidebar.html',
|
137
|
+
'docs/*': 'docssidebar.html'}
|
138
|
+
|
139
|
+
# Additional templates that should be rendered to pages, maps page names to
|
140
|
+
# template names.
|
141
|
+
#html_additional_pages = {}
|
142
|
+
|
143
|
+
# If false, no module index is generated.
|
144
|
+
#html_domain_indices = True
|
145
|
+
|
146
|
+
# If false, no index is generated.
|
147
|
+
#html_use_index = True
|
148
|
+
|
149
|
+
# If true, the index is split into individual pages for each letter.
|
150
|
+
#html_split_index = False
|
151
|
+
|
152
|
+
# If true, links to the reST sources are added to the pages.
|
153
|
+
#html_show_sourcelink = True
|
154
|
+
|
155
|
+
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
156
|
+
#html_show_sphinx = True
|
157
|
+
|
158
|
+
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
159
|
+
#html_show_copyright = True
|
160
|
+
|
161
|
+
# If true, an OpenSearch description file will be output, and all pages will
|
162
|
+
# contain a <link> tag referring to it. The value of this option must be the
|
163
|
+
# base URL from which the finished HTML is served.
|
164
|
+
#html_use_opensearch = ''
|
165
|
+
|
166
|
+
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
167
|
+
#html_file_suffix = None
|
168
|
+
|
169
|
+
# Output file base name for HTML help builder.
|
170
|
+
htmlhelp_basename = 'Pygmentsdoc'
|
171
|
+
|
172
|
+
|
173
|
+
# -- Options for LaTeX output --------------------------------------------------
|
174
|
+
|
175
|
+
latex_elements = {
|
176
|
+
# The paper size ('letterpaper' or 'a4paper').
|
177
|
+
#'papersize': 'letterpaper',
|
178
|
+
|
179
|
+
# The font size ('10pt', '11pt' or '12pt').
|
180
|
+
#'pointsize': '10pt',
|
181
|
+
|
182
|
+
# Additional stuff for the LaTeX preamble.
|
183
|
+
#'preamble': '',
|
184
|
+
}
|
185
|
+
|
186
|
+
# Grouping the document tree into LaTeX files. List of tuples
|
187
|
+
# (source start file, target name, title, author, documentclass [howto/manual]).
|
188
|
+
latex_documents = [
|
189
|
+
('index', 'Pygments.tex', u'Pygments Documentation',
|
190
|
+
u'Georg Brandl', 'manual'),
|
191
|
+
]
|
192
|
+
|
193
|
+
# The name of an image file (relative to this directory) to place at the top of
|
194
|
+
# the title page.
|
195
|
+
#latex_logo = None
|
196
|
+
|
197
|
+
# For "manual" documents, if this is true, then toplevel headings are parts,
|
198
|
+
# not chapters.
|
199
|
+
#latex_use_parts = False
|
200
|
+
|
201
|
+
# If true, show page references after internal links.
|
202
|
+
#latex_show_pagerefs = False
|
203
|
+
|
204
|
+
# If true, show URL addresses after external links.
|
205
|
+
#latex_show_urls = False
|
206
|
+
|
207
|
+
# Documents to append as an appendix to all manuals.
|
208
|
+
#latex_appendices = []
|
209
|
+
|
210
|
+
# If false, no module index is generated.
|
211
|
+
#latex_domain_indices = True
|
212
|
+
|
213
|
+
|
214
|
+
# -- Options for manual page output --------------------------------------------
|
215
|
+
|
216
|
+
# One entry per manual page. List of tuples
|
217
|
+
# (source start file, name, description, authors, manual section).
|
218
|
+
man_pages = [
|
219
|
+
('index', 'pygments', u'Pygments Documentation',
|
220
|
+
[u'Georg Brandl'], 1)
|
221
|
+
]
|
222
|
+
|
223
|
+
# If true, show URL addresses after external links.
|
224
|
+
#man_show_urls = False
|
225
|
+
|
226
|
+
|
227
|
+
# -- Options for Texinfo output ------------------------------------------------
|
228
|
+
|
229
|
+
# Grouping the document tree into Texinfo files. List of tuples
|
230
|
+
# (source start file, target name, title, author,
|
231
|
+
# dir menu entry, description, category)
|
232
|
+
texinfo_documents = [
|
233
|
+
('index', 'Pygments', u'Pygments Documentation',
|
234
|
+
u'Georg Brandl', 'Pygments', 'One line description of project.',
|
235
|
+
'Miscellaneous'),
|
236
|
+
]
|
237
|
+
|
238
|
+
# Documents to append as an appendix to all manuals.
|
239
|
+
#texinfo_appendices = []
|
240
|
+
|
241
|
+
# If false, no module index is generated.
|
242
|
+
#texinfo_domain_indices = True
|
243
|
+
|
244
|
+
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
245
|
+
#texinfo_show_urls = 'footnote'
|
246
|
+
|
247
|
+
|
248
|
+
# Example configuration for intersphinx: refer to the Python standard library.
|
249
|
+
#intersphinx_mapping = {'http://docs.python.org/': None}
|
@@ -0,0 +1,316 @@
|
|
1
|
+
.. -*- mode: rst -*-
|
2
|
+
|
3
|
+
=====================
|
4
|
+
The full Pygments API
|
5
|
+
=====================
|
6
|
+
|
7
|
+
This page describes the Pygments API.
|
8
|
+
|
9
|
+
High-level API
|
10
|
+
==============
|
11
|
+
|
12
|
+
.. module:: pygments
|
13
|
+
|
14
|
+
Functions from the :mod:`pygments` module:
|
15
|
+
|
16
|
+
.. function:: lex(code, lexer)
|
17
|
+
|
18
|
+
Lex `code` with the `lexer` (must be a `Lexer` instance)
|
19
|
+
and return an iterable of tokens. Currently, this only calls
|
20
|
+
`lexer.get_tokens()`.
|
21
|
+
|
22
|
+
.. function:: format(tokens, formatter, outfile=None)
|
23
|
+
|
24
|
+
Format a token stream (iterable of tokens) `tokens` with the
|
25
|
+
`formatter` (must be a `Formatter` instance). The result is
|
26
|
+
written to `outfile`, or if that is ``None``, returned as a
|
27
|
+
string.
|
28
|
+
|
29
|
+
.. function:: highlight(code, lexer, formatter, outfile=None)
|
30
|
+
|
31
|
+
This is the most high-level highlighting function.
|
32
|
+
It combines `lex` and `format` in one function.
|
33
|
+
|
34
|
+
|
35
|
+
.. module:: pygments.lexers
|
36
|
+
|
37
|
+
Functions from :mod:`pygments.lexers`:
|
38
|
+
|
39
|
+
.. function:: get_lexer_by_name(alias, **options)
|
40
|
+
|
41
|
+
Return an instance of a `Lexer` subclass that has `alias` in its
|
42
|
+
aliases list. The lexer is given the `options` at its
|
43
|
+
instantiation.
|
44
|
+
|
45
|
+
Will raise :exc:`pygments.util.ClassNotFound` if no lexer with that alias is
|
46
|
+
found.
|
47
|
+
|
48
|
+
.. function:: get_lexer_for_filename(fn, **options)
|
49
|
+
|
50
|
+
Return a `Lexer` subclass instance that has a filename pattern
|
51
|
+
matching `fn`. The lexer is given the `options` at its
|
52
|
+
instantiation.
|
53
|
+
|
54
|
+
Will raise :exc:`pygments.util.ClassNotFound` if no lexer for that filename
|
55
|
+
is found.
|
56
|
+
|
57
|
+
.. function:: get_lexer_for_mimetype(mime, **options)
|
58
|
+
|
59
|
+
Return a `Lexer` subclass instance that has `mime` in its mimetype
|
60
|
+
list. The lexer is given the `options` at its instantiation.
|
61
|
+
|
62
|
+
Will raise :exc:`pygments.util.ClassNotFound` if not lexer for that mimetype
|
63
|
+
is found.
|
64
|
+
|
65
|
+
.. function:: guess_lexer(text, **options)
|
66
|
+
|
67
|
+
Return a `Lexer` subclass instance that's guessed from the text in
|
68
|
+
`text`. For that, the :meth:`.analyse_text()` method of every known lexer
|
69
|
+
class is called with the text as argument, and the lexer which returned the
|
70
|
+
highest value will be instantiated and returned.
|
71
|
+
|
72
|
+
:exc:`pygments.util.ClassNotFound` is raised if no lexer thinks it can
|
73
|
+
handle the content.
|
74
|
+
|
75
|
+
.. function:: guess_lexer_for_filename(filename, text, **options)
|
76
|
+
|
77
|
+
As :func:`guess_lexer()`, but only lexers which have a pattern in `filenames`
|
78
|
+
or `alias_filenames` that matches `filename` are taken into consideration.
|
79
|
+
|
80
|
+
:exc:`pygments.util.ClassNotFound` is raised if no lexer thinks it can
|
81
|
+
handle the content.
|
82
|
+
|
83
|
+
.. function:: get_all_lexers()
|
84
|
+
|
85
|
+
Return an iterable over all registered lexers, yielding tuples in the
|
86
|
+
format::
|
87
|
+
|
88
|
+
(longname, tuple of aliases, tuple of filename patterns, tuple of mimetypes)
|
89
|
+
|
90
|
+
.. versionadded:: 0.6
|
91
|
+
|
92
|
+
|
93
|
+
.. module:: pygments.formatters
|
94
|
+
|
95
|
+
Functions from :mod:`pygments.formatters`:
|
96
|
+
|
97
|
+
.. function:: get_formatter_by_name(alias, **options)
|
98
|
+
|
99
|
+
Return an instance of a :class:`.Formatter` subclass that has `alias` in its
|
100
|
+
aliases list. The formatter is given the `options` at its instantiation.
|
101
|
+
|
102
|
+
Will raise :exc:`pygments.util.ClassNotFound` if no formatter with that
|
103
|
+
alias is found.
|
104
|
+
|
105
|
+
.. function:: get_formatter_for_filename(fn, **options)
|
106
|
+
|
107
|
+
Return a :class:`.Formatter` subclass instance that has a filename pattern
|
108
|
+
matching `fn`. The formatter is given the `options` at its instantiation.
|
109
|
+
|
110
|
+
Will raise :exc:`pygments.util.ClassNotFound` if no formatter for that filename
|
111
|
+
is found.
|
112
|
+
|
113
|
+
|
114
|
+
.. module:: pygments.styles
|
115
|
+
|
116
|
+
Functions from :mod:`pygments.styles`:
|
117
|
+
|
118
|
+
.. function:: get_style_by_name(name)
|
119
|
+
|
120
|
+
Return a style class by its short name. The names of the builtin styles
|
121
|
+
are listed in :data:`pygments.styles.STYLE_MAP`.
|
122
|
+
|
123
|
+
Will raise :exc:`pygments.util.ClassNotFound` if no style of that name is
|
124
|
+
found.
|
125
|
+
|
126
|
+
.. function:: get_all_styles()
|
127
|
+
|
128
|
+
Return an iterable over all registered styles, yielding their names.
|
129
|
+
|
130
|
+
.. versionadded:: 0.6
|
131
|
+
|
132
|
+
|
133
|
+
.. module:: pygments.lexer
|
134
|
+
|
135
|
+
Lexers
|
136
|
+
======
|
137
|
+
|
138
|
+
The base lexer class from which all lexers are derived is:
|
139
|
+
|
140
|
+
.. class:: Lexer(**options)
|
141
|
+
|
142
|
+
The constructor takes a \*\*keywords dictionary of options.
|
143
|
+
Every subclass must first process its own options and then call
|
144
|
+
the `Lexer` constructor, since it processes the `stripnl`,
|
145
|
+
`stripall` and `tabsize` options.
|
146
|
+
|
147
|
+
An example looks like this:
|
148
|
+
|
149
|
+
.. sourcecode:: python
|
150
|
+
|
151
|
+
def __init__(self, **options):
|
152
|
+
self.compress = options.get('compress', '')
|
153
|
+
Lexer.__init__(self, **options)
|
154
|
+
|
155
|
+
As these options must all be specifiable as strings (due to the
|
156
|
+
command line usage), there are various utility functions
|
157
|
+
available to help with that, see `Option processing`_.
|
158
|
+
|
159
|
+
.. method:: get_tokens(text)
|
160
|
+
|
161
|
+
This method is the basic interface of a lexer. It is called by
|
162
|
+
the `highlight()` function. It must process the text and return an
|
163
|
+
iterable of ``(tokentype, value)`` pairs from `text`.
|
164
|
+
|
165
|
+
Normally, you don't need to override this method. The default
|
166
|
+
implementation processes the `stripnl`, `stripall` and `tabsize`
|
167
|
+
options and then yields all tokens from `get_tokens_unprocessed()`,
|
168
|
+
with the ``index`` dropped.
|
169
|
+
|
170
|
+
.. method:: get_tokens_unprocessed(text)
|
171
|
+
|
172
|
+
This method should process the text and return an iterable of
|
173
|
+
``(index, tokentype, value)`` tuples where ``index`` is the starting
|
174
|
+
position of the token within the input text.
|
175
|
+
|
176
|
+
This method must be overridden by subclasses.
|
177
|
+
|
178
|
+
.. staticmethod:: analyse_text(text)
|
179
|
+
|
180
|
+
A static method which is called for lexer guessing. It should analyse
|
181
|
+
the text and return a float in the range from ``0.0`` to ``1.0``.
|
182
|
+
If it returns ``0.0``, the lexer will not be selected as the most
|
183
|
+
probable one, if it returns ``1.0``, it will be selected immediately.
|
184
|
+
|
185
|
+
.. note:: You don't have to add ``@staticmethod`` to the definition of
|
186
|
+
this method, this will be taken care of by the Lexer's metaclass.
|
187
|
+
|
188
|
+
For a list of known tokens have a look at the :doc:`tokens` page.
|
189
|
+
|
190
|
+
A lexer also can have the following attributes (in fact, they are mandatory
|
191
|
+
except `alias_filenames`) that are used by the builtin lookup mechanism.
|
192
|
+
|
193
|
+
.. attribute:: name
|
194
|
+
|
195
|
+
Full name for the lexer, in human-readable form.
|
196
|
+
|
197
|
+
.. attribute:: aliases
|
198
|
+
|
199
|
+
A list of short, unique identifiers that can be used to lookup
|
200
|
+
the lexer from a list, e.g. using `get_lexer_by_name()`.
|
201
|
+
|
202
|
+
.. attribute:: filenames
|
203
|
+
|
204
|
+
A list of `fnmatch` patterns that match filenames which contain
|
205
|
+
content for this lexer. The patterns in this list should be unique among
|
206
|
+
all lexers.
|
207
|
+
|
208
|
+
.. attribute:: alias_filenames
|
209
|
+
|
210
|
+
A list of `fnmatch` patterns that match filenames which may or may not
|
211
|
+
contain content for this lexer. This list is used by the
|
212
|
+
:func:`.guess_lexer_for_filename()` function, to determine which lexers
|
213
|
+
are then included in guessing the correct one. That means that
|
214
|
+
e.g. every lexer for HTML and a template language should include
|
215
|
+
``\*.html`` in this list.
|
216
|
+
|
217
|
+
.. attribute:: mimetypes
|
218
|
+
|
219
|
+
A list of MIME types for content that can be lexed with this
|
220
|
+
lexer.
|
221
|
+
|
222
|
+
|
223
|
+
.. module:: pygments.formatter
|
224
|
+
|
225
|
+
Formatters
|
226
|
+
==========
|
227
|
+
|
228
|
+
A formatter is derived from this class:
|
229
|
+
|
230
|
+
|
231
|
+
.. class:: Formatter(**options)
|
232
|
+
|
233
|
+
As with lexers, this constructor processes options and then must call the
|
234
|
+
base class :meth:`__init__`.
|
235
|
+
|
236
|
+
The :class:`Formatter` class recognizes the options `style`, `full` and
|
237
|
+
`title`. It is up to the formatter class whether it uses them.
|
238
|
+
|
239
|
+
.. method:: get_style_defs(arg='')
|
240
|
+
|
241
|
+
This method must return statements or declarations suitable to define
|
242
|
+
the current style for subsequent highlighted text (e.g. CSS classes
|
243
|
+
in the `HTMLFormatter`).
|
244
|
+
|
245
|
+
The optional argument `arg` can be used to modify the generation and
|
246
|
+
is formatter dependent (it is standardized because it can be given on
|
247
|
+
the command line).
|
248
|
+
|
249
|
+
This method is called by the ``-S`` :doc:`command-line option <cmdline>`,
|
250
|
+
the `arg` is then given by the ``-a`` option.
|
251
|
+
|
252
|
+
.. method:: format(tokensource, outfile)
|
253
|
+
|
254
|
+
This method must format the tokens from the `tokensource` iterable and
|
255
|
+
write the formatted version to the file object `outfile`.
|
256
|
+
|
257
|
+
Formatter options can control how exactly the tokens are converted.
|
258
|
+
|
259
|
+
.. versionadded:: 0.7
|
260
|
+
A formatter must have the following attributes that are used by the
|
261
|
+
builtin lookup mechanism.
|
262
|
+
|
263
|
+
.. attribute:: name
|
264
|
+
|
265
|
+
Full name for the formatter, in human-readable form.
|
266
|
+
|
267
|
+
.. attribute:: aliases
|
268
|
+
|
269
|
+
A list of short, unique identifiers that can be used to lookup
|
270
|
+
the formatter from a list, e.g. using :func:`.get_formatter_by_name()`.
|
271
|
+
|
272
|
+
.. attribute:: filenames
|
273
|
+
|
274
|
+
A list of :mod:`fnmatch` patterns that match filenames for which this
|
275
|
+
formatter can produce output. The patterns in this list should be unique
|
276
|
+
among all formatters.
|
277
|
+
|
278
|
+
|
279
|
+
.. module:: pygments.util
|
280
|
+
|
281
|
+
Option processing
|
282
|
+
=================
|
283
|
+
|
284
|
+
The :mod:`pygments.util` module has some utility functions usable for option
|
285
|
+
processing:
|
286
|
+
|
287
|
+
.. exception:: OptionError
|
288
|
+
|
289
|
+
This exception will be raised by all option processing functions if
|
290
|
+
the type or value of the argument is not correct.
|
291
|
+
|
292
|
+
.. function:: get_bool_opt(options, optname, default=None)
|
293
|
+
|
294
|
+
Interpret the key `optname` from the dictionary `options` as a boolean and
|
295
|
+
return it. Return `default` if `optname` is not in `options`.
|
296
|
+
|
297
|
+
The valid string values for ``True`` are ``1``, ``yes``, ``true`` and
|
298
|
+
``on``, the ones for ``False`` are ``0``, ``no``, ``false`` and ``off``
|
299
|
+
(matched case-insensitively).
|
300
|
+
|
301
|
+
.. function:: get_int_opt(options, optname, default=None)
|
302
|
+
|
303
|
+
As :func:`get_bool_opt`, but interpret the value as an integer.
|
304
|
+
|
305
|
+
.. function:: get_list_opt(options, optname, default=None)
|
306
|
+
|
307
|
+
If the key `optname` from the dictionary `options` is a string,
|
308
|
+
split it at whitespace and return it. If it is already a list
|
309
|
+
or a tuple, it is returned as a list.
|
310
|
+
|
311
|
+
.. function:: get_choice_opt(options, optname, allowed, default=None)
|
312
|
+
|
313
|
+
If the key `optname` from the dictionary is not in the sequence
|
314
|
+
`allowed`, raise an error, otherwise return it.
|
315
|
+
|
316
|
+
.. versionadded:: 0.8
|