Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor support #119

Open
vjpr opened this Issue May 1, 2018 · 28 comments

Comments

Projects
None yet
@vjpr
Copy link

vjpr commented May 1, 2018

For tracking which editors support MDX.

@johno johno added the discussion label May 1, 2018

@Flaque

This comment has been minimized.

Copy link

Flaque commented May 6, 2018

Should editors add MDX highlighting for .md files? Or .jsx files? Or should there be a .mdx file?

@timneutkens

This comment has been minimized.

Copy link
Member

timneutkens commented May 7, 2018

.mdx seems the safest choice to me.

@Flaque

This comment has been minimized.

Copy link

Flaque commented May 7, 2018

I can take a crack at it for VSCode. Is there a .tmLanguage somewhere? If not I can make one.

@timneutkens

This comment has been minimized.

Copy link
Member

timneutkens commented May 7, 2018

@Flaque not atm, but I guess you can copy the .md one, and then copy import and export from javascript, and change the regex for inline html to match uppercase too, since it seems that is disregarded now.

@Flaque

This comment has been minimized.

Copy link

Flaque commented May 7, 2018

Sounds good, that’s my plan!

@pedronauck

This comment has been minimized.

Copy link

pedronauck commented May 10, 2018

I agree with @timneutkens, .mdx can be the better choice and will be awesome, is really bad write mdx without editor support... I'll try to make for vscode, but unfortunelly i'm kind out of time now due to other project that use mdx too 😢

@timneutkens

This comment has been minimized.

Copy link
Member

timneutkens commented May 10, 2018

Added an item for prettier to the initial list, even though it's not an editor it falls under the same thing.

@wilomgfx

This comment has been minimized.

Copy link

wilomgfx commented Jun 12, 2018

Any updates on this ? I can work on vscode too @Flaque

@macklinu

This comment has been minimized.

Copy link
Contributor

macklinu commented Jun 23, 2018

I would love Prettier support for MDX. Not sure what's involved, but glad to help if I can. I'm thinking there would be a prettier-plugin-mdx after looking at the Prettier plugins documentation. Any other thoughts on how to integrate MDX and Prettier?

@Flaque

This comment has been minimized.

Copy link

Flaque commented Jun 23, 2018

@wilomgfx take a shot at it, I got caught up in other things and likely won't finish it sorry 😅

@wilomgfx

This comment has been minimized.

Copy link

wilomgfx commented Jun 23, 2018

@Flaque did you have anything good already done that i can start from or im better off starting from scratch :)?

@Flaque

This comment has been minimized.

Copy link

Flaque commented Jun 23, 2018

@flipxfx

This comment has been minimized.

Copy link

flipxfx commented Jun 30, 2018

Anyone good at Vim plugins? 😄

@jxnblk

This comment has been minimized.

Copy link

jxnblk commented Jul 14, 2018

I've literally never tried to write a Vim syntax before, but threw this together for my own use. If anyone wants to help out, that'd be great https://github.com/jxnblk/vim-mdx-js – cc @flipxfx

@silvenon

This comment has been minimized.

Copy link
Contributor

silvenon commented Jul 15, 2018

I just published vscode-mdx!

@kentcdodds

This comment has been minimized.

Copy link
Contributor

kentcdodds commented Aug 9, 2018

I've opened an issue for prettier support on the prettier repository: prettier/prettier#4960

@sibelius

This comment has been minimized.

Copy link

sibelius commented Aug 13, 2018

this works great https://github.com/jxnblk/ok-mdx

would be cool to have an online version of it

@trevordmiller

This comment has been minimized.

Copy link
Contributor

trevordmiller commented Aug 26, 2018

@jxnblk nice work on the vim plugin! Perhaps you could get it included in vim-polyglot as the mdx language pack?


UPDATE: requested in sheerun/vim-polyglot#342.

@hsribei

This comment has been minimized.

Copy link

hsribei commented Aug 28, 2018

Spacemacs user here! My elisp is practically non-existing, but it'd be cool to add Emacs to the initial todo list in case someone comes along with the chops to work on it :)

@ChristopherBiscardi

This comment has been minimized.

Copy link
Member

ChristopherBiscardi commented Aug 29, 2018

For emacs markdown-mode is probably the place to start, but it's already pretty OK from my perspective (despite not having "real support" for mdx). Biggest missing pieces are all the niceties that markdown-mode provides for inserting different elements. Indirect editing support for JSX blocks would be nice too (like the indirect editing support already available to code blocks) and seems mostly like a matter of propertizing jsx/import/export blocks.

screen shot 2018-08-29 at 10 02 16 am

@jonsuh

This comment has been minimized.

Copy link

jonsuh commented Oct 3, 2018

I put something together for Sublime Text 3 support: https://github.com/jonsuh/mdx-sublime

I submitted a PR wbond/package_control_channel#7312 to get it on Package Control.

It isn’t perfect, but it’s better than no syntax highlighting at all. I’ve never written language syntax before, so could use and would appreciate any help to improve it!

image

@silvenon

This comment has been minimized.

Copy link
Contributor

silvenon commented Oct 4, 2018

@jonsuh great! ⭐️ It was my first time with VS Code as well, grammars are complicated and feel inherently hacky. 😅

@ryee-dev

This comment has been minimized.

Copy link

ryee-dev commented Oct 10, 2018

Any updates on intellij/webstorm support? :(

@bradringel

This comment has been minimized.

Copy link

bradringel commented Feb 4, 2019

I took a stab at this for atom, using @silvenon 's vscode repo as a base, it seems to be working okay but I can't get the end pattern to match properly. If you add a JSX, the content after that tag is closed also has the scope for JSX, instead of the markdown scope. Anyone know what's wrong here?

  "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
  "name": "Markdown React",
  "patterns": [
    { "include": "#jsx" },
    { "include": "#markdown" }
  ],
  "repository": {
    "jsx": {
      "patterns": [
{
              "begin": "^(?=(import|export)\\b)",
              "end": "(\\s*$)",
              "contentName": "source.js.jsx",
              "patterns": [
                { "include": "source.js.jsx" }
              ]
           },
            {
              "begin": "^(?=<([a-z]|[A-Z]))",
              "end": "((\\w|/)>)",
              "contentName": "source.js.jsx",
              "patterns": [
                { "include": "source.js.jsx" }
              ]
            }
      ],
    },
    "markdown": {
      "contentName": "source.gfm",
      "patterns": [
        { "include": "source.gfm" }
      ]
    }
  },
  "scopeName": "source.markdown.jsx",
  "fileTypes": ["mdx"]
}
@trevordmiller

This comment has been minimized.

Copy link
Contributor

trevordmiller commented Mar 4, 2019

Note that @jxnblk's vim-mdx-js plugin was added to vim-polyglot in sheerun/vim-polyglot#342, so Vim can be checked off now :)

@trevordmiller

This comment has been minimized.

Copy link
Contributor

trevordmiller commented Mar 4, 2019

Could these plugins be documented on https://mdxjs.com?

@johno

This comment has been minimized.

Copy link
Member

johno commented Mar 4, 2019

Totally! Will happily accept a PR to add them in!

trevordmiller added a commit to trevordmiller/mdx that referenced this issue Mar 5, 2019

Add documentation page for editor plugins
Based on the completed plugins from mdx-js#119
@trevordmiller

This comment has been minimized.

Copy link
Contributor

trevordmiller commented Mar 5, 2019

@johno #436

johno added a commit that referenced this issue Mar 5, 2019

Add documentation page for editor plugins (#436)
Based on the completed plugins from #119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.