osxpeppermint / peppermint

The official bug/features tracker for Peppermint
8 stars 2 forks source link

Where are language grammars stored? #59

Closed bobrocke closed 9 years ago

bobrocke commented 9 years ago

I'd like to modify the Markdown language grammar. Where are the language grammars stored?

Is there a place I can put a modified grammar that will override the distributed version and not be overwritten on app updates?

osxpeppermint commented 9 years ago

Well, right now the grammars (along with the snippets) are the unique elements that are not user-editable.

However, it is in my to-do list, and very soon both of them will be user-editable.

P.S. As for a more... GFM Markdown grammar, I'm looking into it. :)

bobrocke commented 9 years ago

Yes, Markdown GFM, or even Markdown Extra, would be welcome.

I see the .js ACE modes within the Peppermint package. If I edit and replace them, can I make changes? or can I copy, edit and save one to another (safe) place that will override the distributed ones?

osxpeppermint commented 9 years ago

Well, basically, regarding Specs and modes the situation is a bit complicated...

The only place where you could actual edit the grammar is tha mode file, found under Data/Core/ace/. E.g. ~/Library/Application Support/Peppermint/Data/Core/ace/mode-markdown.js.

You can make any changes you wish (although to be honest, I would recommend that even to myself), and they will be picked once Peppermint re-launches. However, any following update will replace the mode files, so it wouldn't be a bad idea if you kept the file at some safe place (outside the Data folder).

P.S. Once I find a more... sensible way of editing a grammar (pretty much in the TextMate/Sublime/Atom fashion - e.g. with a .json/.cson/etc file), Specs will be pretty much 100% editable.

bobrocke commented 9 years ago

I need to learn more about Specs, Plugins and Builtins if I'm going to get fluent in Peppermint.

That said, I don't think I'd worry about an interface for editing grammars in Peppermint as ACE appears to use JavaScript parsers, as does CodeMirror, rather than the somewhat more limiting approach used by TextMate, Sublime Text, and Atom (all derivatives of TextMate).

osxpeppermint commented 9 years ago

Well, the truth is I have delayed writing the documentation - and there is a good deal of things that are undocumented/missing (and it's really a pity to have a number of features - and Peppermint does have a huge number of hidden gems - and people not even know about it).

So, "mea culpa" - as they say. But I'll very soon make up for it. :)

bobrocke commented 9 years ago

I understand. And you have tackled a big job - a Mac programmers' editor is a much more complicated beast than a simple text editor. You are following in the footsteps of TextMate and Sublime Text (both written mostly by an individual) and "competing" with Atom and Brackets (both having the backing of big companies and a crowd of open-source contributors).

osxpeppermint commented 9 years ago

Well, I love what I'm doing - this what matters for me.

As for the supposed... "competition", along with the help of people (like you) who like it and use it and provide feedback/ideas/etc, this is what drives me to get up in the morning and work hard to make it even better. Peppermint may have not made me a millionaire, but in the end I couldn't care less... :)