mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Migrate documents
This commit is contained in:
parent
de3e21dd64
commit
e5529eead9
31 changed files with 14988 additions and 1 deletions
59
docs/.vuepress/config.ts
Normal file
59
docs/.vuepress/config.ts
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
import process from 'node:process'
|
||||
import { viteBundler } from '@vuepress/bundler-vite'
|
||||
import { webpackBundler } from '@vuepress/bundler-webpack'
|
||||
import { defineUserConfig } from '@vuepress/cli'
|
||||
// import { docsearchPlugin } from '@vuepress/plugin-docsearch'
|
||||
import { shikiPlugin } from '@vuepress/plugin-shiki'
|
||||
import { defaultTheme } from '@vuepress/theme-default'
|
||||
import { getDirname, path } from '@vuepress/utils'
|
||||
|
||||
import { head } from './configs/head.js'
|
||||
import { mainConfig, defaultThemeConfig } from './configs/locales_config.js'
|
||||
|
||||
const __dirname = getDirname(import.meta.url)
|
||||
const isProd = process.env.NODE_ENV === 'production'
|
||||
|
||||
export default defineUserConfig({
|
||||
// set site base to default value
|
||||
base: '/',
|
||||
|
||||
// extra tags in `<head>`
|
||||
head: head,
|
||||
|
||||
// site-level locales config
|
||||
locales: mainConfig,
|
||||
|
||||
// specify bundler via environment variable
|
||||
bundler: process.env.DOCS_BUNDLER === 'webpack' ? webpackBundler() : viteBundler(),
|
||||
|
||||
// configure default theme
|
||||
theme: defaultTheme({
|
||||
logo: "/images/MCC_logo.png",
|
||||
repo: "https://github.com/MCCTeam/Minecraft-Console-Client",
|
||||
docsDir: 'docs',
|
||||
|
||||
// theme-level locales config
|
||||
locales: defaultThemeConfig,
|
||||
|
||||
themePlugins: {
|
||||
// only enable git plugin in production mode
|
||||
git: isProd,
|
||||
// use shiki plugin in production mode instead
|
||||
prismjs: !isProd,
|
||||
},
|
||||
}),
|
||||
|
||||
// configure markdown
|
||||
markdown: {
|
||||
importCode: {
|
||||
handleImportPath: (str) =>
|
||||
str.replace(/^@vuepress/, path.resolve(__dirname, '../../ecosystem')),
|
||||
},
|
||||
},
|
||||
|
||||
// use plugins
|
||||
plugins: [
|
||||
// only enable shiki plugin in production mode
|
||||
isProd ? shikiPlugin({ theme: 'dark-plus' }) : [],
|
||||
],
|
||||
})
|
||||
74
docs/.vuepress/configs/gen_configs.py
Normal file
74
docs/.vuepress/configs/gen_configs.py
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
import os
|
||||
|
||||
print('Read ../translations/*.json')
|
||||
LanguageCodeList = [ code.replace('.json', '') for code in os.listdir('../translations/') ]
|
||||
|
||||
print('Read ./l10n_configs/config_templete.ts')
|
||||
templete = ""
|
||||
with open('./l10n_configs/config_templete.ts', 'r', encoding='utf-8') as file:
|
||||
templete = file.read()
|
||||
|
||||
for LanguageCode in LanguageCodeList:
|
||||
content = templete
|
||||
|
||||
content = content.replace("$LanguageCode$", LanguageCode, -1)
|
||||
|
||||
content = content.replace("$LanguageCodeEscaped$", LanguageCode.replace('-', '_', -1), -1)
|
||||
|
||||
if (LanguageCode == 'en'):
|
||||
content = content.replace("$PathToPage$", '', -1)
|
||||
else:
|
||||
content = content.replace("$PathToPage$", '/' + LanguageCode, -1)
|
||||
|
||||
print("Write ./l10n_configs/{}.ts".format(LanguageCode))
|
||||
|
||||
with open('./l10n_configs/{}.ts'.format(LanguageCode), 'w+', encoding='utf-8') as file:
|
||||
file.write('/* This file is automatically generated by "gen_configs.py" */\n')
|
||||
file.write(content)
|
||||
|
||||
print("Write ./locales_config.ts")
|
||||
|
||||
with open('./locales_config.ts', 'w+', encoding='utf-8') as file:
|
||||
file.write('/* This file is automatically generated by "gen_configs.py" */\n')
|
||||
file.write(r"import type { SiteLocaleConfig } from '@vuepress/shared'" + '\n')
|
||||
file.write(r"import type { LocaleConfig } from '@vuepress/shared'" + '\n')
|
||||
|
||||
file.write('\n')
|
||||
|
||||
for LanguageCode in LanguageCodeList:
|
||||
LanguageCodeEscaped = LanguageCode.replace('-', '_', -1)
|
||||
file.write(r"import { mainConfig_")
|
||||
file.write(LanguageCodeEscaped)
|
||||
file.write(r", defaultThemeConfig_")
|
||||
file.write(LanguageCodeEscaped)
|
||||
file.write(r" } from './l10n_configs/")
|
||||
file.write(LanguageCode)
|
||||
file.write(".js'\n")
|
||||
|
||||
file.write('\n')
|
||||
|
||||
file.write(r"export const mainConfig: SiteLocaleConfig = {" + '\n')
|
||||
for LanguageCode in LanguageCodeList:
|
||||
file.write(r" '")
|
||||
if (LanguageCode != 'en'):
|
||||
file.write(r"/")
|
||||
file.write(LanguageCode)
|
||||
file.write(r"/': mainConfig_")
|
||||
file.write(LanguageCode.replace('-', '_', -1))
|
||||
file.write(",\n")
|
||||
file.write(r"}" + '\n')
|
||||
|
||||
file.write('\n')
|
||||
|
||||
file.write(r"export const defaultThemeConfig: LocaleConfig = {" + '\n')
|
||||
for LanguageCode in LanguageCodeList:
|
||||
file.write(r" '")
|
||||
if (LanguageCode != 'en'):
|
||||
file.write(r"/")
|
||||
file.write(LanguageCode)
|
||||
file.write(r"/': defaultThemeConfig_")
|
||||
file.write(LanguageCode.replace('-', '_', -1))
|
||||
file.write(",\n")
|
||||
file.write(r"}" + '\n')
|
||||
|
||||
print("** Done! **")
|
||||
8
docs/.vuepress/configs/head.ts
Normal file
8
docs/.vuepress/configs/head.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import type { HeadConfig } from '@vuepress/core'
|
||||
|
||||
export const head: HeadConfig[] = [
|
||||
["meta", { name: "theme-color", content: "#3eaf7c" }],
|
||||
["meta", { name: "apple-mobile-web-app-capable", content: "yes" }],
|
||||
["meta", { name: "apple-mobile-web-app-status-bar-style", content: "black" }],
|
||||
["link", { rel: "icon", href: "../../favicon.ico" }],
|
||||
]
|
||||
74
docs/.vuepress/configs/l10n_configs/config_templete.ts
Normal file
74
docs/.vuepress/configs/l10n_configs/config_templete.ts
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
import type { SiteLocaleData } from '@vuepress/shared'
|
||||
import type { DefaultThemeLocaleData } from '@vuepress/theme-default'
|
||||
import { head } from '../head.js'
|
||||
|
||||
const Translation = require('../../translations/$LanguageCode$.json')
|
||||
|
||||
export const mainConfig_$LanguageCodeEscaped$: SiteLocaleData = {
|
||||
lang: '$LanguageCode$',
|
||||
title: Translation.title,
|
||||
description: Translation.description,
|
||||
head: head
|
||||
}
|
||||
|
||||
export const defaultThemeConfig_$LanguageCodeEscaped$: DefaultThemeLocaleData = {
|
||||
selectLanguageName: Translation.theme.selectLanguageName,
|
||||
selectLanguageText: Translation.theme.selectLanguageText,
|
||||
selectLanguageAriaLabel: Translation.theme.selectLanguageAriaLabel,
|
||||
|
||||
navbar: [
|
||||
{
|
||||
text: Translation.navbar.AboutAndFeatures,
|
||||
link: "$PathToPage$/guide/",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Installation,
|
||||
link: "$PathToPage$/guide/installation.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Usage,
|
||||
link: "$PathToPage$/guide/usage.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Configuration,
|
||||
link: "$PathToPage$/guide/configuration.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.ChatBots,
|
||||
link: "$PathToPage$/guide/chat-bots.md",
|
||||
},
|
||||
],
|
||||
|
||||
sidebar: [
|
||||
"$PathToPage$/guide/README.md",
|
||||
"$PathToPage$/guide/installation.md",
|
||||
"$PathToPage$/guide/usage.md",
|
||||
"$PathToPage$/guide/configuration.md",
|
||||
"$PathToPage$/guide/chat-bots.md",
|
||||
"$PathToPage$/guide/creating-bots.md",
|
||||
"$PathToPage$/guide/contibuting.md"
|
||||
],
|
||||
|
||||
// page meta
|
||||
editLinkText: Translation.theme.editLinkText,
|
||||
lastUpdatedText: Translation.theme.lastUpdatedText,
|
||||
contributorsText: Translation.theme.contributorsText,
|
||||
|
||||
// custom containers
|
||||
tip: Translation.theme.tip,
|
||||
warning: Translation.theme.warning,
|
||||
danger: Translation.theme.danger,
|
||||
|
||||
// 404 page
|
||||
notFound: Translation.theme.notFound,
|
||||
backToHome: Translation.theme.backToHome,
|
||||
|
||||
// a11y
|
||||
openInNewWindow: Translation.theme.openInNewWindow,
|
||||
toggleColorMode: Translation.theme.toggleColorMode,
|
||||
toggleSidebar: Translation.theme.toggleSidebar,
|
||||
}
|
||||
75
docs/.vuepress/configs/l10n_configs/en.ts
Normal file
75
docs/.vuepress/configs/l10n_configs/en.ts
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
/* This file is automatically generated by "gen_configs.py" */
|
||||
import type { SiteLocaleData } from '@vuepress/shared'
|
||||
import type { DefaultThemeLocaleData } from '@vuepress/theme-default'
|
||||
import { head } from '../head.js'
|
||||
|
||||
const Translation = require('../../translations/en.json')
|
||||
|
||||
export const mainConfig_en: SiteLocaleData = {
|
||||
lang: 'en',
|
||||
title: Translation.title,
|
||||
description: Translation.description,
|
||||
head: head
|
||||
}
|
||||
|
||||
export const defaultThemeConfig_en: DefaultThemeLocaleData = {
|
||||
selectLanguageName: Translation.theme.selectLanguageName,
|
||||
selectLanguageText: Translation.theme.selectLanguageText,
|
||||
selectLanguageAriaLabel: Translation.theme.selectLanguageAriaLabel,
|
||||
|
||||
navbar: [
|
||||
{
|
||||
text: Translation.navbar.AboutAndFeatures,
|
||||
link: "/guide/",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Installation,
|
||||
link: "/guide/installation.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Usage,
|
||||
link: "/guide/usage.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Configuration,
|
||||
link: "/guide/configuration.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.ChatBots,
|
||||
link: "/guide/chat-bots.md",
|
||||
},
|
||||
],
|
||||
|
||||
sidebar: [
|
||||
"/guide/README.md",
|
||||
"/guide/installation.md",
|
||||
"/guide/usage.md",
|
||||
"/guide/configuration.md",
|
||||
"/guide/chat-bots.md",
|
||||
"/guide/creating-bots.md",
|
||||
"/guide/contibuting.md"
|
||||
],
|
||||
|
||||
// page meta
|
||||
editLinkText: Translation.theme.editLinkText,
|
||||
lastUpdatedText: Translation.theme.lastUpdatedText,
|
||||
contributorsText: Translation.theme.contributorsText,
|
||||
|
||||
// custom containers
|
||||
tip: Translation.theme.tip,
|
||||
warning: Translation.theme.warning,
|
||||
danger: Translation.theme.danger,
|
||||
|
||||
// 404 page
|
||||
notFound: Translation.theme.notFound,
|
||||
backToHome: Translation.theme.backToHome,
|
||||
|
||||
// a11y
|
||||
openInNewWindow: Translation.theme.openInNewWindow,
|
||||
toggleColorMode: Translation.theme.toggleColorMode,
|
||||
toggleSidebar: Translation.theme.toggleSidebar,
|
||||
}
|
||||
75
docs/.vuepress/configs/l10n_configs/zh-Hans.ts
Normal file
75
docs/.vuepress/configs/l10n_configs/zh-Hans.ts
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
/* This file is automatically generated by "gen_configs.py" */
|
||||
import type { SiteLocaleData } from '@vuepress/shared'
|
||||
import type { DefaultThemeLocaleData } from '@vuepress/theme-default'
|
||||
import { head } from '../head.js'
|
||||
|
||||
const Translation = require('../../translations/zh-Hans.json')
|
||||
|
||||
export const mainConfig_zh_Hans: SiteLocaleData = {
|
||||
lang: 'zh-Hans',
|
||||
title: Translation.title,
|
||||
description: Translation.description,
|
||||
head: head
|
||||
}
|
||||
|
||||
export const defaultThemeConfig_zh_Hans: DefaultThemeLocaleData = {
|
||||
selectLanguageName: Translation.theme.selectLanguageName,
|
||||
selectLanguageText: Translation.theme.selectLanguageText,
|
||||
selectLanguageAriaLabel: Translation.theme.selectLanguageAriaLabel,
|
||||
|
||||
navbar: [
|
||||
{
|
||||
text: Translation.navbar.AboutAndFeatures,
|
||||
link: "/zh-Hans/guide/",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Installation,
|
||||
link: "/zh-Hans/guide/installation.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Usage,
|
||||
link: "/zh-Hans/guide/usage.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Configuration,
|
||||
link: "/zh-Hans/guide/configuration.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.ChatBots,
|
||||
link: "/zh-Hans/guide/chat-bots.md",
|
||||
},
|
||||
],
|
||||
|
||||
sidebar: [
|
||||
"/zh-Hans/guide/README.md",
|
||||
"/zh-Hans/guide/installation.md",
|
||||
"/zh-Hans/guide/usage.md",
|
||||
"/zh-Hans/guide/configuration.md",
|
||||
"/zh-Hans/guide/chat-bots.md",
|
||||
"/zh-Hans/guide/creating-bots.md",
|
||||
"/zh-Hans/guide/contibuting.md"
|
||||
],
|
||||
|
||||
// page meta
|
||||
editLinkText: Translation.theme.editLinkText,
|
||||
lastUpdatedText: Translation.theme.lastUpdatedText,
|
||||
contributorsText: Translation.theme.contributorsText,
|
||||
|
||||
// custom containers
|
||||
tip: Translation.theme.tip,
|
||||
warning: Translation.theme.warning,
|
||||
danger: Translation.theme.danger,
|
||||
|
||||
// 404 page
|
||||
notFound: Translation.theme.notFound,
|
||||
backToHome: Translation.theme.backToHome,
|
||||
|
||||
// a11y
|
||||
openInNewWindow: Translation.theme.openInNewWindow,
|
||||
toggleColorMode: Translation.theme.toggleColorMode,
|
||||
toggleSidebar: Translation.theme.toggleSidebar,
|
||||
}
|
||||
16
docs/.vuepress/configs/locales_config.ts
Normal file
16
docs/.vuepress/configs/locales_config.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/* This file is automatically generated by "gen_configs.py" */
|
||||
import type { SiteLocaleConfig } from '@vuepress/shared'
|
||||
import type { LocaleConfig } from '@vuepress/shared'
|
||||
|
||||
import { mainConfig_en, defaultThemeConfig_en } from './l10n_configs/en.js'
|
||||
import { mainConfig_zh_Hans, defaultThemeConfig_zh_Hans } from './l10n_configs/zh-Hans.js'
|
||||
|
||||
export const mainConfig: SiteLocaleConfig = {
|
||||
'/': mainConfig_en,
|
||||
'/zh-Hans/': mainConfig_zh_Hans,
|
||||
}
|
||||
|
||||
export const defaultThemeConfig: LocaleConfig = {
|
||||
'/': defaultThemeConfig_en,
|
||||
'/zh-Hans/': defaultThemeConfig_zh_Hans,
|
||||
}
|
||||
BIN
docs/.vuepress/public/favicon.ico
Normal file
BIN
docs/.vuepress/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
docs/.vuepress/public/images/MCC_logo.png
Normal file
BIN
docs/.vuepress/public/images/MCC_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
BIN
docs/.vuepress/public/images/MCC_logo_with_edge.png
Normal file
BIN
docs/.vuepress/public/images/MCC_logo_with_edge.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
32
docs/.vuepress/translations/en.json
Normal file
32
docs/.vuepress/translations/en.json
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"title": "Minecraft Console Client",
|
||||
"description": "Documentation website for the Minecraft Console Client (MCC)",
|
||||
"theme":{
|
||||
"selectLanguageName": "English",
|
||||
"selectLanguageText": "Languages",
|
||||
"selectLanguageAriaLabel": "Select language",
|
||||
"editLinkText": "Edit this page",
|
||||
"lastUpdatedText": "Last Updated",
|
||||
"contributorsText": "Contributors",
|
||||
"tip": "tip",
|
||||
"warning": "warning",
|
||||
"danger": "danger",
|
||||
"notFound": [
|
||||
"There's nothing here.",
|
||||
"How did we get here?",
|
||||
"That's a Four-Oh-Four.",
|
||||
"Looks like we've got some broken links."
|
||||
],
|
||||
"backToHome": "Take me home",
|
||||
"openInNewWindow": "open in new window",
|
||||
"toggleColorMode": "toggle color mode",
|
||||
"toggleSidebar": "toggle sidebar"
|
||||
},
|
||||
"navbar": {
|
||||
"AboutAndFeatures": "About & Features",
|
||||
"Installation": "Installation",
|
||||
"Usage": "Usage",
|
||||
"Configuration": "Configuration",
|
||||
"ChatBots": "ChatBots"
|
||||
}
|
||||
}
|
||||
32
docs/.vuepress/translations/zh-Hans.json
Normal file
32
docs/.vuepress/translations/zh-Hans.json
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"title": "Minecraft命令行客户端",
|
||||
"description": "Minecraft Console Client (MCC) 文档站点",
|
||||
"theme":{
|
||||
"selectLanguageName": "简体中文",
|
||||
"selectLanguageText": "选择语言",
|
||||
"selectLanguageAriaLabel": "选择语言",
|
||||
"editLinkText": "在 GitHub 上编辑此页",
|
||||
"lastUpdatedText": "上次更新",
|
||||
"contributorsText": "贡献者",
|
||||
"tip": "提示",
|
||||
"warning": "注意",
|
||||
"danger": "警告",
|
||||
"notFound": [
|
||||
"这里什么都没有",
|
||||
"我们怎么到这来了?",
|
||||
"这是一个 404 页面",
|
||||
"看起来我们进入了错误的链接"
|
||||
],
|
||||
"backToHome": "返回首页",
|
||||
"openInNewWindow": "在新窗口打开",
|
||||
"toggleColorMode": "切换颜色模式",
|
||||
"toggleSidebar": "切换侧边栏"
|
||||
},
|
||||
"navbar": {
|
||||
"AboutAndFeatures": "关于 & 特性",
|
||||
"Installation": "安装",
|
||||
"Usage": "使用方法",
|
||||
"Configuration": "配置",
|
||||
"ChatBots": "ChatBots"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue