views:

45

answers:

1

Wait, I know! I know that this "syntax highlight in textarea"-question was raised like a million times on stackoverflow! But, please, listen.

offtopic: I'm not a web-developer, and technically I'm not a programmer at all. I study mechatronics and deal mostly with control-engineering and digital-hardware. And I'm so pissed off that whenever I want to share some application (that would be helpful in my field) and embed it into the web, I need to know such a crazy amount of technologies, like html, css, javascript, flash, etc.. that takes time, which I could have been spending for the benefit of my own field.

Right now I'm playing with hardware-description-languages and I'm writing some Python-libraries to convert one HDL into another. And I wanted to embed such feature on the web: http://xhdl2vhdl.appspot.com/

I wanted to implement some basic syntax highlighting (only keywords highlighting will be enough) so that the code could be readable. But the whole idea highlighting something in textarea is not trivial at all. The other difficulty is that the languages I work with are rare, and there are no out-of-box solutions for them.

I tried to dig into these solutions, but they are very complicated for me: http://www.nicolarizzo.com/gamesroom/experimental/CodeEditor.html http://marijn.haverbeke.nl/codemirror/jstest.html

and there is no clear descriptions how to use them (for my level of knowledge of web-development).

So, is there a simple solution, just to highlight a bunch of key-words in textarea or perform something equivalent?

Thank you.

A: 

Why don't you take some existing syntax highlighter and add module for your language?

http://alexgorbatchev.com/wiki/SyntaxHighlighter

demo

http://alexgorbatchev.com/wiki/SyntaxHighlighter:Demo

kodisha
because it should be editable, and some of the languages I need to highlight are subsets or supersets of existing languages with their own syntax - so there can not be modules for them
Halst