# Call syntax highlighting programmatically?

**URL:** <https://discourse.jupyter.org/t/call-syntax-highlighting-programmatically/1493>\
**Category:** JupyterLab\
**Created:** [June 27, 2019, 10:27pm UTC](https://discourse.jupyter.org/t/call-syntax-highlighting-programmatically/1493 "2019-06-27T22:27:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![barik](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/barik/32/832_2.png) [@barik](https://discourse.jupyter.org/u/barik)\
**Post date:** [June 27, 2019, 10:27pm UTC](https://discourse.jupyter.org/t/call-syntax-highlighting-programmatically/1493/1 "2019-06-27T22:27:03Z")

</div>

I’m writing a JupyterLab extension and want to know if there is a programmatic way to, say, pass a string (containing some source code) and have it return the HTML syntax highlighted version. I would want the colors to be the same as what Markdown or input cells currently render.
