From be08022d7c6c350a26abd758192e5f0d04561fe5 Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Mon, 5 Aug 2024 05:38:58 -0400 Subject: [PATCH] feat(pack): add `mdx` language pack (#1142) --- lua/astrocommunity/pack/markdown/init.lua | 1 - lua/astrocommunity/pack/mdx/README.md | 7 +++++ lua/astrocommunity/pack/mdx/init.lua | 33 +++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 lua/astrocommunity/pack/mdx/README.md create mode 100644 lua/astrocommunity/pack/mdx/init.lua diff --git a/lua/astrocommunity/pack/markdown/init.lua b/lua/astrocommunity/pack/markdown/init.lua index a07d1ca56..b8033ec5c 100644 --- a/lua/astrocommunity/pack/markdown/init.lua +++ b/lua/astrocommunity/pack/markdown/init.lua @@ -37,7 +37,6 @@ return { opts = { formatters_by_ft = { markdown = { "prettierd", "prettier", stop_after_first = true }, - ["markdown.mdx"] = { "prettierd", "prettier", stop_after_first = true }, }, }, }, diff --git a/lua/astrocommunity/pack/mdx/README.md b/lua/astrocommunity/pack/mdx/README.md new file mode 100644 index 000000000..93b916918 --- /dev/null +++ b/lua/astrocommunity/pack/mdx/README.md @@ -0,0 +1,7 @@ +# MDX Language Pack + +This plugin pack does the following: + +- Adds `markdown.mdx` filetype +- Adds `mdx_analyzer` language server +- Adds the [Markdown Language Pack](https://github.com/AstroNvim/astrocommunity/tree/main/lua/astrocommunity/pack/markdown) diff --git a/lua/astrocommunity/pack/mdx/init.lua b/lua/astrocommunity/pack/mdx/init.lua new file mode 100644 index 000000000..ff8e2071e --- /dev/null +++ b/lua/astrocommunity/pack/mdx/init.lua @@ -0,0 +1,33 @@ +return { + { import = "astrocommunity.pack.markdown" }, + { + "AstroNvim/astrocore", + ---@type AstroCoreOpts + opts = { filetypes = { extension = { + mdx = "markdown.mdx", + } } }, + }, + { + "williamboman/mason-lspconfig.nvim", + optional = true, + opts = function(_, opts) + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "mdx_analyzer" }) + end, + }, + { + "WhoIsSethDaniel/mason-tool-installer.nvim", + optional = true, + opts = function(_, opts) + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "mdx-analyzer" }) + end, + }, + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { + ["markdown.mdx"] = { "prettierd", "prettier", stop_after_first = true }, + }, + }, + }, +}