summaryrefslogtreecommitdiffstats
path: root/scripts/get_lexer_list.py
blob: 9453ff73313075f69716d310485f5e10071eb9d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/python

import pygments.lexers
import json

ret = []

def dictify(list):
    return {k:True for k in list}

for fullname, names, exts, mimetypes in pygments.lexers.get_all_lexers():
    ret.append({
        'fullname': fullname,
        'names': dictify(names),
        'extentions': dictify(exts),
        'mimetypes': dictify(mimetypes),
        })
print(json.dumps(ret))