Crowdhailer

Crowdhailer

Creator of Raxx

What syntax highlighter do you use for web projects

I am currently writing documentation. I have been using highlight.js but the result isn’t very satisfying particularly for EEx templates. I don’t think EEx is supported and choosing HTML instead is not much better.

What are people using for syntax highlighting that I can try out? I want something that is JavaScript based so I can simply drop it into a page.

First 8 of 8 Posts! Switch mode

hubertlepicki

hubertlepicki

I use highlight.js too, with EEx templates treated as ERB.

Crowdhailer

Crowdhailer

Creator of Raxx

I’m getting odd highlighting of the embed tags, this was highlighted as erb.

Crowdhailer

Crowdhailer

Creator of Raxx

The error in hightlighting seems to be caused by the presence of the script tag.

Adding this line to other EEx sample breaks the highlighting of the embed tags

<script type="text/javascript"></script>
Artemitch

Artemitch

I use highlight.js as well. I’ve seen but not used Prism JS so I’d be interested in knowing if this is any better.

Semi-related: Swift has a package called Splash which lets you convert Swift code into HTML which you can then use CSS to style with no JS required. I think this approach is very cool and would love to see something like this for multiple languages.

LostKobrakai

LostKobrakai

There’s GitHub - elixir-makeup/makeup: Syntax highlighter for Elixir inspired by Pygments · GitHub for that in elixir. It’s what ex_doc is using for the last few versions.

Artemitch

Artemitch

Ah nice! I’ll check it out.

albydarned

albydarned

I used highlight.js for slickbit. It gets the job done! I tried a few others but once I got highlight.js configured how I wanted its been very easy to work with.

tristan

tristan

Rebar3 Core Team

Not what you are looking for, but if anyone sees this thread and goes to it looking for server side highlighting, I’ve been using GitHub - alecthomas/chroma: A general purpose syntax highlighter in pure Go · GitHub as a successor to pygments. Chroma comes with Hugo and is how https://adoptingerlang.org/ highlighting is done, originally this was overriden to use Pygments while a bug in Chroma for Erlang was fixed but now it works well.

Where Next?

Trending in Questions Top

jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
saveman71
Hello ! We want new/edit form pages to POST/PUT to their own URL rather than the resources REST defaults (post /things, put /things/:id)...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
michallepicki
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
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
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement