Пример #1
0
def setup(app):
    return 
    from sphinx.highlighting import lexers 
    from pygments.lexers.compiled import JavaLexer
    from pygments.filters import VisibleWhitespaceFilter 
    myLexer = JavaLexer()
    myLexer.add_filter(VisibleWhitespaceFilter(spaces=' ')) 
    app.add_lexer('python', myLexer);
Пример #2
0
 def analyse_text(text):
     rv = JavaLexer.analyse_text(text) - 0.01
     if looks_like_xml(text):
         rv += 0.4
     if '<%' in text and '%>' in text:
         rv += 0.1
     return rv
Пример #3
0
 def analyse_text(text):
     rv = JavaLexer.analyse_text(text) - 0.01
     if looks_like_xml(text):
         rv += 0.4
     if '<%' in text and '%>' in text:
         rv += 0.1
     return rv
Пример #4
0
 def analyse_text(text):
     rv = JavaLexer.analyse_text(text) - 0.01
     if looks_like_xml(text):
         rv += 0.4
     if "<%" in text and "%>" in text:
         rv += 0.1
     return rv