summaryrefslogtreecommitdiffstats
path: root/scripts/get_lexer_list.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/get_lexer_list.py')
-rwxr-xr-xscripts/get_lexer_list.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/get_lexer_list.py b/scripts/get_lexer_list.py
new file mode 100755
index 000000000..1392459a8
--- /dev/null
+++ b/scripts/get_lexer_list.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env 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': names,
+ 'extentions': dictify(exts),
+ 'mimetypes': dictify(mimetypes),
+ })
+print(json.dumps(ret))