107 lines
4.1 KiB
HTML
107 lines
4.1 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<title>觉远创智开发文档</title>
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||
<meta name="description" content="觉远创智智能眼镜开放平台开发文档">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
|
||
|
||
<!-- DNS 预解析和预连接优化 -->
|
||
<link rel="dns-prefetch" href="https://cdn.staticfile.org">
|
||
<link rel="dns-prefetch" href="https://unpkg.com">
|
||
<link rel="preconnect" href="https://cdn.staticfile.org" crossorigin>
|
||
|
||
<!-- 直接加载 CSS,避免阻塞渲染 -->
|
||
<link rel="stylesheet" href="https://cdn.staticfile.org/docsify/4.13.1/themes/vue.css">
|
||
|
||
<style>
|
||
:root {
|
||
--theme-color: #42b983;
|
||
--sidebar-width: 300px;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div id="app">加载中...</div>
|
||
<script>
|
||
window.$docsify = {
|
||
name: '',
|
||
repo: '',
|
||
homepage: 'venus-sdk-1.0.md',
|
||
loadSidebar: true,
|
||
subMaxLevel: 3,
|
||
auto2top: true,
|
||
coverpage: false,
|
||
alias: {
|
||
'/.*/_sidebar.md': '/_sidebar.md'
|
||
},
|
||
// 自定义 slugify 函数,确保锚点正确生成(与文档内部链接格式一致)
|
||
slugify: function(text) {
|
||
// 移除标题标记和空格
|
||
text = text.trim();
|
||
// 移除中文括号和标点符号
|
||
var slug = text
|
||
.replace(/[()()【】\[\]《》<>""'',。、;:!?]/g, '') // 移除中文和英文标点符号
|
||
.replace(/\./g, '') // 移除点号(如 6.1 -> 61)
|
||
.replace(/\s+/g, '-') // 空格替换为连字符
|
||
.replace(/[^\u4e00-\u9fa5a-z0-9-]+/g, '') // 移除其他非中文、字母、数字、连字符的字符
|
||
.replace(/^-+|-+$/g, '') // 移除首尾连字符
|
||
.replace(/-+/g, '-'); // 多个连字符合并为一个
|
||
slug = slug.toLowerCase(); // 转为小写(docsify 默认行为)
|
||
// 如果以数字开头,添加下划线前缀(匹配 sidebar 链接格式)
|
||
if (/^\d/.test(slug)) {
|
||
slug = '_' + slug;
|
||
}
|
||
return slug;
|
||
},
|
||
search: {
|
||
maxAge: 86400000,
|
||
paths: 'auto',
|
||
placeholder: '搜索文档',
|
||
noData: '找不到结果!',
|
||
depth: 6
|
||
},
|
||
pagination: {
|
||
previousText: '上一章节',
|
||
nextText: '下一章节',
|
||
crossChapter: true,
|
||
crossChapterText: true,
|
||
},
|
||
plugins: [
|
||
function(hook, vm) {
|
||
hook.beforeEach(function(html) {
|
||
return html
|
||
})
|
||
hook.afterEach(function(html, next) {
|
||
next(html)
|
||
})
|
||
}
|
||
]
|
||
}
|
||
</script>
|
||
|
||
<!-- 使用国内 CDN (staticfile.org 七牛云) 并优化加载顺序 -->
|
||
<!-- Docsify 核心库 -->
|
||
<script src="https://cdn.staticfile.org/docsify/4.13.1/docsify.min.js" defer></script>
|
||
|
||
<!-- 搜索插件 -->
|
||
<script src="https://cdn.staticfile.org/docsify/4.13.1/plugins/search.min.js" defer></script>
|
||
|
||
<!-- 分页插件 - 使用 unpkg 作为备选 -->
|
||
<script src="https://unpkg.com/docsify-pagination@2.10.1/dist/docsify-pagination.min.js" defer></script>
|
||
|
||
<!-- Prism 代码高亮 - 使用 defer 异步加载,合并加载顺序 -->
|
||
<script src="https://cdn.staticfile.org/prism/1.29.0/components/prism-core.min.js" defer></script>
|
||
<script src="https://cdn.staticfile.org/prism/1.29.0/components/prism-bash.min.js" defer></script>
|
||
<script src="https://cdn.staticfile.org/prism/1.29.0/components/prism-javascript.min.js" defer></script>
|
||
<script src="https://cdn.staticfile.org/prism/1.29.0/components/prism-java.min.js" defer></script>
|
||
<script src="https://cdn.staticfile.org/prism/1.29.0/components/prism-kotlin.min.js" defer></script>
|
||
<script src="https://cdn.staticfile.org/prism/1.29.0/components/prism-swift.min.js" defer></script>
|
||
<script src="https://cdn.staticfile.org/prism/1.29.0/components/prism-python.min.js" defer></script>
|
||
<script src="https://cdn.staticfile.org/prism/1.29.0/components/prism-json.min.js" defer></script>
|
||
<script src="https://cdn.staticfile.org/prism/1.29.0/components/prism-markdown.min.js" defer></script>
|
||
</body>
|
||
</html>
|
||
|