9

According to the question Enable Verilog syntax highlighting, it is clear how to enable the syntax for various languages. That is not what this question is about, nor is it a duplicate of that. Additionally, this question was asked, about Verilog syntax highlighting, a couple of years back and was closed as duplicate of the aforementioned one. Basically my question follows on from that.

On EE.SE, we are getting more and more frequently questions regarding Verilog (I tend to answer many of them), however as was mentioned in the comments of the closed question, it seems there is a lack of a highlighting scheme for Verilog and/or SystemVerilog. There is one for VHDL, but that is too different to be applicable.

As a result we end up with lots of questions and answers with code which ends up either lacking any highlighting at all, or highlights random words depending on what tag is used, and trying to do something like <!-- language: lang-verilog -->, clearly results in random highlight as well as there is no defined language. This I see as a problem as it makes the code less readable - I end up having to copy it into something like NP++ to get it to be highlighted.

It's been 2 years since that other question was closed, and nothing has changed.

After looking around, there is a SystemVerilog parser for Google Code Prettify. It's currently sitting as an open pull request and hasn't yet been pulled into the main repository.

Hopefully this can be used for highlighting on SE. A SystemVerilog parser will also work perfectly well for Verilog as well.

Any thoughts on whether this can be implemented?

If it needs to be merged I can prod the folk on the github repository to look at pulling it the parser. It's been a further 6 months since I asked the question and no progress has been made so far as I can see (still no Verilog syntax highlighting on EE.SE).

4

We don't have our own highlighting engine and use Google Code Prettify for syntax highlighting instead. What this means in practice is that unless there's an existing plugin that supports a language, there's not much we can do without a significant time investment. In my case, I'd have to start by learning Verilog. ;)

If you know Verilog well and want to take a stab at creating a Prettify plugin for it, or you know where we can download an existing plugin, we can see about including it on EE.SE. (It's pretty straightforward at that point. We already do a similar custom include on Mathematica.)

  • Thanks for your answer. I had a deeper look, and seems like there is actually a SystemVerilog parser for Google Code Prettify, I missed it before as it is called lang-sv rather than having Verilog in the name. That would be sufficient to get a decent set of highlighting for both SystemVerilog and Verilog. However it doesn't seem that pull request was completed even though the corresponding issue thread says Google were fine with it. I'll ask on the github whether or not it will get pulled in. – Tom Carpenter Aug 31 '16 at 12:35
  • @TomCarpenter The pull request is still open, therefore we don't have Verilog/SV support (prettify-full.en.js). Btw, there are totally 5668 Verilog/SV questions on SO and EE.SE. – ahmedus Feb 11 '18 at 21:35
  • Given that the PR has been pedning for over two years, it doesn't seem likely that Google care enough to pull it. Is there not something we can do on the StackExchange end? E.g. surely SE could just fork the repository and merge the PR. Or can we not just use a custom include for the lang-sv.js prettify plugin. – Tom Carpenter Jan 23 at 16:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .