添加 API 速查文档和相关数据,更新导航以支持新页面

This commit is contained in:
boybook
2025-03-26 17:14:19 +08:00
parent 5382f625fc
commit 7f56fbdb06
11 changed files with 40076 additions and 0 deletions

View File

@@ -60,6 +60,7 @@ export default withMermaid({
nav: [
{ text: '首页', link: '/' },
{ text: 'Wiki', link: '/wiki', activeMatch: '^/wiki/' },
{ text: 'API速查', link: '/api-tools/interface', activeMatch: '^/api-tools/' },
{ text: 'API文档', link: '/mcdocs/0-欢迎', activeMatch: '^/mcdocs/' },
{ text: '开发指南', link: '/mcguide/0-欢迎', activeMatch: '^/mcguide/' },
{ text: '教学课程', link: '/mconline/0-欢迎', activeMatch: '^/mconline/' },

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,5 @@
import Layout from './layout/Layout.vue'
import DefaultTheme from 'vitepress/theme'
import MyFeatures from './components/MyFeatures.vue'
import CodeHeader from './components/content/CodeHeader.vue'
@@ -5,10 +7,15 @@ import WikiImage from './components/content/WikiImage.vue'
import Button from './components/content/Button.vue'
import FolderView from './components/content/FolderView/FolderView.vue'
import Checklist from './components/content/Checklist.vue'
import ApiTable from './components/ApiTable.vue'
import './style.css';
export default {
extends: DefaultTheme,
Layout: Layout,
enhanceApp({ app }) {
app.component('ApiTable', ApiTable);
app.component('MyFeatures', MyFeatures);
app.component('CodeHeader', CodeHeader);
app.component('WikiImage', WikiImage);

View File

@@ -0,0 +1,32 @@
<script setup>
import { useRoute } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import { computed } from 'vue'
const route = useRoute()
// 需要全宽的路由匹配规则(支持 glob 模式)
const fullWidthRoutes = [
'/api-tools/(.*)' // 正则匹配
]
// 动态计算 class
const layoutClass = computed(() => {
return fullWidthRoutes.some(pattern =>
new RegExp(
pattern
.replace(/\*/g, '.*')
.replace(/\//g, '\\/')
).test(route.path)
) ? 'vp-full-width' : ''
})
</script>
<template>
<div
class="vp-theme-container"
:class="layoutClass"
>
<DefaultTheme.Layout />
</div>
</template>

View File

@@ -0,0 +1,21 @@
/* 全宽模式下的变量覆盖 */
.vp-full-width {
--vp-layout-max-width: 100% !important;
--vp-sidebar-bg-color: var(--vp-bg-color) !important;
--vp-sidebar-width: 200px !important;
/*var(--vp-c-bg-alt)*/
--vp-sidebar-bg-color: var(--vp-bg-color) !important;
}
/* 全宽模式下的额外样式 */
.vp-full-width .VPDoc.has-aside .content-container {
max-width: none !important;
}
.vp-full-width .VPDoc.has-aside .aside {
display: none !important;
}
.vp-full-width .VPDoc {
background-color: var(--vp-c-bg-alt);
}