mirror of
https://github.com/snowykami/mbcp.git
synced 2024-11-22 14:17:38 +08:00
📝 优化文档显示
This commit is contained in:
parent
fbfb2b433b
commit
d4fdd90ce2
8
.github/workflows/deploy-docs.yml
vendored
8
.github/workflows/deploy-docs.yml
vendored
@ -40,10 +40,10 @@ jobs:
|
||||
- name: Setup API markdown
|
||||
run: |-
|
||||
python -m pip install litedoc
|
||||
python -m litedoc mbcp -o docs/zh/api -l zh-Hans -f editLink=false -cd class -fd def -md def -vd var
|
||||
python -m litedoc mbcp -o docs/en/api -l en -f editLink=false -cd class -fd def -md def -vd var
|
||||
python -m litedoc mbcp -o docs/ja/api -l ja -f editLink=false -cd class -fd def -md def -vd var
|
||||
python -m litedoc mbcp -o docs/zht/api -l zh-Hant -f editLink=false -cd class -fd def -md def -vd var
|
||||
python -m litedoc mbcp -o docs/zh/api -l zh-Hans -f editLink=false -cd class -fd def -md def -vd var -cs
|
||||
python -m litedoc mbcp -o docs/en/api -l en -f editLink=false -cd class -fd def -md def -vd var -cs
|
||||
python -m litedoc mbcp -o docs/ja/api -l ja -f editLink=false -cd class -fd def -md def -vd var -cs
|
||||
python -m litedoc mbcp -o docs/zht/api -l zh-Hant -f editLink=false -cd class -fd def -md def -vd var -cs
|
||||
|
||||
- name: 安装 pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -19,3 +19,7 @@ docs/zh/api/
|
||||
docs/zht/api/
|
||||
docs/en/api/
|
||||
docs/ja/api/
|
||||
|
||||
# litedoc
|
||||
mkdoc.bat
|
||||
mkdoc_exp.bat
|
@ -14,7 +14,42 @@ const commonSidebarOptions = {
|
||||
useFolderTitleFromIndexFile: true,
|
||||
useFolderLinkFromIndexFile: true,
|
||||
includeFolderIndexFile: true,
|
||||
rootGroupText: 'MBCP',
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate sidebar config
|
||||
* multiple languages and sections
|
||||
* @returns {any[]}
|
||||
*/
|
||||
function generateSidebarConfig(): any[] {
|
||||
let sections = ["api", "refer", "guide"]
|
||||
let languages = ['zh', 'en', 'ja', 'zht']
|
||||
let ret = []
|
||||
for (let language of languages) {
|
||||
for (let section of sections) {
|
||||
if (language === defaultLocale) {
|
||||
ret.push({
|
||||
basePath: `/${section}/`,
|
||||
scanStartPath: `${language}/${section}`,
|
||||
resolvePath: `/${section}/`,
|
||||
...commonSidebarOptions
|
||||
})
|
||||
} else {
|
||||
ret.push({
|
||||
basePath: `/${language}/${section}/`,
|
||||
scanStartPath: `${language}/${section}`,
|
||||
resolvePath: `/${language}/${section}/`,
|
||||
...commonSidebarOptions
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
console.log(generateSidebarConfig())
|
||||
|
||||
export const common = defineConfig({
|
||||
title: "MBCP docs",
|
||||
description: "MBCP library docs",
|
||||
@ -27,23 +62,7 @@ export const common = defineConfig({
|
||||
themeConfig: {
|
||||
sidebar: generateSidebar(
|
||||
[
|
||||
...[defaultLocale, 'en', 'ja', 'zht'].map((locale) => {
|
||||
if (locale === defaultLocale) {
|
||||
return {
|
||||
basePath: '/api/',
|
||||
scanStartPath: `${locale}/api`,
|
||||
resolvePath: '/api/',
|
||||
...commonSidebarOptions
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
basePath: `/${locale}/api/`,
|
||||
scanStartPath: `${locale}/api`,
|
||||
resolvePath: `/${locale}/api/`,
|
||||
...commonSidebarOptions
|
||||
}
|
||||
}
|
||||
})
|
||||
...generateSidebarConfig()
|
||||
]
|
||||
),
|
||||
socialLinks: [
|
||||
|
@ -6,6 +6,7 @@ export const en = defineConfig({
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{text: 'Get Start', link: '/en/guide/'},
|
||||
{text: 'Reference', link: '/en/refer'},
|
||||
{text: 'API Document', link: '/en/api/'},
|
||||
{text: 'Demo', link: '/en/demo/'},
|
||||
],
|
||||
|
@ -6,6 +6,7 @@ export const ja = defineConfig({
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{text: 'スタート', link: '/ja/guide/'},
|
||||
{text: 'リファレンス', link: '/ja/refer'},
|
||||
{text: 'APIドキュメント', link: '/ja/api/'},
|
||||
{text: 'インスタンス', link: '/ja/demo/'},
|
||||
],
|
||||
|
@ -6,6 +6,7 @@ export const zh = defineConfig({
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{text: '快速开始', link: '/guide/'},
|
||||
{text: '参考', link: '/refer'},
|
||||
{text: 'API文档', link: '/api/'},
|
||||
{text: '实例', link: '/demo/'},
|
||||
],
|
||||
|
@ -7,6 +7,7 @@ export const zht = defineConfig({
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{text: '指引', link: '/zht/guide/'},
|
||||
{text: '參考', link: '/zht/refer'},
|
||||
{text: 'API文檔', link: '/zht/api/'},
|
||||
{text: '示範', link: '/zht/demo/'},
|
||||
],
|
||||
|
3
docs/en/refer/index.md
Normal file
3
docs/en/refer/index.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Reference
|
||||
help us to improve the documentation
|
||||
```
|
4
docs/ja/refer/index.md
Normal file
4
docs/ja/refer/index.md
Normal file
@ -0,0 +1,4 @@
|
||||
# Reference
|
||||
|
||||
Help us to improve the documentation
|
||||
```
|
3
docs/zh/refer/function/curry.md
Normal file
3
docs/zh/refer/function/curry.md
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
title: 柯里化
|
||||
---
|
3
docs/zh/refer/function/function.md
Normal file
3
docs/zh/refer/function/function.md
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
title: 函数
|
||||
---
|
8
docs/zh/refer/index.md
Normal file
8
docs/zh/refer/index.md
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
title: 参考
|
||||
---
|
||||
|
||||
# Reference
|
||||
|
||||
Help us to improve the documentation
|
||||
```
|
4
docs/zht/refer/index.md
Normal file
4
docs/zht/refer/index.md
Normal file
@ -0,0 +1,4 @@
|
||||
# Reference
|
||||
|
||||
Help us to improve the documentation
|
||||
```
|
@ -1,5 +1,5 @@
|
||||
chcp 65001
|
||||
python -m litedoc mbcp -o docs/zh/api -l zh-Hans -f editLink=false -cd class -fd def -md def -vd var
|
||||
python -m litedoc mbcp -o docs/en/api -l en -f editLink=false -cd class -fd def -md def -vd var
|
||||
python -m litedoc mbcp -o docs/ja/api -l ja -f editLink=false -cd class -fd def -md def -vd var
|
||||
python -m litedoc mbcp -o docs/zht/api -l zh-Hant -f editLink=false -cd class -fd def -md def -vd var
|
||||
python -m litedoc mbcp -o docs/zh/api -l zh-Hans -f editLink=false -cd class -fd def -md def -vd var -cs
|
||||
python -m litedoc mbcp -o docs/en/api -l en -f editLink=false -cd class -fd def -md def -vd var -cs
|
||||
python -m litedoc mbcp -o docs/ja/api -l ja -f editLink=false -cd class -fd def -md def -vd var -cs
|
||||
python -m litedoc mbcp -o docs/zht/api -l zh-Hant -f editLink=false -cd class -fd def -md def -vd var -cs
|
Loading…
Reference in New Issue
Block a user