Skip to content

Commit

Permalink
docs: add playground
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Aug 23, 2023
1 parent c78cbb1 commit 7322cd2
Show file tree
Hide file tree
Showing 4 changed files with 9,167 additions and 1 deletion.
53 changes: 53 additions & 0 deletions docs/components/mdc/MdcPlayground.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<template>
<div class="wrapper">
<textarea
v-model="md"
class="w-full p-4"
/>
<MDC
tag="article"
:value="md"
class="p-4"
/>
</div>
</template>

<script setup>
import { ref } from 'vue'
const md = ref(`---
title: Hello MDC
---
# {{ title }}
Try me
> Set not thy heart on any good or gain.
> Omar Khayyam
\`\`\`html
<MDC
tag="article"
:value="markdownContent"
/>
\`\`\`
`)
</script>

<style scoped>
.wrapper {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
height: 400px;
border: 1px solid;
overflow: hidden;
border-radius: 0.25rem;
}
.wrapper > article {
overflow: scroll;
}
.p-4 {
padding: 1em;
}
</style>
3 changes: 3 additions & 0 deletions docs/content/0.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export default defineNuxtConfig({

That's it, you can start writing and rendering markdown files ✨

## Live Demo

:mdc-playground

## Parsing Markdown

Expand Down
5 changes: 4 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@
"preview": "nuxi preview",
"lint": "eslint ."
},
"resolutions": {
"@nuxt/content": "npm:@nuxt/content-edge@latest"
},
"devDependencies": {
"@nuxt-themes/docus": "^1.13.1",
"@nuxt/devtools": "^0.6.7",
"@nuxt/eslint-config": "^0.1.1",
"@nuxtjs/plausible": "^0.2.1",
"@types/node": "^20.4.0",
"eslint": "^8.44.0",
"nuxt": "^3.6.2"
"nuxt": "^3.6.5"
}
}
Loading

0 comments on commit 7322cd2

Please sign in to comment.