Skip to content

Commit

Permalink
Bump to latest pygments upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
tnm committed Feb 25, 2013
1 parent 257c870 commit b3fe04d
Show file tree
Hide file tree
Showing 132 changed files with 8,423 additions and 1,413 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG
@@ -0,0 +1,9 @@
changelog
===========

Version 0.3.4 (Dec 28, 2012)

* Add support for Windows
* Add MIT license


15 changes: 14 additions & 1 deletion vendor/pygments-main/AUTHORS
Expand Up @@ -9,6 +9,7 @@ Other contributors, listed alphabetically, are:
* Kumar Appaiah -- Debian control lexer
* Ali Afshar -- image formatter
* Andreas Amann -- AppleScript lexer
* Timothy Armstrong -- Dart lexer fixes
* Jeffrey Arnold -- R/S, Rd, BUGS, Jags, and Stan lexers
* Jeremy Ashkenas -- CoffeeScript lexer
* Stefan Matthias Aust -- Smalltalk lexer
Expand All @@ -25,6 +26,7 @@ Other contributors, listed alphabetically, are:
* Hiram Chirino -- Scaml and Jade lexers
* Ian Cooper -- VGL lexer
* Leaf Corcoran -- MoonScript lexer
* Christian Jann -- ShellSession lexer
* Christopher Creutzig -- MuPAD lexer
* Pete Curry -- bugfixes
* Owen Durni -- haXe lexer
Expand All @@ -33,24 +35,28 @@ Other contributors, listed alphabetically, are:
* Artem Egorkine -- terminal256 formatter
* James H. Fisher -- PostScript 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
* Alain Gilbert -- TypeScript lexer
* Bertrand Goetzmann -- Groovy lexer
* Krzysiek Goj -- Scala lexer
* Matt Good -- Genshi, Cheetah lexers
* Patrick Gotthardt -- PHP namespaces support
* Olivier Guibe -- Asymptote lexer
* Jordi Gutiérrez Hermoso -- Octave lexer
* Martin Harriman -- SNOBOL lexer
* Matthew Harrison -- SVG formatter
* Steven Hazel -- Tcl lexer
* Aslak Hellesøy -- Gherkin lexer
* Greg Hendershott -- Racket lexer
* Jordi Gutiérrez Hermoso -- Octave lexer
* David Hess, Fish Software, Inc. -- Objective-J lexer
* Varun Hiremath -- Debian control lexer
* Doug Hogan -- Mscgen lexer
* Ben Hollis -- Mason lexer
* Dustin Howett -- Logos lexer
* Alastair Houghton -- Lexer inheritance facility
* Tim Howard -- BlitzMax lexer
* Ivan Inozemtsev -- Fantom lexer
* Brian R. Jackson -- Tea lexer
Expand All @@ -69,15 +75,18 @@ Other contributors, listed alphabetically, are:
* Sylvestre Ledru -- Scilab lexer
* Mark Lee -- Vala lexer
* Ben Mabey -- Gherkin lexer
* Angus MacArthur -- QML 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
* 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
Expand Down Expand Up @@ -105,18 +114,22 @@ Other contributors, listed alphabetically, are:
* Joe Schafer -- Ada lexer
* Ken Schutte -- Matlab lexers
* Tassilo Schweyer -- Io, MOOCode lexers
* Ted Shaw -- AutoIt lexer
* Joerg Sieker -- ABAP lexer
* Robert Simmons -- Standard ML lexer
* Kirill Simonov -- YAML lexer
* Alexander Smishlajev -- Visual FoxPro lexer
* Steve Spigarelli -- XQuery lexer
* Jerome St-Louis -- eC lexer
* James Strachan -- Kotlin lexer
* Tom Stuart -- Treetop lexer
* Tiberius Teng -- default style overhaul
* Jeremy Thurgood -- Erlang, Squid config lexers
* Brian Tiffin -- OpenCOBOL lexer
* Erick Tryzelaar -- Felix lexer
* Daniele Varrazzo -- PostgreSQL lexers
* Abe Voelker -- OpenEdge ABL lexer
* Pepijn de Vos -- HTML formatter CTags support
* Whitney Young -- ObjectiveC lexer
* Matthias Vallentin -- Bro lexer
* Nathan Weizenbaum -- Haml and Sass lexers
Expand Down
62 changes: 56 additions & 6 deletions vendor/pygments-main/CHANGES
Expand Up @@ -2,44 +2,94 @@ Pygments changelog
==================

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

Version 1.6
-----------
(in development, to be released xx November 2012)
(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)
* 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)

- Fix Template Haskell highlighting (PR#63)
- 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).

- Fix some S/R lexer errors (PR#91)
- Add a Java quickstart document (PR#146).

- Fix a bug in the Prolog lexer with names that start with 'is' (#810)
- Add a "external/autopygmentize" file that can be used as .lessfilter (#802).


Version 1.5
Expand Down
2 changes: 1 addition & 1 deletion vendor/pygments-main/LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2006-2012 by the respective authors (see AUTHORS file).
Copyright (c) 2006-2013 by the respective authors (see AUTHORS file).
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion vendor/pygments-main/Makefile
Expand Up @@ -4,7 +4,7 @@
#
# Combines scripts for common tasks.
#
# :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
# :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
# :license: BSD, see LICENSE for details.
#

Expand Down
1 change: 1 addition & 0 deletions vendor/pygments-main/REVISION
@@ -0,0 +1 @@
157c9feaccb8
2 changes: 1 addition & 1 deletion vendor/pygments-main/docs/generate.py
Expand Up @@ -6,7 +6,7 @@
Generates a bunch of html files containing the documentation.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

Expand Down
2 changes: 1 addition & 1 deletion vendor/pygments-main/docs/src/api.txt
Expand Up @@ -64,7 +64,7 @@ def `guess_lexer(text, **options):`
def `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.

Expand Down
2 changes: 1 addition & 1 deletion vendor/pygments-main/docs/src/index.txt
Expand Up @@ -37,7 +37,7 @@ Welcome to the Pygments documentation.
- `Write your own lexer <lexerdevelopment.txt>`_

- `Write your own formatter <formatterdevelopment.txt>`_

- `Write your own filter <filterdevelopment.txt>`_

- `Register plugins <plugins.txt>`_
Expand Down
5 changes: 5 additions & 0 deletions vendor/pygments-main/docs/src/integrate.txt
Expand Up @@ -41,3 +41,8 @@ Bash completion

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

Java
----

See the `Java quickstart <java.txt>`_ document.
70 changes: 70 additions & 0 deletions vendor/pygments-main/docs/src/java.txt
@@ -0,0 +1,70 @@
=====================
Use Pygments in Java
=====================

Thanks to `Jython <http://www.jython.org>`__ it is possible to use Pygments in
Java.

This page is a simple tutorial to get an idea of how this is working. You can
then look at the `Jython documentation <http://www.jython.org/docs/>`__ for more
advanced use.

Since version 1.5, Pygments is deployed on `Maven Central
<http://repo1.maven.org/maven2/org/pygments/pygments/>`__ as a JAR so is Jython
which makes it a lot easier to create the Java project.

Here is an example of a `Maven <http://www.maven.org>`__ ``pom.xml`` file for a
project running Pygments:

.. sourcecode:: xml

<?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:

.. 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

<div class="highlight">
<pre><span class="k">print</span> <span class="s">&quot;Hello World&quot;</span></pre>
</div>
64 changes: 64 additions & 0 deletions vendor/pygments-main/external/autopygmentize
@@ -0,0 +1,64 @@
#!/bin/sh
# Best effort auto-pygmentization with transparent decompression
# (c) Reuben Thomas 2012-2013
# This program is in the public domain.

# Strategy: first see if pygmentize can find a lexer; if not, ask file; if that finds nothing, fail
# Set the environment variable PYGMENTIZE_OPTS to configure pygments.

# This program can be used as a .lessfilter for the less pager to auto-color less's output

lexer=`pygmentize -N "$1"`
if [ "$lexer" = "text" ]; then
file_common_opts="--brief --dereference --uncompress"

unset lexer
case `file --mime-type $file_common_opts "$1"` in
application/xml|image/svg+xml) lexer=xml;;
text/html) lexer=html;;
text/troff) lexer=nroff;;
text/x-asm) lexer=nasm;;
text/x-awk) lexer=awk;;
text/x-c) lexer=c;;
text/x-c++) lexer=cpp;;
text/x-diff) lexer=diff;;
text/x-fortran) lexer=fortran;;
text/x-gawk) lexer=gawk;;
text/x-java) lexer=java;;
text/x-lisp) lexer=common-lisp;;
text/x-lua) lexer=lua;;
text/x-makefile) lexer=make;;
text/x-msdos-batch) lexer=bat;;
text/x-nawk) lexer=nawk;;
text/x-pascal) lexer=pascal;;
text/x-perl) lexer=perl;;
text/x-php) lexer=php;;
text/x-po) lexer=po;;
text/x-python) lexer=python;;
text/x-ruby) lexer=ruby;;
text/x-shellscript) lexer=sh;;
text/x-tcl) lexer=tcl;;
text/x-tex|text/x-texinfo) lexer=latex;; # FIXME: texinfo really needs its own lexer

# Types that file outputs which pygmentize didn't support as of file 5.11, pygments 1.6rc1
# text/calendar
# text/PGP
# text/rtf
# text/texmacs
# text/x-bcpl
# text/x-info
# text/x-m4
# text/x-vcard
# text/x-xmcd
esac
fi

encoding=`file --brief --mime-encoding $file_common_opts "$1"`

if [ -n "$lexer" ]; then
# FIXME: Specify input encoding rather than output encoding https://bitbucket.org/birkenfeld/pygments-main/issue/800
zcat "$1" | pygmentize -O encoding=$encoding,outencoding=UTF-8 $PYGMENTIZE_OPTS -l $lexer
exit 0
fi

exit 1

0 comments on commit b3fe04d

Please sign in to comment.