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

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': names,
        'extentions': dictify(exts),
        'mimetypes': dictify(mimetypes),
        })
print(json.dumps(ret))