-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️[docs] Begins move of documentation to vitepress.
New documentation resides in . After full transfer, new documentation will be placed in and buildscripts will be adapted.
- Loading branch information
Showing
23 changed files
with
1,977 additions
and
5 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"beta":"4.7.12+20240313.0709","stable":"4.7.12+20240308.1952","short":"4.7.12"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
|
||
import { defineConfig } from 'vitepress' | ||
|
||
import childProcess from './utils/childProcess'; | ||
import config from '../../src/config'; | ||
import getConstants from './utils/getConstants'; | ||
import i18n from './utils/i18n'; | ||
import localeConfig, { | ||
type LocaleSiteConfig, | ||
type LocaleThemeConfig, | ||
} from './utils/localeConfig'; | ||
|
||
import type { Versions } from './utils/generate/versions'; | ||
|
||
const { | ||
DOCS_URL, | ||
BASE, | ||
VITEPRESS_PATH, | ||
ROOT_PATH, | ||
MODULES_PATH, | ||
DIST_PATH, | ||
DOCS_PATH, | ||
DOCS_DIST_PATH, | ||
DOCS_TEMP_PATH, | ||
DOCS_I18N_PATH, | ||
DOCS_UTILS_PATH, | ||
DOCS_COMPONENTS_PATH, | ||
LANGS, | ||
MODULES, | ||
} = getConstants(); | ||
|
||
const { run } = childProcess(DOCS_UTILS_PATH); | ||
|
||
const sidebar_lssm = ['', 'metadata']; | ||
const sidebar_others = [ | ||
'suggestions', | ||
'support', | ||
'error_report', | ||
'faq', | ||
'bugs', | ||
'appstore', | ||
'settings', | ||
'other', | ||
]; | ||
|
||
// Generate versions | ||
|
||
const versionsFile = path.join(DOCS_TEMP_PATH, '.versions.json'); | ||
run('generate/versions', versionsFile); | ||
const versions: Versions = JSON.parse(fs.readFileSync(versionsFile).toString()); | ||
|
||
|
||
// Generate modules | ||
|
||
const modulesFile = path.join(DOCS_TEMP_PATH, '.modules.json'); | ||
run( | ||
'generate/modules', | ||
modulesFile, | ||
MODULES_PATH, | ||
DOCS_PATH, | ||
JSON.stringify(LANGS), | ||
JSON.stringify(MODULES) | ||
); | ||
|
||
// Generate i18n | ||
|
||
const $t = i18n(DOCS_I18N_PATH); | ||
const getLocaleConfig = localeConfig( | ||
$t, | ||
sidebar_lssm, | ||
sidebar_others, | ||
JSON.parse(fs.readFileSync(modulesFile).toString()), | ||
DOCS_PATH | ||
); | ||
|
||
const localeConfigs: { | ||
siteConfigs: Record<`/${string}/`, LocaleSiteConfig>; | ||
themeConfigs: Record<`/${string}/`, LocaleThemeConfig>; | ||
searchConfigs: Record<`/${string}/`, { placeholder: string }>; | ||
pwaPopupConfigs: Record< | ||
`/${string}/`, | ||
{ message: string; buttonText: string } | ||
>; | ||
} = { | ||
siteConfigs: {}, | ||
themeConfigs: {}, | ||
searchConfigs: {}, | ||
pwaPopupConfigs: {}, | ||
}; | ||
|
||
LANGS.forEach(lang => { | ||
const { siteConfig, themeConfig, searchPlaceholder, pwaPopupConfig } = | ||
getLocaleConfig(lang); | ||
localeConfigs.siteConfigs[`${lang}`] = siteConfig; | ||
localeConfigs.themeConfigs[`/${lang}/`] = themeConfig; | ||
localeConfigs.searchConfigs[`/${lang}/`] = { | ||
placeholder: searchPlaceholder, | ||
}; | ||
localeConfigs.pwaPopupConfigs[`/${lang}/`] = pwaPopupConfig; | ||
}); | ||
localeConfigs.siteConfigs['root'] = localeConfigs.siteConfigs['en_US']; | ||
console.log(localeConfigs.siteConfigs); | ||
|
||
// https://vitepress.dev/reference/site-config | ||
export default defineConfig({ | ||
title: "LSS-Manager V.4 Wiki", | ||
description: "The Wiki for LSS-Manager V.4", | ||
themeConfig: { | ||
// https://vitepress.dev/reference/default-theme-config | ||
nav: [ | ||
{ text: 'Home', link: '/' }, | ||
{ text: 'Examples', link: '/markdown-examples' }, | ||
{ text: `v${versions.short}`, link: `https://github.com/${config.github.repo}/releases/tag/v${versions.short}` } | ||
], | ||
|
||
sidebar: [ | ||
{ | ||
text: 'Examples', | ||
items: [ | ||
{ text: 'Markdown Examples', link: '/markdown-examples' }, | ||
{ text: 'Runtime API Examples', link: '/api-examples' } | ||
] | ||
} | ||
], | ||
|
||
socialLinks: [ | ||
{ icon: 'github', link: `https://github.com/${config.github.repo}` }, | ||
{ icon: 'discord', link: `https://discord.gg/${config.discord.invite}` } | ||
] | ||
}, | ||
locales: localeConfigs.siteConfigs | ||
}) |
Oops, something went wrong.