from pygments.formatters import HtmlFormatter
from pygments.lexers import guess_lexer, guess_lexer_for_filename
-from sys import stdin
+from sys import stdin, stderr
filename = stdin.readline().strip()
contents = stdin.read()
lexer = TextLexer
FORMAT = HtmlFormatter(
- lineos='table',
+ style='murphy',
+ cssclass='highlight',
+ linenos='table',
lineanchors='loc',
anchorlinenos=True)
print(highlight(contents, lexer, FORMAT))
+print('<style>')
+print(FORMAT.get_style_defs('.highlight'))
+print('</style>')
+print("Lexer: {}.".format(lexer), file=stderr)