Giter VIP home page Giter VIP logo

Comments (5)

foo123 avatar foo123 commented on June 16, 2024 1

Hello, I don't use Textmate so I cannot really tell. But if you follow the instructions in the documentation and get help from the examples for some languages like PHP, HTML, CSS, .. I think it is perfectly possible.
The grammar tool is about editors like CodeMirror, ACE, Prism, Highlight.js and SyntxHilighter. The same grammar format (with the exception of the Style Model) can be used the same on all those editors. Hope these help.

from editor-grammar.

konsumer avatar konsumer commented on June 16, 2024

The grammar tool is about editors like CodeMirror, ACE, Prism, Highlight.js and SyntxHilighter. The same grammar format (with the exception of the Style Model) can be used the same on all those editors.

That is the appeal of using it with textmate format for me, since Atom, VSCode, Sublime, and lots of others can use that format. I am not good at converting synhi grammars by hand, so I am hoping to automate and centralize it.

from editor-grammar.

foo123 avatar foo123 commented on June 16, 2024

I am not sure I understand what you want to achieve.. Can you provide an example of the Textmate format and how it would relate to the grammar addon and/or format? Do you mean using Textmate format with CodeMirror or ACE or something different than that?

from editor-grammar.

konsumer avatar konsumer commented on June 16, 2024

Do you mean using Textmate format with CodeMirror or ACE or something different than that?

Yes, that is my eventual goal. Sorry, I will write a concrete example.

So, the umka language seems great. I want to add syntax-highlighting to their playground and this other cool playground. I am dyslexic, and code without syntax-highlighting is very hard for me to read, but it seems like a fun language.

It has sublime text language def. Someone else wrote textmate def and vim. This is great, and textmate is used in many editors now (vscode, for example) but none of them can be converted directly to any web-based code-editors (like codemirror or Ace.)

I saw this project, which appears to have the goal of being a single grammar-type that can be converted into other things. That seems perfect, as I can get the format in something central, and convert it to codemirror, in this case. I am not great with language-parsing grammars, so I think "maybe there is some existing tool, or this is a feature someone who is better than me at this can implement" so I make an issue over here and here, looking for help.

My goal is "if your editor-grammar doesn't support editors like sublime and vscode, it could, and that would even be more useful." In this case it would mean I can convert the sublime YAML def or textmate JSON into an online code-editor.

So I want to go like this:

graph TD
    subl[Sublime Text] --> eg[editor-grammar] --> Codemirror
    txm[Vscode/Textmate] --> eg[editor-grammar]

But might also be cool to go like this:

graph TD
     eg[editor-grammar] --> subl[Sublime Text]
     eg[editor-grammar] --> txm[Vscode/Textmate]
     eg[editor-grammar] --> vim[Vim]
    eg[editor-grammar] --> cm[Codemirror]
    eg[editor-grammar] --> ace[Ace]

And then I can try to port the Textmate grammar to editor-grammar (maybe with some help from umka people,) and have all the editors covered with 1 grammar.

from editor-grammar.

foo123 avatar foo123 commented on June 16, 2024

Ah, I see now. The second option is only possible if the editor is implemented in javascript (eg Textmate run in javascript) or a new editor-grammar tool is implemented in the language of the editor (eg in C instead of javascript). For the first option (transform a textmate grammar to editor grammar to be used with codemirror) it is possible, but I don't know of an automated way to do this, but going step-by-step one can transform a grammar in textmate format to a grammar for editor-grammar most easily. I will label this question, to remind me to chek textmate format and maybe integrate it into editor-grammar if I find time.

from editor-grammar.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.