diff --git a/components.d.ts b/components.d.ts
index 725d6fa..1fdf608 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -19,5 +19,6 @@ declare module 'vue' {
NTag: typeof import('naive-ui')['NTag']
NText: typeof import('naive-ui')['NText']
Preview: typeof import('./src/components/Preview.vue')['default']
+ Tutorial: typeof import('./src/components/Tutorial.vue')['default']
}
}
diff --git a/package-lock.json b/package-lock.json
index 53f9707..50ae1c3 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13,6 +13,8 @@
"@codemirror/lang-javascript": "^6.2.3",
"@vueuse/core": "^12.7.0",
"codemirror": "^6.0.1",
+ "github-markdown-css": "^5.8.1",
+ "marked": "^15.0.7",
"naive-ui": "^2.41.0",
"normalize.css": "^8.0.1",
"vue": "^3.5.13",
@@ -1618,6 +1620,18 @@
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
+ "node_modules/github-markdown-css": {
+ "version": "5.8.1",
+ "resolved": "https://registry.npmjs.org/github-markdown-css/-/github-markdown-css-5.8.1.tgz",
+ "integrity": "sha512-8G+PFvqigBQSWLQjyzgpa2ThD9bo7+kDsriUIidGcRhXgmcaAWUIpCZf8DavJgc+xifjbCG+GvMyWr0XMXmc7g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
@@ -1820,6 +1834,18 @@
"@jridgewell/sourcemap-codec": "^1.5.0"
}
},
+ "node_modules/marked": {
+ "version": "15.0.7",
+ "resolved": "https://registry.npmjs.org/marked/-/marked-15.0.7.tgz",
+ "integrity": "sha512-dgLIeKGLx5FwziAnsk4ONoGwHwGPJzselimvlVskE9XLN4Orv9u2VA3GWw/lYUqjfA0rUT/6fqKwfZJapP9BEg==",
+ "license": "MIT",
+ "bin": {
+ "marked": "bin/marked.js"
+ },
+ "engines": {
+ "node": ">= 18"
+ }
+ },
"node_modules/merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
diff --git a/package.json b/package.json
index 6d59dd5..7bb7388 100644
--- a/package.json
+++ b/package.json
@@ -14,6 +14,8 @@
"@codemirror/lang-javascript": "^6.2.3",
"@vueuse/core": "^12.7.0",
"codemirror": "^6.0.1",
+ "github-markdown-css": "^5.8.1",
+ "marked": "^15.0.7",
"naive-ui": "^2.41.0",
"normalize.css": "^8.0.1",
"vue": "^3.5.13",
diff --git a/public/turtorial/01/README.md b/public/turtorial/01/README.md
new file mode 100644
index 0000000..23760c6
--- /dev/null
+++ b/public/turtorial/01/README.md
@@ -0,0 +1,27 @@
+# 测试
+
+## 什么是 HTML
+
+```html
+
hello
+```
+
+```css
+.welcome {
+ color: red;
+}
+```
+
+## 什么是 HTML
+
+## 什么是 HTML
+
+## 什么是 HTML
+
+## 什么是 HTML
+
+## 什么是 HTML
+
+## 什么是 HTML
+
+## 什么是 HTML
diff --git a/public/turtorial/02/README.md b/public/turtorial/02/README.md
new file mode 100644
index 0000000..302946b
--- /dev/null
+++ b/public/turtorial/02/README.md
@@ -0,0 +1 @@
+# 什么是 CSS
\ No newline at end of file
diff --git a/public/turtorial/03/README.md b/public/turtorial/03/README.md
new file mode 100644
index 0000000..e69de29
diff --git a/rsbuild.config.ts b/rsbuild.config.ts
index 11b1400..4f03fd7 100644
--- a/rsbuild.config.ts
+++ b/rsbuild.config.ts
@@ -1,6 +1,5 @@
import { defineConfig } from "@rsbuild/core"
import { pluginVue } from "@rsbuild/plugin-vue"
-// import AutoImport from "unplugin-auto-import/rspack"
import { NaiveUiResolver } from "unplugin-vue-components/resolvers"
import Components from "unplugin-vue-components/rspack"
@@ -17,19 +16,6 @@ export default defineConfig({
tools: {
rspack: {
plugins: [
- // AutoImport({
- // imports: [
- // "vue",
- // {
- // "naive-ui": [
- // "useDialog",
- // "useMessage",
- // "useNotification",
- // "useLoadingBar",
- // ],
- // },
- // ],
- // }),
Components({
resolvers: [NaiveUiResolver()],
}),
diff --git a/src/App.vue b/src/App.vue
index a5e8b04..b914a3e 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -2,6 +2,7 @@
import { dateZhCN, zhCN } from "naive-ui"
import Editors from "./components/Editors.vue"
import Preview from "./components/Preview.vue"
+import Tutorial from "./components/Tutorial.vue"
import { useMagicKeys, whenever } from "@vueuse/core"
const { ctrl_s } = useMagicKeys({
@@ -22,14 +23,25 @@ whenever(ctrl_r, () => {})
-
-
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Editors.vue b/src/components/Editors.vue
index 2031303..4df9e50 100644
--- a/src/components/Editors.vue
+++ b/src/components/Editors.vue
@@ -1,7 +1,8 @@
-
+
HTML
@@ -18,7 +19,7 @@
-
+
CSS
@@ -27,7 +28,7 @@
-
+
JavaScript
@@ -36,7 +37,7 @@
-
+
选项
@@ -72,7 +73,7 @@
import { Icon } from "@iconify/vue"
import Editor from "./Editor.vue"
import { useStorage } from "@vueuse/core"
-import { html, css, js, reset, size, changeSize } from "../store.ts"
+import { html, css, js, reset, size, changeSize } from "../store"
const currentTab = useStorage("web-tab", "html")
@@ -83,7 +84,8 @@ function changeTab(tab: "html" | "css" | "js" | "actions") {
diff --git a/src/env.d.ts b/src/env.d.ts
new file mode 100644
index 0000000..e69de29
diff --git a/src/main.ts b/src/main.ts
index c39a7e1..2014abe 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -1,6 +1,7 @@
import { createApp } from "vue"
import { create } from "naive-ui"
import "normalize.css"
+import "github-markdown-css/github-markdown-light.css"
import App from "./App.vue"
const app = createApp(App)
diff --git a/src/store.ts b/src/store.ts
index a43a895..6c6fb79 100644
--- a/src/store.ts
+++ b/src/store.ts
@@ -23,3 +23,14 @@ export const size = useStorage("web-fontsize", 24)
export function changeSize(num: number) {
size.value = num
}
+
+export const step = useStorage("web-turtorial-step", "01")
+export const content = useStorage("web-turtorial-content", "")
+export function prev() {
+ let num = parseInt(step.value) - 1
+ step.value = num.toString().padStart(2, "0")
+}
+export function next() {
+ let num = parseInt(step.value) + 1
+ step.value = num.toString().padStart(2, "0")
+}
diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts
deleted file mode 100644
index 11f02fe..0000000
--- a/src/vite-env.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-///