Exemplo n.º 1
0
def ruby2html(ruby_file):
    with open(ruby_file, encoding='utf-8') as prologf:
        code = prologf.readlines()
    html = highlight(''.join(code), PrologLexer(), HtmlFormatter())
    html_name = ''.join(ruby_file.split('.')[:-1]) + '.html'
    with open(html_name, 'w', encoding='utf-8') as hf:
        hf.writelines(html)
Exemplo n.º 2
0
 def __init__(self):
     self.pro_lexer = PrologLexer()