Syntax Highlighting in Discourse?

I’ve forked highlight.js and started adding racket identifiers to a copy of scheme.js that I’ve named racket.js

Not uploaded my changes yet because I’m only up to fixnums in the racket reference

Was only planning on identifiers - so it will still break on Racket specific syntax - so if anyone feels like picking something’s racket specific it would be a help.

I feel like handling #lang xxx yyy/zzz would be a sufficient start.

Another option is to use a pastebin that embeds in discourse posts or enhance pasterack to do the same with oEmbed

http://pasterack.org/pastes/86700
gives an error in the discourse preview
image

The GitHub embed above is both an example and a pointer to where I am up to - but I won’t be moving forward on this.

Previous notes:

#lang racket/gui

(define my-language 'English)

(define translations
  #hash([English . "Hello world"]
        [French . "Bonjour le monde"]
        [German . "Hallo Welt"]
        [Greek . "Γειά σου, κόσμε"]
        [Portuguese . "Olá mundo"]
        [Spanish . "Hola mundo"]
        [Thai . "สวัสดีชาวโลก"]))

(define my-hello-world
  (hash-ref translations my-language
            "hello world"))

(message-box "" my-hello-world)
1 Like