Closed goodmind closed 5 years ago
No, there's no converter. Mostly due to our peculiar syntax and also different philosophies in what gets highlighted. Look at Language definition guide and Style guide.
@isagalaev well, how to do something like beginCaptures
?
This is something that highlight.js doesn't have, and what makes a generic converter impossible :-)
The more useful answer depends on what you're trying to achieve. Sometimes there are highlight.js-specific solutions, sometimes we just straight up don't want to highlight something. So please provide an example!
I have this grammar and want to convert it into highlight.js one: https://github.com/goodmind/language-typelanguage/blob/master/grammars/typelanguage.tmLanguage.json
And I have combinator-declaration-without-hash
with begin
regex
(([_$\\w]+)(\\b\\.))?([_$\\w]*)(\\b#)([[:alpha:][:alnum:]]*)\\s*
And I want to highlight captures inside it:
"2": {
"name": "meta.definition.combinator.tl variable.other.tl"
},
"4": {
"name": "meta.definition.combinator.tl variable.other.tl"
},
"5": {
"name": "storage.type.tl"
},
"6": {
"name": "storage.type.tl"
}
Example of file that I want to highlight: https://github.com/goodmind/language-typelanguage/blob/master/examples/scheme.tl
@isagalaev any thoughts?
@goodmind did you end up solving this problem? I have the same one.
@stevepeak I didn't
@goodmind Would you be interested in helping contribute to an open source package that does this?
@stevepeak yes, but I think it's impossible because TextMate uses oniguruma regexp engine (doesn't work in browser at least now)
Oh... good to know. I'll ping you when we look more into this.
If you all made any progress with a general purpose converted I'd be curious.
Closing as this is asked and answered. Still if you make any progress I'd love to hear about it. :)
Is there converters from textmate grammars or I need to rewrite grammar manually?