📝 优化文档显示

This commit is contained in:
2024-08-31 06:06:32 +08:00
parent e0b4610161
commit 2c0be2c6f0
15 changed files with 155 additions and 47 deletions

View File

@ -51,8 +51,11 @@ function generateSidebarConfig(): any[] {
console.log(generateSidebarConfig())
export const common = defineConfig({
title: "MBCP docs",
description: "MBCP library docs",
head: [
[
'link', {rel: 'icon', type: 'image/svg+xml', href: '/mbcp-logo.svg'}
]
],
markdown: {
math: true
},
@ -60,6 +63,7 @@ export const common = defineConfig({
[`${defaultLocale}/:rest*`]: ":rest*",
},
themeConfig: {
logo: '/mbcp-logo.svg',
sidebar: generateSidebar(
[
...generateSidebarConfig()
@ -68,9 +72,6 @@ export const common = defineConfig({
socialLinks: [
{icon: 'github', link: 'https://github.com/snowykami/mbcp'}
],
editLink: {
pattern: 'https://github.com/snowykami/mbcp/tree/main/docs/:path'
},
outline: [2, 6]
},
sitemap: {

View File

@ -1,15 +1,24 @@
import {defineConfig} from 'vitepress'
import {ThemeConfig} from "./utils";
export const en = defineConfig({
lang: "en-US",
description: "A library made for Minecraft particle generation",
title: "MBCP docs",
description: "MBCP library docs",
themeConfig: {
nav: [
{text: 'Get Start', link: '/en/guide/'},
{text: 'Reference', link: '/en/refer'},
{text: 'API Document', link: '/en/api/'},
{text: 'API Reference', link: '/en/api/'},
{text: 'Demo', link: '/en/demo/'},
],
docFooter: {
prev: 'Prev Page',
next: 'Next Page'
},
editLink: ThemeConfig.getEditLink(
'Edit this page on GitHub',
),
footer: {
message: 'Documentation built with <a href="https://vitepress.dev/">VitePress</a> | API references generated by <a href="https://github.com/LiteyukiStudio/litedoc">litedoc</a>',
copyright: 'Copyright (C) 2020-2024 SnowyKami. All Rights Reserved'

View File

@ -1,15 +1,24 @@
import {defineConfig} from 'vitepress'
import {ThemeConfig} from "./utils";
export const ja = defineConfig({
lang: "ja-JP",
description: "Minecraftのパーティクル生成用のライブラリ",
title: "MBCP ドキュメント",
description: "MBCP ライブラリ ドキュメント",
themeConfig: {
nav: [
{text: 'スタート', link: '/ja/guide/'},
{text: 'リファレンス', link: '/ja/refer'},
{text: 'APIドキュメント', link: '/ja/api/'},
{text: 'APIリファレンス', link: '/ja/api/'},
{text: 'インスタンス', link: '/ja/demo/'},
],
docFooter: {
prev: '前のページ',
next: '次のページ'
},
editLink: ThemeConfig.getEditLink(
'このページをGitHubで編集する',
),
footer: {
message: '<a href="https://vitepress.dev/">VitePress</a> で構築されたドキュメント | <a href="https://github.com/LiteyukiStudio/litedoc">litedoc</a> によって生成されたAPIリファレンス',
copyright: 'Copyright (C) 2020-2024 SnowyKami. All Rights Reserved'

View File

@ -0,0 +1,23 @@
/**
* GetEditLink Options
* @param text Edit link text
*/
export const ThemeConfig = {
getEditLink: (editPageText: string): { pattern: (params: { filePath: string; }) => string; text: string; } => {
return {
pattern: ({filePath}: { filePath: string; }): string => {
const regex = /^[^\/]+\/api/;
if (regex.test(filePath)) {
// remove {lang}/api prefix
filePath = filePath.replace(regex, '')
.replace('index.md', '__init__.py')
.replace('.md', '.py');
return `https://github.com/snowykami/mbcp/tree/main/mbcp/${filePath}`;
} else {
return `https://github.com/snowykami/mbcp/tree/main/docs/${filePath}`;
}
},
text: editPageText
};
}
}

View File

@ -1,15 +1,24 @@
import {defineConfig} from 'vitepress'
import {ThemeConfig} from "./utils";
export const zh = defineConfig({
lang: "zh-Hans",
description: "一个用于Minecraft粒子计算和生成的库",
title: "MBCP 文档",
description: "MBCP 粒子计算和生成库文档",
themeConfig: {
nav: [
{text: '快速开始', link: '/guide/'},
{text: '参考', link: '/refer'},
{text: 'API文档', link: '/api/'},
{text: 'API引用', link: '/api/'},
{text: '实例', link: '/demo/'},
],
docFooter: {
prev: '上一页',
next: '下一页'
},
editLink: ThemeConfig.getEditLink(
'在 GitHub 上编辑此页',
),
footer: {
message: '文档由 <a href="https://vitepress.dev/">VitePress</a> 构建 | API引用由 <a href="https://github.com/LiteyukiStudio/litedoc">litedoc</a> 生成',
copyright: 'Copyright (C) 2020-2024 SnowyKami. All Rights Reserved'

View File

@ -1,16 +1,24 @@
import {defineConfig} from 'vitepress'
import {ThemeConfig} from "./utils";
export const zht = defineConfig({
lang: "zh-Hant",
description: "一個用於Minecraft粒子計算和生成的軟體庫",
title: "MBCP 文檔",
description: "MBCP 粒子計算和生成庫文檔",
themeConfig: {
nav: [
{text: '指引', link: '/zht/guide/'},
{text: '參考', link: '/zht/refer'},
{text: 'API文檔', link: '/zht/api/'},
{text: 'API引用', link: '/zht/api/'},
{text: '示範', link: '/zht/demo/'},
],
docFooter: {
prev: '上一頁',
next: '下一頁'
},
editLink: ThemeConfig.getEditLink(
'於 GitHub 上編輯這頁',
),
footer: {
message: '文檔由 <a href="https://vitepress.dev/">VitePress</a> 構建 | API引用由 <a href="https://github.com/LiteyukiStudio/litedoc">litedoc</a> 生成',
copyright: 'Copyright (C) 2020-2024 SnowyKami. All Rights Reserved'

View File

@ -3,9 +3,9 @@
layout: home
hero:
name: "MBCP docs"
name: "MBCP"
text: "More basic change particle"
tagline: A Library for Python to create particle effects and geometric figures
tagline: A Library for Python to create Minecraft particle effects and geometric figures
actions:
- theme: brand
text: Get Started
@ -13,6 +13,9 @@ hero:
- theme: alt
text: API Reference
link: ./api/
image:
src: /mbcp-logo.svg
alt: MBCP logo
features:
- title: Easy to use

View File

@ -3,7 +3,7 @@
layout: home
hero:
name: "MBCP docs"
name: "MBCP"
text: "More basic change particle"
tagline: ジオメトリ演算とパーティクル作成のためのライブラリ
actions:
@ -13,6 +13,9 @@ hero:
- theme: alt
text: API リファレンス
link: ./api/
image:
src: /mbcp-logo.svg
alt: MBCP logo
features:
- title: 高可用性

View File

@ -0,0 +1,7 @@
<svg width="1000" height="1000" xmlns="http://www.w3.org/2000/svg">
<g id="Layer_1">
<title>Layer 1</title>
<ellipse stroke-width="0" stroke="#000" ry="436" rx="436" id="svg_1" cy="312" cx="690" fill="#d0e9ff"/>
<ellipse stroke-width="0" ry="270" rx="270" id="svg_2" cy="809" cx="191" stroke="#000" fill="#a2d8f4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 335 B

View File

@ -3,9 +3,9 @@
layout: home
hero:
name: "MBCP docs"
text: "More basic change particle"
tagline: 用于几何运算和粒子制作的库
name: "MBCP"
text: "更多基础变换粒子"
tagline: 用于几何运算和Minecraft粒子制作的库
actions:
- theme: brand
text: 快速开始
@ -13,6 +13,9 @@ hero:
- theme: alt
text: API文档
link: ./api/
image:
src: /mbcp-logo.svg
alt: MBCP logo
features:
- title: 高可用性

View File

@ -3,9 +3,9 @@
layout: home
hero:
name: "MBCP docs"
text: "More basic change particle"
tagline: 用於幾何運算和粒子製作的軟體庫
name: "MBCP"
text: "更多基礎變化粒子"
tagline: 用於幾何運算和 當個創世神 粒子製作的軟體庫
actions:
- theme: brand
text: 跟隨引導
@ -13,6 +13,9 @@ hero:
- theme: alt
text: API文檔
link: ./api/
image:
src: /mbcp-logo.svg
alt: MBCP logo
features:
- title: 高度易用
@ -22,3 +25,21 @@ features:
- title: 內置預設
details: 提供了大量的預設,包括常見的幾何圖形、粒子效果等,便於快速生產
---
<style>
:root {
--vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: -webkit-linear-gradient(120deg, #bd34fe 30%, #41d1ff);
}
@media (min-width: 640px) {
:root {
--vp-home-hero-image-filter: blur(56px);
}
}
@media (min-width: 960px) {
:root {
--vp-home-hero-image-filter: blur(68px);
}
}
</style>