I am using a hosted Discourse service and wanted to know how to get Solidity syntax highlighting working.
Solidity isn’t a language in https://github.com/highlightjs/highlight.js but there is a repo for the Solidity language https://github.com/highlightjs/highlightjs-solidity.
Best approach is to submit a PR to highlightjs to add it, that way we will get it next time we upgrade highlightjs
What is the frequency of that?
We pretty much update every release, if you get it into highlight we will update.
I have been advised that Solidity should stay in it’s own repo (https://github.com/highlightjs/highlightjs-solidity/) rather than be added to the highlight.js repo.
How do I configure a hosted discourse forum to use this repo?
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?
A repo with the Solidity language is in the highlightjs organisation already:
Hi @sam did you get any response?
Nothing from GitHub… not sure what we are meant to do here.
My goal is syntax highlighting of the Solidity language in a hosted Discourse forum.
Just trying to work out how to get there
I am assigning this out, we will figure something out, give us a couple of weeks.
Please try this theme component: 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.
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?
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: How do I install a Theme or Theme Component?
Awesome, we now have Solidity syntax highlighting in Discourse.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.