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 | |
parent | 81cda8afbbec34f3e42461bdb4e57763797666f2 (diff) | |
download | pygments-60991d5ba0c95fb9c5987e925ac836c0cf7659c0.tar.gz |
[svn] added documentation helper script and updated lexer documentation regarding the new mygthy lexers
-rw-r--r-- | docs/src/lexers.txt | 50 | ||||
-rw-r--r-- | scripts/find_abandoned_lexers.py | 45 |
2 files changed, 93 insertions, 2 deletions
diff --git a/docs/src/lexers.txt b/docs/src/lexers.txt index 834be378..6baf7eb1 100644 --- a/docs/src/lexers.txt +++ b/docs/src/lexers.txt @@ -29,8 +29,7 @@ Currently, **all lexers** support these options: guess the encoding of the input. -These lexers are builtin and can be imported from -`pygments.lexers`: +These lexers are builtin and can be imported from `pygments.lexers`: Special lexers @@ -519,6 +518,53 @@ Template languages :Filename patterns: None +`MyghtyLexer` + + Generic `myghty templates`_ lexer. Code that isn't Myghty + markup is yielded as `Token.Other`. + + .. _mygthy templates: http://www.myghty.org/ + + :Aliases: ``myghty`` + :Filename patterns: ``*.myt``, ``autodelegate`` + + +`MyghtyHtmlLexer` + + Subclass of the `MyghtyLexer` that highlights unlexer data + with the `HtmlLexer`. + + :Aliases: ``html+myghty`` + :Filename patterns: None + + +`MyghtyXmlLexer` + + Subclass of the `MyghtyLexer` that highlights unlexer data + with the `XmlLexer`. + + :Aliases: ``xml+myghty`` + :Filename patterns: None + + +`MyghtyJavascriptLexer` + + Subclass of the `MyghtyLexer` that highlights unlexer data + with the `JavascriptLexer`. + + :Aliases: ``js+myghty``, ``javascript+myghty`` + :Filename patterns: None + + +`MyghtyCssLexer` + + Subclass of the `MyghtyLexer` that highlights unlexer data + with the `CssLexer`. + + :Aliases: ``css+myghty`` + :Filename patterns: None + + Other languages =============== 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 |