Nix code Highlighting


#1

Just enabled the code highlighting for Nix source :slight_smile:

{ stdenv, fetchurl }:
stdenv.mkDerivation rec {
  name = "foo-${version}";
  version = "1.2.3";
  src = fetchurl {
    url = "https://dl.foo.com/foo-${version}.tar.gz";
    sha256 = "...";
  };
}

PS: Discourse is using hightlight.js for the code highlighting.


#2

As a note, the syntax highlighting doesn’t appear in emails. Not sure if there is anything we can do about this from our end?


#3

Highlight.js leaves the syntax tokenizing to the JavaScript so nothing is happening server side. I don’t think that there is an easy fix for that.