# How to get Solidity syntax highlighting

**URL:** https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774
**Category:** Support
**Created:** [May 15, 2019, 7:00am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774 "2019-05-15T07:00:00Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![abcoathup](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abcoathup/32/145066_2.png) [@abcoathup](https://meta.discourse.org/u/abcoathup)
#### Post date: [May 15, 2019, 7:00am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774/1 "2019-05-15T07:00:00Z")

</div>

I am using a hosted Discourse service and wanted to know how to get Solidity syntax highlighting working.

Solidity isn’t a language in [GitHub - highlightjs/highlight.js: JavaScript syntax highlighter with language auto-detection and zero dependencies. · GitHub](https://github.com/highlightjs/highlight.js) but there is a repo for the Solidity language [GitHub - highlightjs/highlightjs-solidity · GitHub](https://github.com/highlightjs/highlightjs-solidity).

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 15, 2019, 7:03am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774/2 "2019-05-15T07:03:16Z")

</div>

Best approach is to submit a PR to highlightjs to add it, that way we will get it next time we upgrade highlightjs

---

<div class="post-metadata">

### Author: ![abcoathup](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abcoathup/32/145066_2.png) [@abcoathup](https://meta.discourse.org/u/abcoathup)
#### Post date: [May 15, 2019, 7:56am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774/3 "2019-05-15T07:56:41Z")

</div>

What is the frequency of that?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 15, 2019, 7:57am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774/4 "2019-05-15T07:57:50Z")

</div>

We pretty much update every release, if you get it into highlight we will update.

---

<div class="post-metadata">

### Author: ![abcoathup](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abcoathup/32/145066_2.png) [@abcoathup](https://meta.discourse.org/u/abcoathup)
#### Post date: [June 11, 2019, 6:12am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774/5 "2019-06-11T06:12:31Z")

</div>

Hi @sam  
I have been advised that Solidity should stay in it’s own repo ([GitHub - highlightjs/highlightjs-solidity · GitHub](https://github.com/highlightjs/highlightjs-solidity/)) rather than be added to the highlight.js repo.

[https://github.com/highlightjs/highlight.js/pull/2051#issuecomment-499711780](https://github.com/highlightjs/highlight.js/pull/2051#issuecomment-499711780)

How do I configure a hosted discourse forum to use this repo?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [June 11, 2019, 7:08am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774/6 "2019-06-11T07:08:00Z")

</div>

I added a comment there, will follow up next week here depending on the response we get.

Perhaps create your own repo with the language, to start? We can then add it to the list of highlight languages we pull?

---

<div class="post-metadata">

### Author: ![abcoathup](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abcoathup/32/145066_2.png) [@abcoathup](https://meta.discourse.org/u/abcoathup)
#### Post date: [June 11, 2019, 8:57am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774/7 "2019-06-11T08:57:30Z")

</div>

Hi @sam

A repo with the Solidity language is in the highlightjs organisation already:  
[https://github.com/highlightjs/highlightjs-solidity/](https://github.com/highlightjs/highlightjs-solidity/)

---

<div class="post-metadata">

### Author: ![abcoathup](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abcoathup/32/145066_2.png) [@abcoathup](https://meta.discourse.org/u/abcoathup)
#### Post date: [June 25, 2019, 1:11am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774/9 "2019-06-25T01:11:37Z")

</div>

Hi @sam did you get any response?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [June 25, 2019, 1:15am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774/10 "2019-06-25T01:15:03Z")

</div>

Nothing from GitHub… not sure what we are meant to do here.

---

<div class="post-metadata">

### Author: ![abcoathup](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abcoathup/32/145066_2.png) [@abcoathup](https://meta.discourse.org/u/abcoathup)
#### Post date: [June 25, 2019, 1:17am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774/11 "2019-06-25T01:17:54Z")

</div>

My goal is syntax highlighting of the Solidity language in a hosted Discourse forum.  
Just trying to work out how to get there 😄

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [June 25, 2019, 1:21am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774/12 "2019-06-25T01:21:24Z")

</div>

I am assigning this out, we will figure something out, give us a couple of weeks.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [June 26, 2019, 2:54am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774/15 "2019-06-26T02:54:48Z")

</div>

Hi @abcoathup,

Please try this theme component: [GitHub - pmusaraj/discourse-highlight.js-solidity · GitHub](https://github.com/pmusaraj/discourse-highlight.js-solidity)

I had to build Highlight.JS with the solidity language and then use the generated minimized language in Discourse. Step-by-step details in the component’s readme.

---

<div class="post-metadata">

### Author: ![abcoathup](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abcoathup/32/145066_2.png) [@abcoathup](https://meta.discourse.org/u/abcoathup)
#### Post date: [June 27, 2019, 6:02am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774/16 "2019-06-27T06:02:09Z")

</div>

Hi @pmusaraj and @sam

We are on a hosted Business plan, so assume that I can’t add this plugin.

What other options do we have to get Solidity syntax highlighting?

---

<div class="post-metadata">

### Author: ![rishabh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rishabh/32/179446_2.png) [@rishabh](https://meta.discourse.org/u/rishabh)
#### Post date: [June 27, 2019, 6:09am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774/17 "2019-06-27T06:09:11Z")

</div>

> [@abcoathup](#):
>
> We are on a hosted Business plan, so assume that I can’t add this plugin.

This isn’t a plugin, it’s a theme component that you can add to an existing theme. You are free to install themes and theme-components by yourself using these instructions: [Installing a theme or theme component](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682) 🙂

---

<div class="post-metadata">

### Author: ![abcoathup](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abcoathup/32/145066_2.png) [@abcoathup](https://meta.discourse.org/u/abcoathup)
#### Post date: [June 27, 2019, 7:16am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774/18 "2019-06-27T07:16:16Z")

</div>

Awesome, we now have Solidity syntax highlighting in Discourse.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [July 27, 2019, 7:16am UTC](https://meta.discourse.org/t/how-to-get-solidity-syntax-highlighting/117774/19 "2019-07-27T07:16:29Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
