#!/usr/bin/env python

from pygments import __version__
from pygments.lexers import get_all_lexers

print "# AUTOMATICALLY GENERATED BY bin/pygments-lexers"
print "# Pygments version %s" % __version__
print "---"

for name, aliases, filenames, mimetypes in get_all_lexers():
    print "- !ruby/struct:Linguist::Lexer"

    print "  name: %s" % name

    print "  aliases: !ruby/array"
    for alias in aliases:
        print "  - %s" % alias

    print "  filenames: !ruby/array"
    for filename in filenames:
        print "  - %s" % filename

    print "  mimetypes: !ruby/array"
    for mimetype in mimetypes:
        print "  - %s" % mimetype
