Help with the gfm grammar?


#1

In the latest release, language-gfm gained the support for CriticMarkup, which is a way to track changes in markdown.

I would like to add a few functions, but I’m not nearly knowledgeable enough in [java|coffee]script to do it. What I had in mind is

  1. Add functions to add insertions, highlights
  2. Add functions to delete and replace (based on what is selected)
  3. Add a function to accept either the current or all changes in a document

I think it would be really interesting to have that, since a great many people are complaining about the lack of an easy way to mark editorial changes in markdown.

Are some of you interested in helping out?


#3

Number 2 & 3 doesn’t seem like features suitable for a language package to me, as they would require operations on the selection. As far as I can see most language packages (language-*) has only syntax highlighting & snippets.

For no.1, are you talking about some additional snippets? For example, as of now, language-gfm provides snippets such that when you type b and then hit the tab key (in a GFM file), Atom/language-gfm will automatically expands it into **** with the cursor placed in the middle; and if you type img and then hit the tab key, it will turn into ![]() with the cursor placed inside [] which will automatically jump into () when you hit tab key again.

Adding snippets is simple enough. Would you like to checkout the last two commits I made? https://github.com/cs150bf/language-gfm


#4

OK, so all of that can move to its own package (that would make sense, actually).

Ideally, the snippets for deletion, comment, replacement would act on what is selected. I select a bunch of words, press Cmd-D, and it puts the {-- and --} around it. Or Cmd-R, and it puts the replacement markers, and move the cursor to the text to replace with. But I am yet to find a way to use the currently selected text in a snippet.

Addition and comments could be simple snippets, yes.

Point 3 could actually be more difficult (for me) – but also a better feature.