sheharyarn
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.
Trending in Discussions
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
New
I want to open this thread for you all to discuss and help those who really like Ash but are still hesitant to use it in a real project. ...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
I’m posting this in response to Jose’s recent tweet (Cr. link) :
People are sleeping on Elixir for a coding harness:
Hot-code swappi...
New
It would be helpful to have a list of companies worldwide that hire engineers without prior experience in Elixir. Often, it can be quite ...
New
Anyone running long-lived stateful processes on BEAM? We’re building an AI agent runtime and would love to compare notes.
We’re a small ...
New
This might be a bit disturbing for some but it’s happening - computers running on living human neurons. They’ve made them smart enough t...
New
Other Trending Topics
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Aludel - LLM Evaluation Workbench
Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #blog-post
- #ai
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 14 to 5- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
ismaelga
If anyone still cares about this, a quick upvote here could help: https://meta.stackexchange.com/questions/360682/syntax-highlight-request-elixir
sheharyarn
We’re half way through 2018 and there’s still no Elixir syntax highlighting on Stackoverflow – That’s disappointing. I just opened a
supportthread on Meta, asking for help on the topic: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
nietaki
Thanks for the feedback, @notriddle!
You’re definitely right about the string inside string interpolation case. I’ll try and fix it soon.
I was in two minds whether to make
%{"THIS": :foo}highlight as an atom or not. I decided to go with the string highlighting because it made the string detection much faster, using some short circuiting logic in the code. But in the end I think you’re right on that one as well, and I should make it display as atom as well.notriddle
Your example here:
Both of them are atoms; :“also an atom” and :“yes, this compiles” are both atoms. Your syntax hilighter thinks that “yes, this compiles” is a string.
notriddle
Breaks when I type this in:
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.
OvermindDL1
Cool, better syntax highlighting on popular syntax highlighters, even if the syntax highlighter itself is stupidly made in regex but nothing you can do about that, is still a great help due to the visibility!
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
I have tried the highlighting with some more code and ironed out some issues. An updated interactive demo still available on rawgit.
I’m aiming to write some tests and submit a PR this weekend, so if you have any feedback, speak up
nietaki
Don’t look in the source then
It is what it is though, as long as it makes the StackOverflow questions/answers more readable, I’m a happy person.