# Question about creating a theme component from HighlightJS script

**URL:** https://meta.discourse.org/t/question-about-creating-a-theme-component-from-highlightjs-script/351520
**Category:** Development
**Created:** [February 10, 2025, 7:08pm UTC](https://meta.discourse.org/t/question-about-creating-a-theme-component-from-highlightjs-script/351520 "2025-02-10T19:08:28Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![CarolineFrasca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/carolinefrasca/32/471881_2.png) [@CarolineFrasca](https://meta.discourse.org/u/CarolineFrasca)
#### Post date: [February 10, 2025, 7:08pm UTC](https://meta.discourse.org/t/question-about-creating-a-theme-component-from-highlightjs-script/351520/1 "2025-02-10T19:08:28Z")

</div>

Hi there! I saw your message about [building a theme component from a fork of HighlightJS](https://meta.discourse.org/t/configure-which-programming-languages-are-available-for-syntax-highlighting/239717/6). I am hoping to do something similar for [the Modular forum](https://forum.modular.com/) to [add syntax highlighting for Mojo](https://github.com/carolinefrasca/highlight.js/blob/main/src/languages/mojo.js) and I was wondering if you might be able to share any instructions or point me in the right direction? Thanks so much! 🙏

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [February 10, 2025, 8:36pm UTC](https://meta.discourse.org/t/question-about-creating-a-theme-component-from-highlightjs-script/351520/2 "2025-02-10T20:36:10Z")

</div>

Hey @CarolineFrasca, here is a theme-component wrapping your work and ready to use on Discourse. You can fork it, or use as it is.

[https://github.com/discourse/discourse-highlightjs-mojo](https://github.com/discourse/discourse-highlightjs-mojo)

It will look like this currently:

 ![The image displays Falo code with uncommented pop.variadic.create' operations, illustrating issues with incorrect op' calls, the desired case 1 initialization, the failure in prepopulating with five elements due to expected elements, and an unsuccessful attempt to append elements without the appropriate op' call. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/c/5/d/c5dd309db9f868ede1f179684ded47bf9d50c65b.jpeg)

The install instructions are the same as every theme component

1. Install it under admin \> customize
2. Add it to your main theme
3. Add “mojo” to the site setting `Highlighted languages`.

---

<div class="post-metadata">

### Author: ![CarolineFrasca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/carolinefrasca/32/471881_2.png) [@CarolineFrasca](https://meta.discourse.org/u/CarolineFrasca)
#### Post date: [February 10, 2025, 9:01pm UTC](https://meta.discourse.org/t/question-about-creating-a-theme-component-from-highlightjs-script/351520/3 "2025-02-10T21:01:08Z")

</div>

Oh my goodness, thank you so much!! I really, really appreciate this! Amazing.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [February 11, 2025, 2:43am UTC](https://meta.discourse.org/t/question-about-creating-a-theme-component-from-highlightjs-script/351520/6 "2025-02-11T02:43:56Z")

</div>


