diff options
| author | blackbird <devnull@localhost> | 2006-12-06 17:52:14 +0100 |
|---|---|---|
| committer | blackbird <devnull@localhost> | 2006-12-06 17:52:14 +0100 |
| commit | 60991d5ba0c95fb9c5987e925ac836c0cf7659c0 (patch) | |
| tree | 9f44cf75d313ca0324fe94573fe33ff0244c107b /scripts | |
| parent | 81cda8afbbec34f3e42461bdb4e57763797666f2 (diff) | |
| download | pygments-60991d5ba0c95fb9c5987e925ac836c0cf7659c0.tar.gz | |
[svn] added documentation helper script and updated lexer documentation regarding the new mygthy lexers
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/find_abandoned_lexers.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/scripts/find_abandoned_lexers.py b/scripts/find_abandoned_lexers.py new file mode 100644 index 00000000..1f837d23 --- /dev/null +++ b/scripts/find_abandoned_lexers.py @@ -0,0 +1,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 |
