.gjs syntax highlighting on Discourse ๐ŸŽ‰

Iโ€™ve just installed a new Discourse theme component here which enables syntax highlighting for gjs (template-tag) files. To use it, tag your code fences with gjs like this:

```gjs
/* Code goes here */
```

For example:

import WeatherSummary from './weather-summary.js';

const Greeting = <template>
  <p>Hello, {{@name}}!</p>
</template>;

function isBirthday(dateOfBirth) {
  const now = new Date();
  return (
    dateOfBirth.getDate() === now.getDate() &&
    dateOfBirth.getMonth() === now.getMonth()
  );
}

<template>
  <div>
    <Greeting @name="Chris" />
    {{#if (isBirthday @user.dateOfBirth)}}
      <Celebration type='birthday' />
    {{/if}}
    <WeatherSummary />
  </div>
</template>

Thanks to @NullVoxPopuli for the highlightjs-glimmer package which weโ€™re leaning on for this :star_struck:

6 Likes

yay!!! :tada:

I have some bugfixes to land in there that Iโ€™ve found while making a documentation system over at https://ember-primitives.pages.dev/ :sweat_smile:

4 Likes