sheharyarn

sheharyarn

Elixir Syntax Highlighting on Stackoverflow

I would really like to see Syntax Highlighting support for Elixir on Stackoverflow. Someone already created a topic on Meta StackExchange but since SE relies on an external syntax highlighting tool (Google’s code-prettify), there hasn’t been any work to support Elixir (even though an issue was also opened there over a year ago).

I’m interested in making this happen (as someone who spends 5+ hours daily on SO - especially in the Elixir tag). So my questions are:

  • How do I get started in adding Elixir support to code-prettify?
  • How do I represent Elixir constructs that need to be highlighted?
  • And should I even send in a pull request? There seems to be minimal activity in the project, and many pull requests haven’t been merged or closed for a while.

First Post!

nietaki

nietaki

I was thinking about the same thing and slowly started looking into that. It seems like the syntax highlighting definitions for erlang or Scala aren’t really that complicated, and I would argue Scala has a more ambiguous syntax than Elixir.

It also seems like the code-prettify project is still pretty alive and they do accept PRs, so that’s all looking good.

Is there a good place to get Elixir’s grammar or something similar? It would probably help make the highlighter more comprehensive.

Most Liked

nietaki

nietaki

It feels like I’m mostly talking to myself here, but here’s the PR for the Elixir support: Add Elixir language support by nietaki · Pull Request #478 · googlearchive/code-prettify · GitHub

nietaki

nietaki

Allow me to bump the topic, since I run into ugly, non-highligthed code on SO once more and it boiled my blood a bit again.

To summarise the situation, the feature has been requested four and a half years ago and about a year ago I wrote the highlighter necessary for the SO people to integrate Elixir highlighting with their site without breaking much of a sweat. Still, there hasn’t been any progress on the issue since, and it looks like SO has a policy on not improving syntax highlighting on the site ever again.

While I have no reason to be optimistic about the whole situation, it feels like it would be good to raise the profile of the feature request, or otherwise nothing is going to change. From what I’m reading the best bet is to upvote the request and add/or add a bounty for it. I’d happily do it myself, but I don’t have enough karma on Meta Stack Exchange…

Soo I guess what I’m saying is: Does anyone have some Meta Stack Exchange karma to use for a good cause? :]

Edit: I’m curious, which of the other Most Loved Languages according to SO Developer Survey 2017 don’t have the syntax highlighting support :smiley:

notriddle

notriddle

Breaks when I type this in:

"I love me some #{ "string" <> "y" } interpolation"

It might not support hilighting inside string interpolation, but it should at least ignore quotes inside of an interpolated part, so it doesn’t just look wrong.

Last Post!

ismaelga

ismaelga

If anyone still cares about this, a quick upvote here could help: https://meta.stackexchange.com/questions/360682/syntax-highlight-request-elixir

Where Next?

Popular in Discussions Top

scouten
I’m looking for a host for the server part of a small (personal) side project that I’m working on. It’s currently written in Node.js and ...
New
AstonJ
If a newbie asked you about Phoenix Contexts, how would you explain the basics to them? Feel free to be as concise or in-depth as you li...
New
acrolink
How does the two languages compare when it comes to server side application development? Any experiences or ideas? Thank you.
New
thojanssens1
It would be nice to be able to define a redirect from one route to another from the router.ex file. E.g.: redirect "/", UserController, ...
New
owaisqayum
I have a sample string sentence = "Hello, world ... 123 *** ^%&amp;*())^% %%:&gt;" From this string, I want to only keep the integers, ...
New
crispinb
On reading dhh’s latest The One Person Framework it strikes me that Phoenix with LiveView is already pretty much this. However, never hav...
New
paulanthonywilson
I like Umbrella projects and pretty much always use them for personal Elixir stuff, especially Nerves things. But I don’t think this is ...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49134 226
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New