jonklein / niex

Niex is an interactive Elixir code notebook built with Phoenix LiveView.
419 stars 15 forks source link

Syntax highlighting? #4

Closed FreedomBen closed 3 years ago

FreedomBen commented 3 years ago

Dude, freaking amazing work. I just tried this out and it may revolutionize how I develop/test my apps. Really awesome.

Any plans to add syntax highlighting to the output, much like iEX does? That would be killer.

I can't do it right now but would send a PR for it later if somebody doesn't beat me to it. Thanks for this amazing tool and for making it so easy to drop into my existing Phoenix app so I can use it to test my code!

FreedomBen commented 3 years ago

I'm leaving some notes here for either myself in the future or someone else who decides to do it:

highlight.js looks like it should be pretty easy to drop in and it's used by stack exchange among others. The Elixir support looks really crappy though: https://highlightjs.org/usage/

Github uses Linguist, which seems worth looking at too: https://github.com/github/linguist

jonklein commented 3 years ago

Great suggestion, and thanks for the links to possible tools. I'll need to do some investigation of the various options to figure out how to proceed.

jonklein commented 3 years ago

A quick look at PrismJS looks promising.

jonklein commented 3 years ago
Screen Shot 2020-12-30 at 8 08 50 PM
jonklein commented 3 years ago

https://github.com/jonklein/niex/tree/feature/highlight if you'd like to try it out

FreedomBen commented 3 years ago

Awesome, it's working great on mine, thank you!

jonklein commented 3 years ago

Now live in master.