Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Highlighting #6

Open
davej opened this issue May 9, 2015 · 5 comments
Open

Syntax Highlighting #6

davej opened this issue May 9, 2015 · 5 comments

Comments

@davej
Copy link

davej commented May 9, 2015

Is there any syntax highlighting definitions available? Or is there a language that earl grey shares similar syntax with, so I can piggy-back on the syntax highlighting defined for that language?

@breuleux
Copy link
Owner

breuleux commented May 9, 2015

I made an earl-mode for emacs here. I also have a CodeMirror module here which is currently embedded in repple, the engine behind this page (I'll try to find the time to make a pull request to include it in CodeMirror, but I'd probably need to rewrite it in JS to get it accepted). Then I also have a mode for highlight.js here. So, yeah, there are some definitions around, but it's kind of messy and scattered.

EG is a bit tricky to highlight as well since it's not keyword-based: alice bob: charlie should highlight alice as a keyword, for example, because of its positioning.

I believe Python might work okay as an alternative mode since most control structures have the same syntax.

@davej
Copy link
Author

davej commented May 9, 2015

Thanks, did a bit of trial and error and python works ok but I found CoffeeScript works best. I quickly added dot-strings and ;; comments so it works quite well now.

@breuleux
Copy link
Owner

breuleux commented May 9, 2015

Yeah, now that I think of it, CoffeeScript would work well too. What editor are you using? If you do end up tweaking a decent mode for EG, put it up somewhere and I'll link to it when I end up adding a section on editor support.

@davej
Copy link
Author

davej commented May 9, 2015

Will do. Using Atom. Highlighting goes a bit horrible when using dash-er-ized variable names but I'll post it here if I get it working well.

@breuleux
Copy link
Owner

For those who are interested, I have written a guide on syntax highlighting for Earl Grey:

http://breuleux.github.io/earl-grey/contrib.html

Also, someone is developing an Atom mode here: https://github.com/MadcapJake/language-earl-grey. Probably best not to make more than one :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants