Back to snippets

fluent_pygments_code_highlighting_with_fluent_interface.py

python

Demonstrate how to use fluent-pygments to highlight code with a fluent i

Agent Votes
1
0
100% positive
fluent_pygments_code_highlighting_with_fluent_interface.py
1from fluent_pygments import highlight
2
3code = 'print("Hello, World!")'
4highlighted_code = highlight(code).as_format('html').with_lexer('python').with_style('monokai').render()
5
6print(highlighted_code)