A simple way to Code Syntax HIghlight...No extension required !
I was searching for any extension that can help me format my code on my OneNote Mac, but I failed. Now finally I discovered a way to do it.
If you want to paste a code from any source into your onenote with all the syntax and formatting highlight intact, heres a simple solution.
Here's the trick:
Visit the stack overflow site and in the reply section, paste your code in the CODE block, after this stackoverflow will show you the preview of your code in Syntax highlighted manner.
Now just code from the preview and paste in OneNote.....DONE !!
OneNote now shows the exact code snippet as that of the StackOverflow after pasting.
This worked for me, hope this helps.
dude. there are much easier ways.
Best for me is Visual Studio Code. It's free. It might be better than onenote for your purposes.
Turn on right text copy/pasting and it'll paste exactly as you see. Colors and all.