jonklein / niex

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

No syntax highlighting (running as dep in a project) #6

Closed mayel closed 3 years ago

mayel commented 3 years ago

Great project, thanks :)

I'm having trouble with highlighting not working (running as dep). I modified these lines in the deps/niex/assets/package.json to be able to run yarn there, but it didn't seem to help:

    "phoenix": "file:../../../deps/phoenix",
    "phoenix_html": "file:../../../deps/phoenix_html",
    "phoenix_live_view": "file:../../../deps/phoenix_live_view",
jonklein commented 3 years ago

Can you confirm your dependency version of Niex is up-to-date? The syntax highlighting was just merged yesterday so depending on when you added the dependency it may or not have made the cut.

mayel commented 3 years ago

I'll check when back at my pc, but I did set it up today and also saw mentions of the highlighting lib in the JS.

jonklein commented 3 years ago

Also, note that syntax highlighting is currently only on the command output, not on the code editing textarea, so that could be the issue as well.

mayel commented 3 years ago

Yeah I was checking the output render of a map.

mayel commented 3 years ago

Ok my bad, on second try I can see highlighting is being applied. It wasn't visible in my first try because it applies the same color to string and attr-name (eg. atoms). Maybe being able to configure a theme or choosing a different default would help.

BTW did I have to do that with package.json or is it meant to work out of the box as a dep?

jonklein commented 3 years ago

It should work without any changes - in fact, when bundled as a dependency, it should use pre-built js/css so that you don't need to run a separate webpack process.

Going to close this out - please reopen if you encounter further issues!