Skip to content

Commit

Permalink
chore: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Aug 23, 2023
1 parent d0c5a92 commit 48e047e
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,56 @@
# Nuxt MDC

MDC supercharges regular Markdown to write documents interacting deeply with any Vue component.

## Install

```bash
# Using Yarn
yarn add --dev remark-mdc
# Using NPM
npm install --save-dev remark-mdc
```

Then, add `nuxt-mdc` to the modules section of your `nuxt.config.ts`

```ts [nuxt.config.ts]
export default defineNuxtConfig({
modules: ['nuxt-mdc']
})
```

## Use

Parse MDC content in any environment:

```ts [parse-mdc.ts]
import { parseMarkdown } from 'nuxt-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:

```html
<template>
<MDC :value="md" tag="article" />
</template>

<script setup lang="ts">
const md = `
::alert
Hello MDC
::
`
</script>
```


## 💻 Development

Expand Down

0 comments on commit 48e047e

Please sign in to comment.