# Show and Tell: ClientSide Callback javascript syntax highlighting in Python Multi-line Strings

**URL:** <https://community.plotly.com/t/show-and-tell-clientside-callback-javascript-syntax-highlighting-in-python-multi-line-strings/56663>\
**Category:** Dash Python\
**Tags:** show-and-tell\
**Created:** [September 16, 2021, 3:11pm UTC](https://community.plotly.com/t/show-and-tell-clientside-callback-javascript-syntax-highlighting-in-python-multi-line-strings/56663 "2021-09-16T15:11:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevenallenking](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@stevenallenking](https://community.plotly.com/u/stevenallenking)\
**Post date:** [September 16, 2021, 3:11pm UTC](https://community.plotly.com/t/show-and-tell-clientside-callback-javascript-syntax-highlighting-in-python-multi-line-strings/56663/1 "2021-09-16T15:11:32Z")

</div>

Hello All,

I have created an [extension in VS code](https://marketplace.visualstudio.com/items?itemName=StevenAllenKing.python-string-syntax-highlight) which will inject syntax highlighting for javascript within multi-line python strings.  
[https://marketplace.visualstudio.com/items?itemName=StevenAllenKing.python-string-syntax-highlight](https://marketplace.visualstudio.com/items?itemName=StevenAllenKing.python-string-syntax-highlight)

When developing clientside callbacks in Dash Apps, I have found that the lack of syntax highlighting makes it difficult to troubleshoot javascript code when passing that code as a string.

Here is an example of the syntax, all you have to do is add `//js` at the beginning of your multi-line string and `;//` at the end of the string and vscode will pick up the default javascript syntax highlighting.

Before:  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/7/5/756231bc99bf49c08b1f6c260964af00843453ef.png)

After:  
 ![demo](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/5/0/50ff1ec44932ca823bf4a4418a8ec1a9ebb11c40.png)

Here is the link to the repo if anyone wants to contribute or finds any bugs with the extension.  
[https://github.com/StevenAllenKing/python-string-syntax-highlight](https://github.com/StevenAllenKing/python-string-syntax-highlight)

Thank you,  
Steven King

---

<div class="post-metadata">

**Author:** ![alidash](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@alidash](https://community.plotly.com/u/alidash)\
**Post date:** [September 16, 2021, 3:16pm UTC](https://community.plotly.com/t/show-and-tell-clientside-callback-javascript-syntax-highlighting-in-python-multi-line-strings/56663/2 "2021-09-16T15:16:57Z")

</div>

This is a godsend! Thank you. Already using it, works great!

---

<div class="post-metadata">

**Author:** ![chriddyp](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chriddyp/32/16855_2.png) [@chriddyp](https://community.plotly.com/u/chriddyp)\
**Post date:** [September 16, 2021, 7:34pm UTC](https://community.plotly.com/t/show-and-tell-clientside-callback-javascript-syntax-highlighting-in-python-multi-line-strings/56663/3 "2021-09-16T19:34:05Z")

</div>

This is so great, thanks for sharing!

---

<div class="post-metadata">

**Author:** ![stevenallenking](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@stevenallenking](https://community.plotly.com/u/stevenallenking)\
**Post date:** [September 16, 2021, 8:45pm UTC](https://community.plotly.com/t/show-and-tell-clientside-callback-javascript-syntax-highlighting-in-python-multi-line-strings/56663/4 "2021-09-16T20:45:54Z")

</div>

Thank you Chris, I hope it’s helpful for people.
