# Syntax Highlighting in Discourse?

**URL:** <https://racket.discourse.group/t/syntax-highlighting-in-discourse/240>\
**Category:** Site Feedback\
**Created:** [November 23, 2021, 10:51pm UTC](https://racket.discourse.group/t/syntax-highlighting-in-discourse/240 "2021-11-23T22:51:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![spdegabrielle](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/spdegabrielle/32/95_2.png) [@spdegabrielle](https://racket.discourse.group/u/spdegabrielle)\
**Post date:** [November 24, 2021, 8:49am UTC](https://racket.discourse.group/t/syntax-highlighting-in-discourse/240/2 "2021-11-24T08:49:14Z")

</div>

I’ve forked highlight.js and started adding racket identifiers to a copy of [scheme.js](https://github.com/spdegabrielle/highlight.js/blob/main/src/languages/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](http://pasterack.org/pastes/86700)  
gives an error in the discourse preview  
 ![image](https://global.discourse-cdn.com/free1/uploads/racket/original/1X/37d922968cbcccf1ff0d69ffd4f877ad17cb4d67.png)

> <https://github.com/stchang/pasterack/issues/70#issuecomment-971901705>
>
> https://racket.discourse.group/t/link-preview-did-not-render-for-twitch-racket-l…ivestream-link/96/3?u=spdegabrielle
> 
> error on Discourse when discourse attempts to render a preview from pasterack: 
> \> oEmbed / OpenGraph tags could not be found: description, image
> 
> \- https://oembed.com
> \- https://ogp.me
> 
> Might be fun to see if I can get http://pasterack.org/pastes/29314 to render code + fish
> 
> I think I need to mess with these lines: https://github.com/stchang/pasterack/blob/1e4e2cc31e873044e76e329d42761363a9875fa2/pasterack.rkt#L709
> 
> 
> (assign to me if you like)

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:

> [@Syntax coloring (was: First Post)](https://racket.discourse.group/t/syntax-coloring-was-first-post/20/5):
>
> It supports scheme, via [highlight.js](https://highlightjs.org/), which does not support Racket.

```scheme
#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)

```

---

_[View the full topic](https://racket.discourse.group/t/syntax-highlighting-in-discourse/240)._
