添加教程
This commit is contained in:
18
src/main.ts
18
src/main.ts
@@ -1,10 +1,28 @@
|
||||
import { createApp } from "vue"
|
||||
import { create } from "naive-ui"
|
||||
import { marked } from "marked"
|
||||
import "normalize.css"
|
||||
import "github-markdown-css/github-markdown-light.css"
|
||||
import "highlight.js/styles/github.min.css"
|
||||
import App from "./App.vue"
|
||||
|
||||
import { markedHighlight } from "marked-highlight"
|
||||
import hljs from "highlight.js"
|
||||
|
||||
marked.use({
|
||||
gfm: true,
|
||||
async: true,
|
||||
})
|
||||
marked.use(
|
||||
markedHighlight({
|
||||
langPrefix: "hljs language-",
|
||||
highlight(code, lang) {
|
||||
const language = hljs.getLanguage(lang) ? lang : "plaintext"
|
||||
return hljs.highlight(code, { language }).value
|
||||
},
|
||||
}),
|
||||
)
|
||||
|
||||
const app = createApp(App)
|
||||
const naive = create()
|
||||
app.use(naive)
|
||||
|
||||
Reference in New Issue
Block a user