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

Support remark plugins in the language server #272

Merged
merged 6 commits into from
Jan 20, 2023
Merged

Conversation

remcohaszing
Copy link
Member

Syntax plugins can be added by adding an mdx section in your tsconfig.json file. This is then parsed following the same format as unified-engine [configuration][].

For example, to support [frontmatter][] and [GFM][], add the following section to tsconfig.json:

{
  "compilerOptions": {
    // …
  },
  "mdx": {
    "plugins": [
      "remark-frontmatter",
      "remark-gfm"
    ]
  }
}

This also adds the JSON schema for the new field in tsconfig.json.

Closes #266

Syntax plugins can be added by adding an `mdx` section in your
`tsconfig.json` file. This is then parsed following the same format as
`unified-engine` [configuration][].

For example, to support [frontmatter][] and [GFM][], add the following
section to `tsconfig.json`:

```jsonc
{
  "compilerOptions": {
    // …
  },
  "mdx": {
    "plugins": [
      "remark-frontmatter",
      "remark-gfm"
    ]
  }
}
```

This also adds the JSON schema for the new field in `tsconfig.json`.
@remcohaszing remcohaszing added 🦋 type/enhancement This is great to have 🗄 area/interface This affects the public interface 🧒 semver/minor This is backwards-compatible change labels Jan 19, 2023
@remcohaszing remcohaszing requested a review from a team January 19, 2023 10:09
@changeset-bot
Copy link

changeset-bot bot commented Jan 19, 2023

🦋 Changeset detected

Latest commit: dc02704

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vscode-mdx Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@wooorm wooorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • should probably be documented. Saying where things are loaded from, and that it explicitly only should be syntax plugins, not thing like remark-toc or rehype/recma plugins

@remcohaszing
Copy link
Member Author

Good catch! Definitely need to add documentation for this. Do we have a nice overview of syntax plugins? Maybe we can make a distinction in https://github.com/remarkjs/remark/blob/main/doc/plugins.md? You and I know what this means, but users might not.

@wooorm
Copy link
Member

wooorm commented Jan 19, 2023

nope, don’t think there is such a distinction. Also, I think there are plugins that do both. So maybe this distinction doesn’t even exist

@remcohaszing remcohaszing requested a review from wooorm January 20, 2023 09:35
Co-authored-by: Titus <tituswormer@gmail.com>
Signed-off-by: Remco Haszing <remcohaszing@gmail.com>
@remcohaszing remcohaszing merged commit 4aad7ef into main Jan 20, 2023
@remcohaszing remcohaszing deleted the remark-plugins branch January 20, 2023 11:06
@remcohaszing
Copy link
Member Author

This has been released in v1.2.0 🎉

@ChristianMurphy ChristianMurphy mentioned this pull request Feb 4, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface 🧒 semver/minor This is backwards-compatible change 🦋 type/enhancement This is great to have
Development

Successfully merging this pull request may close these issues.

Support remark syntax plugins in @mdx-js/language-server
2 participants