blob: 1f837d2331039f8508f579b781274f287ee53f07 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Find Not Documented Lexers
~~~~~~~~~~~~~~~~~~~~~~~~~~
Call it from the command line to find out which lexers arn't
in the documentation right now. Maybe it would be a good idea
to check the mimetypes, filename patterns and aliases too.
:copyright: 2006 by Armin Ronacher.
:license: GNU LGPL, see LICENSE for more details.
"""
import re
import sys
import os
base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
lexer_doc = os.path.join(base_path, 'docs', 'src', 'lexers.txt')
sys.path.insert(0, base_path)
from pygments.lexers import LEXERS
existing_lexers = set(LEXERS)
documented_lexers = set()
f = open(lexer_doc)
for line in f:
m = re.search('^`([a-zA-Z0-9]+Lexer)`\s*$(?m)', line)
if m:
documented_lexers.add(m.group(1))
f.close()
just_documented = sorted(documented_lexers.difference(existing_lexers))
not_documented = sorted(existing_lexers.difference(documented_lexers))
if just_documented:
print 'Lexers that just exist in the documentation:'
for lexer in just_documented:
print ' ', lexer
if not_documented:
print 'Lexers that are not documented by now:'
for lexer in not_documented:
print ' ', lexer
|