Re: Pygments YAML Lexer (from Spec Update)

Jeff Kowalczyk <jtk-/[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
On Tue, 20 May 2008 10:25:37 -0400, Jeff Kowalczyk wrote:

> On Tue, 20 May 2008 14:54:50 +0300, Kirill Simonov wrote:
>> Here is my attempt to write a YAML lexer for Pygments.  It's hardly
>> tested, so expect bugs.  I was also unable to choose suitable token
>> types from the existing tokens provided by the package, so I had to
>> create YAML-specific tokens.
>> 
>> The lexer file as well as a yaml file I've used for tests are here:
>> http://svn.pyyaml.org/pyyaml/trunk/examples/pygments-lexer/
>> 
>> Thanks,
>> Kirill
> 
> Thank you very much for the implementation, Kirill. I've integrated the
> code as a patch to pygments/lexers/text.py, and bundled it for upstream to
> include in pygments:
> 
> http://dev.pocoo.org/projects/pygments/ticket/328
> 
> Thanks,
> Jeff

I'm happy to report that Kirill's YamlLexer implementation was accepted
right away into pygments main mercurial repository.

Changeset [564:3c18200871c5] by gbrandl Rename YAMLLexer to YamlLexer? to
be consistent with other names.
http://dev.pocoo.org/projects/pygments/changeset/564%3A3c18200871c5

Changeset [563:cfe7884f4d73] by gbrandl Merge after yaml lexer addition.
http://dev.pocoo.org/projects/pygments/changeset/563%3Acfe7884f4d73

YamlLexer should be present in the next release of pygments, which means
tools like Trac and Sphinx will soon colorize YAML.

gbrandl made some token=style mapping substitutions for us. Some YAML
tokens are still custom style names, and as such are not visibly colorized
out of the box (the user would need to supply a CSS rule).

I'll gather some information on all pygments built-in styles and start a
new thread here to get some input on additional syntax tokens which could
reasonably map to built-in styles.

Thanks again Kirill,
Jeff


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.