antfu / markdown-it-mdc

MDC (Markdown Components) syntax for markdown-it.
MIT License
101 stars 3 forks source link

Would be possible to set up a demo? #5

Closed luminarious closed 9 months ago

luminarious commented 9 months ago

It's possible I am misunderstanding something on a larger scale, but after trying several times I still haven't managed to make this work in Nuxt. Or anywhere else for that matter.

Would it be possible to set up a minimal demo to show how this is intended to be used, please?

nobkd commented 9 months ago

First, you could try using Nuxt MDC (see docs) with Nuxt. Nuxt MDC uses remark-mdc internally and is integrated in the Nuxt ecosystem. (Or maybe Nuxt Content fits your use case? (Also uses Nuxt MDC))

And otherwise, not using Nuxt, the usage example works almost fine for me. (I'll check if the inline component problem is just for me...)

So far, I haven't tried using MarkdownIt and MarkdownIt MDC with Nuxt, so I can't help out there.

luminarious commented 9 months ago

Thank you for being patient with me 😅

I finally realized that there are two separate steps. This plugin gives the syntax for mdc-style components in Markdown, but they will not render until I compile the markdown strings to Vue components. I'll research how to do that.

Because this is for a project that already uses Markdown-it, extending Nuxt MDC would be a much bigger pain in the ass.

sandros94 commented 7 months ago

UPDATE

So, I might have understood the discussion about this being a "two step operation", first being this plugin parsing the content in markdown and providing valid vue templates, the second being asking vue to actually compiling it. For those interested in the discussion could come by and spam in my closed issue on sandros94/nuxt-markdown-render.

ORIGINAL

@luminarious sorry to ping, but I'm looking to understand the same thing and wanted to know if you found anything.

I'm trying create a small module based on markdown-it since I only fetch data from other sources and don't need most of the functionalities from nuxt/content (not to mention that there are a couple of open issue about nuxt/content not being able to render fetched content)