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

feat: auto install markdown-it plugins #3

Closed
sandros94 opened this issue Feb 5, 2024 — with Volta.net · 7 comments
Closed

feat: auto install markdown-it plugins #3

sandros94 opened this issue Feb 5, 2024 — with Volta.net · 7 comments
Labels
help wanted Extra attention is needed

Comments

Copy link
Owner

I wonder if it is possible to look for some sort of registry and auto-install markdown-it plugins from npm.

@sandros94 sandros94 changed the title feat: auto install markdown-it plugin feat: auto install markdown-it plugins Feb 25, 2024
@atinux
Copy link

atinux commented Mar 3, 2024

It would be nice to support https://github.com/antfu/markdown-it-mdc as well by default

@sandros94
Copy link
Owner Author

It would be nice to support https://github.com/antfu/markdown-it-mdc as well by default

Indeed, this was something I had in mind

@sandros94
Copy link
Owner Author

@atinux, if you have time and will, could I borrow some of your knowledge?

While fixing #2 via fe9bea8, I've came up with the understanding that I required vue.runtimeCompiler = true in nuxt.config.ts.

Is this the only option to make components work? If not, would you please link some resources (or explain them) on what should I study to implement that one better?

Feel free to respond here, or more appropriately in #2 or #4

@antfu
Copy link

antfu commented Mar 5, 2024

markdown-it is only responsible for converting markdown to HTML, while if the HTML contains Vue components, I think yes, that would requires runtime compiler

@sandros94 sandros94 added the help wanted Extra attention is needed label Mar 5, 2024
@luminarious
Copy link

My setup currently works by having this interesting hook. For anything more efficient I would have to dive deeper into Vite but I don't want to 😅

// nuxt.config.ts
	hooks: {
		'vite:extendConfig': (config, { isClient }) => {
			if (isClient) config.resolve.alias.vue = 'vue/dist/vue.esm-bundler.js'
		}
	},

@luminarious
Copy link

To elaborate, I am not returning html, I am returning a render function: https://gist.github.com/luminarious/f55b84e8e0bd56ca39b0e4fa0d91c9f3

@sandros94
Copy link
Owner Author

My setup currently works by having this interesting hook. For anything more efficient I would have to dive deeper into Vite but I don't want to 😅

I would prefer to leave it more agnostic. I was starting to consider a Devtool's panel to help with this, that does fetch the npm packages with the markdown-it-plugin tag, but since the lack of time I might close this for now and revisit it at later date.

To elaborate, I am not returning html, I am returning a render function

Well, that's basically a must 😜

@sandros94 sandros94 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants