Gremlin Syntax Highlighter
I want to implement an Gremlin Synthax highlighter (displayed in HTML) via javascript/typescript.
How do i have to achieve something like this ?
Do we highlight just the variables , methods, lambdas seperatly or do we highlight the individual gremlin methods ?
6 Replies
I've always liked standard Groovy syntax highlighting for Gremlin code. I imagine that would be a good base to start from if you wanted something more advanced looking. might be nice if enum/tokens popped out a bit more than what i remember groovy doing. that could be a nice feature to work into gremlint if you cared to contribute your work to open source. @KelvinL or @bechbd any thoughts on how Gremlin syntax should be highlighted?
In the graph-notebooks we use Groovy syntax highlighting which does pretty well and would be a good place to start. I agree that having enums/tokens highlighted would be a nice addition as well as highlighting parameters for parameterized query support
Thank you i will use it later on
@spmallette @bechbd
is there any git repo / project (open source) that does this , so i can use this as reference
Here is how the graph-notebook implements syntax highlighting: https://github.com/aws/graph-notebook/blob/main/src/graph_notebook/nbextensions/gremlin_syntax/static/main.js
GitHub
graph-notebook/src/graph_notebook/nbextensions/gremlin_syntax/stati...
Library extending Jupyter notebooks to integrate with Apache TinkerPop, openCypher, and RDF SPARQL. - aws/graph-notebook
thank you 🙂