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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Dogescript syntax highlighting on the web #95

Open
alexdantas opened this issue Jun 16, 2014 · 16 comments
Open

Support Dogescript syntax highlighting on the web #95

alexdantas opened this issue Jun 16, 2014 · 16 comments
Assignees

Comments

@alexdantas
Copy link
Member

Since Dogescript is getting famous we might as well support it's syntax highlighting on the web. 馃悤

This issue is a brainstorm until someone actually does the job.
I'm up for it but I could take a week or two.

I will do it on GeSHi but since there are several highlighting systems around, someone could tackle a different one.


Pygments is the default highlighter on Jekyll websites and fairly used on Wordpress plugins.
It is made in Python but is unfortunately hosted on Bitbucket as a Mercurial repository. I have no experience in neither of these tools so... yeah.
They do have a guide on implementing custom Lexers and we could always inherit the Javascript highlight.


GeSHi is a PHP highlighter, greatly used on Wordpress plugins, Wikipedia's official one (MediaWiki) and phpBB.
It used to be on Sourceforge but has moved to GitHub.
It is very easy to add a new language, just assign variables like this. I couldn't figure out how to actually include them, since the official page tells to email the owner while the GitHub repos have pull requests waiting for a few months.


Our beloved Dogescript Live page uses CodeMirror, a neat in-browser editor. It does a fairly strange job of reinventing the wheel - implementing it's own language modes.
It's written in Javascript, uses Git on GitHub.
If anybody wants to have a Dogescript syntax on our live page, they have a guide and the Javascript mode is a great place to start.


highlight.js is an alternative for GitHub Pages/Jekyll.
It's very easy to add languages to it - simply create a Javascript object with the keywords. Here's a simple example of someone adding the Jade language on their GitHub.
One thing that I didn't liked, though, is that there are pull requests from last year still waiting to be merged. I hope it doesn't happen with Dogescript since our language is TEH BEST!!!11!!one!!11

@alexdantas alexdantas self-assigned this Jun 16, 2014
@parkr
Copy link

parkr commented Jun 16, 2014

Another to check out is Rouge. Jekyll 2.x supports it.

@alexdantas
Copy link
Member Author

Oh yeah, good point!


Rouge, in contrast with the others, is written in Ruby; thus it can easily be used with Jekyll, Middleman and Rails projects.
Also, it's compatible with Pygments' CSS files so it probably's used a lot.
Adding a new language is not as easy as the others but they have instructions. Check out this simple example on Apache config syntax.
It seems to include pull requests quickly.

@off-by-some
Copy link
Member

I actually really like highlight.js, I was considering creating a syntax highlighter package for sublime text, since its getting rather hard on the eyes to work in

@Griffork
Copy link

I actually wrote a syntax highlighter in CodeMirror once before... But sadly I have no time to spare!

What about IDE support?

@alexdantas
Copy link
Member Author

@pholey
That would be nice. With Sublime+Vim+Emacs we could soon conquer the world!

@Griffork
Aww, that's unfortunate...
But at least could you share it? An example would make things way easier

@Griffork
Copy link

I'm on the wrong computer at the moment, if I remember I'll look into it when I get home.

Edit:
I can't share it because of the project I was using it for, but if I have time I'll make a start/whip up an example for dogescript.

@dopesaur
Copy link

I know that this issue isn't about text editors syntax highlighting, but I've created dogescript syntax highlighting for TextWrangler/BBEdit, where can I post it?

@AnEmortalKid
Copy link
Member

@dopesaur if you still have that, we can create a highlighters folder in this repo

@AnEmortalKid
Copy link
Member

We'd probably have to do one for github too: https://github.com/github/linguist/blob/master/vendor/README.md

@AnEmortalKid
Copy link
Member

AnEmortalKid commented Nov 3, 2017

There's this guy out there: https://github.com/ThomasHickman/language-dogescript

Seems to work pretty decently: link

@osilkin98
Copy link

Can dogescript please have an official syntax highlighter included into the main repository? I think that the biggest problem for most people right now is that it's difficult to write in it when you don't have the syntax seen clearly, and if it was universally portable for vim/emacs/sublime as @alexdantas mentioned above

@AnEmortalKid
Copy link
Member

This is something we still want. Part of the difficulty lies with our parser producing javascript and not an AST.

I know most of the highlighter frameworks I鈥檝e looked at use sort of BNF notation for the grammar and then do everything magically.

Maybe the owner of the atom highlighter might be able to help us out here. I鈥檓 not sure how easy it would be to have a single highlighter BNF and make that produce whatever is needed for all those platforms. I鈥檒l create an issue on their repo!

@ThomasHickman
Copy link
Member

ThomasHickman commented Oct 5, 2018

Hi!

I鈥檓 not sure how easy it would be to have a single highlighter BNF and make that produce whatever is needed for all those platforms.

I don't know of any projects which port a single BNF definition of a language to the various definitions of syntaxes with exists in various editors. It would probably be better to define each individual editor's defintions (maybe in some kind of template so you can abstract out things like what the keywords the language has) - I would be willing to help out with this.

@AnEmortalKid
Copy link
Member

That would be great! I don't know much about any of the highlighters :(

Would it be feasible to have them all under a single dogescript-highlighters repository and then a submodule for each different editor?

@ThomasHickman
Copy link
Member

Hmm yeah, that could possibly be done - one example of something like this I know of is https://github.com/bioSyntax/bioSyntax, which defines extensions to recognise lots of formats used in bioinformatics.

@AnEmortalKid
Copy link
Member

Cool, created: https://github.com/dogescript/syntax-highlighters and adding you to the owners group :)

There's a slack channel where we can coordinate if you want (invite yourself): https://doge-invite.herokuapp.com/

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

8 participants