@@ -9,6 +9,20 @@ import { normalizePath } from 'vite'
99const GIT_MAIN_BRANCH_DOCS_DIR =
1010 'https://github.com/hcg1023/vue3-dnd/tree/main/packages/docs'
1111
12+ const AppVueFileName = `App.vue`
13+ const AppVueFileTemplate = `<template>
14+ <DndProvider :backend="HTML5Backend">
15+ <Container></Container>
16+ </DndProvider>
17+ </template>
18+
19+ <script lang="ts" setup>
20+ import Container from './index.ts'
21+ import { DndProvider } from 'vue3-dnd'
22+ import { HTML5Backend } from 'react-dnd-html5-backend'
23+ </script>`
24+
25+
1226export const transformDemo = ( md : MarkdownIt , srcDir : string ) => {
1327 const parser : RuleBlock = ( state , startLine , endLine , silent ) => {
1428 const CH = '+' . charCodeAt ( 0 )
@@ -81,7 +95,12 @@ export const transformDemo = (md: MarkdownIt, srcDir: string) => {
8195 highlight : highlight ( source , type ) ,
8296 } ,
8397 }
84- } , { } )
98+ } , { } as Record < string , { type : string , raw : string , highlight : string } > )
99+ fileInfos [ AppVueFileName ] = {
100+ type : 'vue' ,
101+ raw : AppVueFileTemplate ,
102+ highlight : highlight ( AppVueFileTemplate , 'vue' )
103+ }
85104 const basename = token . info
86105 token . info = ''
87106
0 commit comments