rubychan / coderay

Fast and easy syntax highlighting for selected languages, written in Ruby.
http://coderay.rubychan.de/
Other
846 stars 115 forks source link

Add support for the Gherkin language #198

Open danielpacak opened 8 years ago

danielpacak commented 8 years ago

https://github.com/cucumber/cucumber/wiki/Gherkin

ghost commented 8 years ago

I think the problem is that writing support for any language xyz is not trivial. korny explained in some document how this is and should be done:

https://github.com/rubychan/coderay/wiki/Scanner-Requests

You can even find stackoverflow questions :D

http://stackoverflow.com/questions/19158484/how-can-i-extend-coderay-to-highlight-a-new-language

I think your best bet is to have a look at the example .rb file that is linked on the wiki - this may be the best way to fiddle around with things. If you have some working basics and have questions, I guess you may perhaps ask korny at that point; then the wiki may also be improved.

I personally think that this is actually quite advanced - although I am not a newbie in regards to ruby, writing a scanner for a language would probably take me some days simply because I have not fully understood the process either - only the bare skeleton such as lexing and scanning ... and I mix these up all the time anyway. :)