File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
lua/astrocommunity/markdown-and-latex/markdown-preview-nvim Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 11# markdown-preview.nvim
22
3+ > This plugin requires Node.js to be installed on your system.
4+ > Without it, the installation process will fail, and the plugin won't work.
5+
36markdown preview plugin for (neo)vim
47
58** Repository:** < https://github.com/iamcco/markdown-preview.nvim >
Original file line number Diff line number Diff line change 11--- @type LazySpec
22return {
33 " iamcco/markdown-preview.nvim" ,
4- build = function () vim .fn [" mkdp#util#install" ]() end ,
4+ build = function (plugin )
5+ local package_manager = vim .fn .executable " yarn" and " yarn" or vim .fn .executable " npx" and " npx -y yarn" or false
6+
7+ --- HACK: Use `yarn` or `npx` when possible, otherwise throw an error
8+ --- @see https ://github.com /iamcco /markdown-preview.nvim /issues /690
9+ --- @see https ://github.com /iamcco /markdown-preview.nvim /issues /695
10+ if not package_manager then error " Missing `yarn` or `npx` in the PATH" end
11+
12+ local cmd = string.format (
13+ " !cd %s && cd app && COREPACK_ENABLE_AUTO_PIN=0 %s install --frozen-lockfile" ,
14+ plugin .dir ,
15+ package_manager
16+ )
17+
18+ vim .cmd (cmd )
19+ end ,
520 ft = { " markdown" , " markdown.mdx" },
621 cmd = { " MarkdownPreviewToggle" , " MarkdownPreview" , " MarkdownPreviewStop" },
722 init = function ()
You can’t perform that action at this time.
0 commit comments