MDC supercharges regular Markdown to write documents interacting deeply with any Vue component.
MDC supercharges regular Markdown to write documents interacting deeply with any Vue component. MDC stands for MarkDown Components.
<p> added by each Markdown paragraph)Learn more about the MDC syntax on https://content.nuxtjs.org/guide/writing/mdc
# Using npm
npm install --save-dev @nuxtjs/mdc
# Using yarn
yarn add --dev @nuxtjs/mdc
# Using pnpm
pnpm add --dev @nuxtjs/mdc
Then, add @nuxtjs/mdc to the modules section of your nuxt.config.ts
export default defineNuxtConfig({
modules: ['@nuxtjs/mdc']
})
Parse MDC content in any environment:
import { parseMarkdown } from '@nuxtjs/mdc/runtime'
async function main(mdc: string) {
const ast = await parseMarkdown(mdc)
// Do your magic with parsed AST tree
return ast
}
Render MDC content with <MDC> component:
<template>
<MDC :value="md" tag="article" />
</template>
<script setup lang="ts">
const md = `
::alert
Hello MDC
::
`
</script>
pnpm installpnpm dev:preparepnpm devMIT - Made with 💚
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.