mirror of
https://github.com/HighCapable/YukiReflection.git
synced 2025-12-17 00:31:14 +08:00
Initial commit
This commit is contained in:
60
docs-source/src/.vuepress/config.ts
Normal file
60
docs-source/src/.vuepress/config.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import { defaultTheme } from 'vuepress';
|
||||
import { shikiPlugin } from '@vuepress/plugin-shiki';
|
||||
import { searchPlugin } from '@vuepress/plugin-search';
|
||||
import { navBarItems, sideBarItems, configs } from './configs/template';
|
||||
|
||||
export default {
|
||||
dest: configs.dev.dest,
|
||||
port: configs.dev.port,
|
||||
base: configs.website.base,
|
||||
head: [['link', { rel: 'icon', href: configs.website.icon }]],
|
||||
title: configs.website.title,
|
||||
description: configs.website.locales['/en/'].description,
|
||||
locales: configs.website.locales,
|
||||
theme: defaultTheme({
|
||||
logo: configs.website.logo,
|
||||
repo: configs.github.repo,
|
||||
docsRepo: configs.github.repo,
|
||||
docsBranch: configs.github.branch,
|
||||
docsDir: configs.github.dir,
|
||||
editLinkPattern: ':repo/edit/:branch/:path',
|
||||
sidebar: sideBarItems,
|
||||
sidebarDepth: 2,
|
||||
locales: {
|
||||
'/en/': {
|
||||
navbar: navBarItems['/en/'],
|
||||
selectLanguageText: 'English (US)',
|
||||
selectLanguageName: 'English',
|
||||
editLinkText: 'Edit this page on Github',
|
||||
tip: 'Tips',
|
||||
warning: 'Notice',
|
||||
danger: 'Pay Attention',
|
||||
},
|
||||
'/zh-cn/': {
|
||||
navbar: navBarItems['/zh-cn/'],
|
||||
selectLanguageText: '简体中文 (CN)',
|
||||
selectLanguageName: '简体中文',
|
||||
editLinkText: '在 Github 上编辑此页',
|
||||
notFound: ['这里什么都没有', '我们怎么到这来了?', '这是一个 404 页面', '看起来我们进入了错误的链接'],
|
||||
backToHome: '回到首页',
|
||||
contributorsText: '贡献者',
|
||||
lastUpdatedText: '上次更新',
|
||||
tip: '小提示',
|
||||
warning: '注意',
|
||||
danger: '特别注意',
|
||||
openInNewWindow: '在新窗口中打开',
|
||||
toggleColorMode: '切换颜色模式'
|
||||
}
|
||||
},
|
||||
}),
|
||||
plugins: [
|
||||
shikiPlugin({ theme: 'github-dark-dimmed' }),
|
||||
searchPlugin({
|
||||
isSearchable: (page) => page.path !== '/',
|
||||
locales: {
|
||||
'/en/': { placeholder: 'Search' },
|
||||
'/zh-cn/': { placeholder: '搜索' }
|
||||
}
|
||||
})
|
||||
]
|
||||
};
|
||||
201
docs-source/src/.vuepress/configs/template.ts
Normal file
201
docs-source/src/.vuepress/configs/template.ts
Normal file
@@ -0,0 +1,201 @@
|
||||
import { i18n } from './utils';
|
||||
|
||||
const baseApiPath = '/api/public/com/highcapable/yukireflection/';
|
||||
|
||||
const navigationLinks = {
|
||||
start: [
|
||||
'/guide/home',
|
||||
'/guide/quick-start'
|
||||
],
|
||||
config: [
|
||||
'/config/api-example',
|
||||
'/config/api-exception'
|
||||
],
|
||||
apiDocs: [
|
||||
'/api/home',
|
||||
'/api/public/',
|
||||
'/api/features'
|
||||
],
|
||||
publicApi: [
|
||||
baseApiPath + 'YukiReflection',
|
||||
baseApiPath + 'type/android/ComponentTypeFactory',
|
||||
baseApiPath + 'type/android/GraphicsTypeFactory',
|
||||
baseApiPath + 'type/android/ViewTypeFactory',
|
||||
baseApiPath + 'type/java/VariableTypeFactory',
|
||||
baseApiPath + 'type/defined/DefinedTypeFactory',
|
||||
baseApiPath + 'factory/ReflectionFactory',
|
||||
baseApiPath + 'finder/members/MethodFinder',
|
||||
baseApiPath + 'finder/members/ConstructorFinder',
|
||||
baseApiPath + 'finder/members/FieldFinder',
|
||||
baseApiPath + 'finder/classes/DexClassFinder',
|
||||
baseApiPath + 'finder/classes/rules/result/MemberRulesResult',
|
||||
baseApiPath + 'finder/classes/rules/MemberRules',
|
||||
baseApiPath + 'finder/classes/rules/FieldRules',
|
||||
baseApiPath + 'finder/classes/rules/MethodRules',
|
||||
baseApiPath + 'finder/classes/rules/ConstructorRules',
|
||||
baseApiPath + 'finder/base/BaseFinder',
|
||||
baseApiPath + 'finder/base/rules/CountRules',
|
||||
baseApiPath + 'finder/base/rules/ModifierRules',
|
||||
baseApiPath + 'finder/base/rules/NameRules',
|
||||
baseApiPath + 'finder/base/rules/ObjectRules',
|
||||
baseApiPath + 'bean/VariousClass',
|
||||
baseApiPath + 'bean/CurrentClass',
|
||||
baseApiPath + 'bean/GenericClass'
|
||||
],
|
||||
about: [
|
||||
'/about/changelog',
|
||||
'/about/future',
|
||||
'/about/contacts',
|
||||
'/about/about'
|
||||
]
|
||||
};
|
||||
|
||||
export const configs = {
|
||||
dev: {
|
||||
dest: '../docs/',
|
||||
port: 9000
|
||||
},
|
||||
website: {
|
||||
base: '/YukiReflection/',
|
||||
icon: '/YukiReflection/images/logo.png',
|
||||
logo: '/images/logo.png',
|
||||
title: 'Yuki Reflection',
|
||||
locales: {
|
||||
'/en/': {
|
||||
lang: 'en-US',
|
||||
description: 'An efficient Reflection API for the Android platform built in Kotlin'
|
||||
},
|
||||
'/zh-cn/': {
|
||||
lang: 'zh-CN',
|
||||
description: '一个使用 Kotlin 构建的 Android 平台高效反射 API'
|
||||
}
|
||||
}
|
||||
},
|
||||
github: {
|
||||
repo: 'https://github.com/fankes/YukiReflection',
|
||||
branch: 'master',
|
||||
dir: 'docs-source/src'
|
||||
}
|
||||
};
|
||||
|
||||
export const navBarItems = {
|
||||
'/en/': [{
|
||||
text: 'Navigation',
|
||||
children: [{
|
||||
text: 'Get Started',
|
||||
children: [
|
||||
{ text: 'Introduce', link: i18n.string(navigationLinks.start[0], 'en') },
|
||||
{ text: 'Quick Start', link: i18n.string(navigationLinks.start[1], 'en') }
|
||||
]
|
||||
}, {
|
||||
text: 'Configs',
|
||||
children: [
|
||||
{ text: 'API Basic Configs', link: i18n.string(navigationLinks.config[0], 'en') },
|
||||
{ text: 'API Exception Handling', link: i18n.string(navigationLinks.config[1], 'en') }
|
||||
]
|
||||
}, {
|
||||
text: 'API Document',
|
||||
children: [{ text: 'Document Introduction', link: i18n.string(navigationLinks.apiDocs[0], 'en') }, {
|
||||
text: 'Public API',
|
||||
link: i18n.string(navigationLinks.publicApi[0], 'en'),
|
||||
activeMatch: i18n.string(navigationLinks.apiDocs[1], 'en')
|
||||
}, {
|
||||
text: 'Features',
|
||||
link: i18n.string(navigationLinks.apiDocs[2], 'en')
|
||||
}]
|
||||
}, {
|
||||
text: 'About',
|
||||
children: [
|
||||
{ text: 'Changelog', link: i18n.string(navigationLinks.about[0], 'en') },
|
||||
{ text: 'Looking for Future', link: i18n.string(navigationLinks.about[1], 'en') },
|
||||
{ text: 'Contact Us', link: i18n.string(navigationLinks.about[2], 'en') },
|
||||
{ text: 'About this Document', link: i18n.string(navigationLinks.about[3], 'en') }
|
||||
]
|
||||
}]
|
||||
}, {
|
||||
text: 'Contact Us',
|
||||
link: i18n.string(navigationLinks.about[2], 'en')
|
||||
}],
|
||||
'/zh-cn/': [{
|
||||
text: '导航',
|
||||
children: [{
|
||||
text: '入门',
|
||||
children: [
|
||||
{ text: '介绍', link: i18n.string(navigationLinks.start[0], 'zh-cn') },
|
||||
{ text: '快速开始', link: i18n.string(navigationLinks.start[1], 'zh-cn') }
|
||||
]
|
||||
}, {
|
||||
text: '配置',
|
||||
children: [
|
||||
{ text: 'API 基本配置', link: i18n.string(navigationLinks.config[0], 'zh-cn') },
|
||||
{ text: 'API 异常处理', link: i18n.string(navigationLinks.config[1], 'zh-cn') }
|
||||
]
|
||||
}, {
|
||||
text: 'API 文档',
|
||||
children: [{ text: '文档介绍', link: i18n.string(navigationLinks.apiDocs[0], 'zh-cn') }, {
|
||||
text: 'Public API',
|
||||
link: i18n.string(navigationLinks.publicApi[0], 'zh-cn'),
|
||||
activeMatch: i18n.string(navigationLinks.apiDocs[1], 'zh-cn')
|
||||
}, {
|
||||
text: '功能介绍',
|
||||
link: i18n.string(navigationLinks.apiDocs[2], 'zh-cn')
|
||||
}]
|
||||
}, {
|
||||
text: '关于',
|
||||
children: [
|
||||
{ text: '更新日志', link: i18n.string(navigationLinks.about[0], 'zh-cn') },
|
||||
{ text: '展望未来', link: i18n.string(navigationLinks.about[1], 'zh-cn') },
|
||||
{ text: '联系我们', link: i18n.string(navigationLinks.about[2], 'zh-cn') },
|
||||
{ text: '关于此文档', link: i18n.string(navigationLinks.about[3], 'zh-cn') }
|
||||
]
|
||||
}]
|
||||
}, {
|
||||
text: '联系我们',
|
||||
link: i18n.string(navigationLinks.about[2], 'zh-cn')
|
||||
}]
|
||||
};
|
||||
|
||||
export const sideBarItems = {
|
||||
'/en/': [{
|
||||
text: 'Get Started',
|
||||
collapsible: true,
|
||||
children: i18n.array(navigationLinks.start, 'en')
|
||||
}, {
|
||||
text: 'Configs',
|
||||
collapsible: true,
|
||||
children: i18n.array(navigationLinks.config, 'en')
|
||||
}, {
|
||||
text: 'API Document',
|
||||
collapsible: true,
|
||||
children: [i18n.string(navigationLinks.apiDocs[0], 'en'), {
|
||||
text: 'Public API' + i18n.space,
|
||||
collapsible: true,
|
||||
children: i18n.array(navigationLinks.publicApi, 'en')
|
||||
}, i18n.string(navigationLinks.apiDocs[2], 'en')]
|
||||
}, {
|
||||
text: 'About',
|
||||
collapsible: true,
|
||||
children: i18n.array(navigationLinks.about, 'en')
|
||||
}],
|
||||
'/zh-cn/': [{
|
||||
text: '入门',
|
||||
collapsible: true,
|
||||
children: i18n.array(navigationLinks.start, 'zh-cn')
|
||||
}, {
|
||||
text: '配置',
|
||||
collapsible: true,
|
||||
children: i18n.array(navigationLinks.config, 'zh-cn')
|
||||
}, {
|
||||
text: 'API 文档',
|
||||
collapsible: true,
|
||||
children: [i18n.string(navigationLinks.apiDocs[0], 'zh-cn'), {
|
||||
text: 'Public API' + i18n.space,
|
||||
collapsible: true,
|
||||
children: i18n.array(navigationLinks.publicApi, 'zh-cn')
|
||||
}, i18n.string(navigationLinks.apiDocs[2], 'zh-cn')]
|
||||
}, {
|
||||
text: '关于',
|
||||
collapsible: true,
|
||||
children: i18n.array(navigationLinks.about, 'zh-cn')
|
||||
}]
|
||||
};
|
||||
13
docs-source/src/.vuepress/configs/utils.ts
Normal file
13
docs-source/src/.vuepress/configs/utils.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export const i18n = {
|
||||
space: ' ',
|
||||
string: (content: string, locale: string) => {
|
||||
return '/' + locale + content;
|
||||
},
|
||||
array: (contents: string[], locale: string) => {
|
||||
const newContents: string[] = [];
|
||||
contents.forEach((content) => {
|
||||
newContents.push(i18n.string(content, locale));
|
||||
});
|
||||
return newContents;
|
||||
}
|
||||
};
|
||||
BIN
docs-source/src/.vuepress/public/images/logo.png
Normal file
BIN
docs-source/src/.vuepress/public/images/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
179
docs-source/src/.vuepress/styles/index.scss
Normal file
179
docs-source/src/.vuepress/styles/index.scss
Normal file
@@ -0,0 +1,179 @@
|
||||
$primary-color: rgb(49, 164, 255);
|
||||
$accent-color: rgb(129, 189, 249);
|
||||
$content-width: 965px;
|
||||
$scroll-bar-width: 8px;
|
||||
$scroll-bar-height: 6.5px;
|
||||
$scroll-bar-border-radius: 50px;
|
||||
$scroll-bar-track-color-code: rgb(86, 96, 110);
|
||||
$scroll-bar-thumb-hover-color-code: rgb(121, 135, 155);
|
||||
|
||||
:root {
|
||||
--c-brand: #{$primary-color};
|
||||
--c-brand-light: #{$accent-color};
|
||||
--content-width: #{$content-width};
|
||||
}
|
||||
|
||||
code {
|
||||
padding: 3px 5px 3px 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.badge {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.custom-container {
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.sidebar-item {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.language-text {
|
||||
::-webkit-scrollbar-track {
|
||||
background: #{$scroll-bar-track-color-code};
|
||||
border-radius: #{$scroll-bar-border-radius};
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #{$scroll-bar-thumb-hover-color-code};
|
||||
}
|
||||
}
|
||||
|
||||
.language-kotlin {
|
||||
::-webkit-scrollbar-track {
|
||||
background: #{$scroll-bar-track-color-code};
|
||||
border-radius: #{$scroll-bar-border-radius};
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #{$scroll-bar-thumb-hover-color-code};
|
||||
}
|
||||
}
|
||||
|
||||
.language-java {
|
||||
::-webkit-scrollbar-track {
|
||||
background: #{$scroll-bar-track-color-code};
|
||||
border-radius: #{$scroll-bar-border-radius};
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #{$scroll-bar-thumb-hover-color-code};
|
||||
}
|
||||
}
|
||||
|
||||
.language-groovy {
|
||||
::-webkit-scrollbar-track {
|
||||
background: #{$scroll-bar-track-color-code};
|
||||
border-radius: #{$scroll-bar-border-radius};
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #{$scroll-bar-thumb-hover-color-code};
|
||||
}
|
||||
}
|
||||
|
||||
.language-xml {
|
||||
::-webkit-scrollbar-track {
|
||||
background: #{$scroll-bar-track-color-code};
|
||||
border-radius: #{$scroll-bar-border-radius};
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #{$scroll-bar-thumb-hover-color-code};
|
||||
}
|
||||
}
|
||||
|
||||
.hidden-anchor-page {
|
||||
h6 {
|
||||
color: transparent;
|
||||
margin-bottom: -35px;
|
||||
padding-top: 50px;
|
||||
}
|
||||
}
|
||||
|
||||
.code-page {
|
||||
h1 {
|
||||
font-size: 24pt;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 18pt;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 15pt;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 12pt;
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 9.6pt;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 8.4pt;
|
||||
}
|
||||
|
||||
.symbol {
|
||||
color: rgb(142, 155, 168);
|
||||
}
|
||||
|
||||
.deprecated {
|
||||
color: rgb(142, 155, 168);
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: #{$scroll-bar-width};
|
||||
height: #{$scroll-bar-height};
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: rgb(234, 236, 239);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: rgb(189, 189, 189);
|
||||
border-radius: #{$scroll-bar-border-radius};
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: rgb(133, 133, 133);
|
||||
border-radius: #{$scroll-bar-border-radius};
|
||||
}
|
||||
}
|
||||
|
||||
html.dark {
|
||||
--c-brand: #{$primary-color};
|
||||
--c-brand-light: #{$accent-color};
|
||||
--content-width: #{$content-width};
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: #{$scroll-bar-width};
|
||||
height: #{$scroll-bar-height};
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: rgb(41, 46, 53);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: rgb(65, 72, 83);
|
||||
border-radius: #{$scroll-bar-border-radius};
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: rgb(56, 62, 72);
|
||||
border-radius: #{$scroll-bar-border-radius};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user