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

[v3][Feature Request] Support alternative Markdown Renderer #2916

Open
Hebilicious opened this issue Dec 15, 2024 · 0 comments
Open

[v3][Feature Request] Support alternative Markdown Renderer #2916

Hebilicious opened this issue Dec 15, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Hebilicious
Copy link
Member

Hebilicious commented Dec 15, 2024

Is your feature request related to a problem? Please describe

As an alterative to Remark/MDC, it would be great if nuxt content had support for Markdown-It or MDX.

It would help migrating from an existing markdown based system to nuxt content.

For example if I have a Vitepress website with some markdown content, I would like to be able to migrate it to Nuxt Content without changing my markdown files at all. For this it would be nice to have an alternative ContentRenderer, or the ability to provide a custom one that would use mardown-it and apply the same plugins as vitepress. If it's possible to make a custom one, it would be nice to add some documentation or to streamline the interface so that the community can implement them.

Describe the solution you'd like

Providing different markdown renderer content, or giving a straightforward path to implement custom ones.

For example for MDX it could look like this :

<script setup>
const slug = useRoute().params.slug
const { data: post } = await useAsyncData(`blog-${slug}`, () => {
  return queryCollection('blog').path(slug).first()
})
</script>

<template>
  <ContentRenderer syntax="mdx" :value="post" />
  <ContentRendererMDX :value="post" />
</template>

Describe alternatives you've considered

https://bsky.app/profile/farnabaz.dev/post/3lcwxftdfjk2u
It might be possible to use remark/rehype plugins to achieve a similar result.

Additional context

#2498
#1260
#2248

@Hebilicious Hebilicious added the enhancement New feature or request label Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant