vscode-markdown
vscode-markdown copied to clipboard
Suggestion: Allow extension to work within MDX files
Hello everyone,
MDX allows for JSX components within Markdown. I personally love this extension, and I'd love it to work within MDX files as well.
I'm able to provide this functionality myself and open a PR that allows this extension to activate and function within MDX files.
I understand that some functionality such as "Print current document to HTML" will not work wont work for these type of files, but that's okay.
Thanks.
I guess you can enable this extension by associate .mdx
(?) to markdown
languageID with option
(I remember there was a similar issue talking about MDX but can't find it now.)
Hi,
This does indeed work, but then doesn't allow for MDX specific extensions to work :smile: . Is it alright if I open a PR to show the changes? Otherwise, you can check out the commit here.
Looks good to me 😉. (Is injectTo
a new VSCode feature? I know there have been a quite long discussion about this in the VSCode repository.)
I understand that some functionality such as "Print current document to HTML" will not work wont work for these type of files, but that's okay.
We can disable these features for MDX and just show a warning then.
Is injectTo a new VSCode feature?
Not sure haha, I started working with extensions yesterday
We can disable these features for MDX and just show a warning then.
Fine by me, I'll open a draft PR and mark it done once I finish that.
Is it implemented? Do I need to change some settings to make it work with *.mdx file? specifically looking to have an option to create TOC for mdx files.
There doesn't seem to be a good solution for this up to now 🤔.
As mentioned by @yzhang-gh, File associations worked for me
^^ the above fix for file associations still works. Thank you!
Hi,
MDX file association with markdown
doesn't provide full color syntaxique in VSCode, but works well with this extension.
The must have with this extension is to support mdx
file.
Creating the file file association works great for creating TOCs in .mdx
files. However, when trying to omit a header from the TOC, I'm getting a syntax error as I believe <!-- omit in toc -->
is not a valid .mdx
comment. Has anyone found a workaround for this?
@yzhang-gh How do you do the file association you show in the screenshot please? I can't see it in the extension settings.
@yzhang-gh How do you do the file association you show in the screenshot please? I can't see it in the extension settings.
This is a setting item for VSCode itself, not for extensions, so it is not on the extension's settings screen. You can find the setting item by the following steps:
- press
ctrl
+,
to open the settings page - search for
files.associations
in the search box at the top of the screen