diff --git a/projects/document/docs/.vitepress/config.js b/projects/document/docs/.vitepress/config.js index a90486e..9a9182e 100644 --- a/projects/document/docs/.vitepress/config.js +++ b/projects/document/docs/.vitepress/config.js @@ -4,6 +4,7 @@ import { withMermaid } from 'vitepress-plugin-mermaid'; const config = defineConfig({ title: 'Cocos FE', description: 'Cocos FE Team', + head: [['link', { rel: 'icon', href: '/favicon.ico' }]], themeConfig: { socialLinks: [ { @@ -40,6 +41,15 @@ const config = defineConfig({ message: '', copyright: 'MIT Licensed | Copyright © 2019-present cocos FE', }, + + docFooter: { + prev: '上一篇', + next: '下一篇', + }, + + outline: { + label: '摘要', + }, }, lastUpdated: false, vite: { diff --git a/projects/document/docs/core/index.md b/projects/document/docs/core/index.md index 8ec6ca7..4af7dd1 100644 --- a/projects/document/docs/core/index.md +++ b/projects/document/docs/core/index.md @@ -2,4 +2,4 @@ 前端的基础建设都在这边沉淀。我们使用 `mono-repo` 的管理方式,将所有公共包都集中在一个仓库里维护。 -所有 npm 包都以 `@cocos-fe/` 为前缀,更有组织性和辨识度。 \ No newline at end of file +所有 npm 包都以 `@cocos-fe/` 为前缀,更有组织性和辨识度。 diff --git a/projects/document/docs/docs/index.md b/projects/document/docs/docs/index.md index a84bdb2..e8bd796 100644 --- a/projects/document/docs/docs/index.md +++ b/projects/document/docs/docs/index.md @@ -1,4 +1,4 @@ - +# 文档中心 ## 文档 @@ -6,4 +6,4 @@ ## 踩坑记录 -把踩过的坑,碰过的壁都记录在这边,避免其他人重蹈覆辙。 \ No newline at end of file +把踩过的坑,碰过的壁都记录在这边,避免其他人重蹈覆辙。 diff --git a/projects/document/docs/note/markdown/index.md b/projects/document/docs/note/markdown/index.md new file mode 100644 index 0000000..8ae869f --- /dev/null +++ b/projects/document/docs/note/markdown/index.md @@ -0,0 +1,37 @@ +[markdown-it](https://github.com/markdown-it/markdown-it) +[markdown-it-doc](https://github.com/markdown-it/markdown-it/tree/master/docs) +[markdown-it-doc-zh](https://markdown-it.docschina.org/#%E5%AE%89%E8%A3%85) + +[markdown-it-container](https://github.com/markdown-it/markdown-it-container) +[拓展 fence 的案例](https://github.com/emersonbottero/vitepress-plugin-mermaid) + +[markdown 中文官方教程](https://markdown.com.cn/) + +::: yueyue +2024-04-02 +::: + +```js + import markdownItContainer from 'markdown-it-container'; + + markdown: { + config: (md) => { + const name = 'yueyue'; + md.use(markdownItContainer, name, { + validate: function (params) { + // return params.trim().match(/^yueyue\s+(.*)$/); + return params.trim() === name; + }, + render: function (tokens, idx) { + const token = tokens[idx]; + if (token.nesting === 1) { + return `