Esempio n. 1
0
def execute(input, options, environment):

    lexer = None
    #try :
    #lexer = lexers.get_lexer_for_mimetype(options[0])
    lexer = lexers.get_lexer_for_filename(input.name)
    # print "lexer is " + str(lexer)
    #except:
        #lexer = lexers.guess_lexer(input)

    #print "lexer is " + str(lexer)


    text = access.read_file(input.path)

    return highlight(lexer, text)
Esempio n. 2
0
def execute(input, options, environment):

    return access.read_file(input.path)
Esempio n. 3
0
def show_text(file):
    content = access.read_file(file.path)
    content = content.replace('\n', '<br />')
    return content