docs(icons): dynamic theme section

This commit is contained in:
Benjamin Canac
2024-07-03 15:25:05 +02:00
parent a4e86d6d42
commit 6f535ade9c
2 changed files with 20 additions and 91 deletions

View File

@@ -0,0 +1,19 @@
<script setup lang="ts">
import json5 from 'json5'
const appConfig = useAppConfig()
const { data: ast } = await useAsyncData<any>(`icons-theme`, () => parseMarkdown(`
\`\`\`yml
${json5.stringify(appConfig.ui.icons, null, 2).replace(/,([ |\t\n]+[}|\])])/g, '$1')}
\`\`\`\
::callout{icon="i-heroicons-light-bulb"}
You can customize this component in your \`app.config.ts\` under \`ui.icons\` key.
::
`))
</script>
<template>
<MDCRenderer v-if="ast" :body="ast.body" :data="ast.data" />
</template>