diff options
| -rw-r--r-- | doc/docs/.vitepress/config.mts | 24 | ||||
| -rwxr-xr-x | doc/docs/.vitepress/theme/components/YueCompiler.vue | 3 | ||||
| -rw-r--r-- | doc/docs/.vitepress/theme/custom.css | 101 | ||||
| -rw-r--r-- | doc/docs/doc/licence-mit.md | 2 | ||||
| -rw-r--r-- | doc/docs/index.md | 2 | ||||
| -rw-r--r-- | doc/docs/zh/index.md | 2 | ||||
| -rwxr-xr-x | doc/package.json | 3 |
7 files changed, 120 insertions, 17 deletions
diff --git a/doc/docs/.vitepress/config.mts b/doc/docs/.vitepress/config.mts index 103dfc9..c672c7a 100644 --- a/doc/docs/.vitepress/config.mts +++ b/doc/docs/.vitepress/config.mts | |||
| @@ -1,9 +1,13 @@ | |||
| 1 | import { defineConfig } from 'vitepress' | 1 | import { readFileSync } from 'fs'; |
| 2 | import { resolve, dirname } from 'path' | 2 | import { |
| 3 | import { readFileSync } from 'fs' | 3 | dirname, |
| 4 | import { fileURLToPath } from 'url' | 4 | resolve, |
| 5 | import lightPlus from '@shikijs/themes/light-plus' | 5 | } from 'path'; |
| 6 | import darkPlus from '@shikijs/themes/dark-plus' | 6 | import { fileURLToPath } from 'url'; |
| 7 | import { defineConfig } from 'vitepress'; | ||
| 8 | |||
| 9 | import darkPlus from '@shikijs/themes/dark-plus'; | ||
| 10 | import lightPlus from '@shikijs/themes/light-plus'; | ||
| 7 | 11 | ||
| 8 | const __dirname = dirname(fileURLToPath(import.meta.url)) | 12 | const __dirname = dirname(fileURLToPath(import.meta.url)) |
| 9 | const moonscriptGrammarPath = resolve(__dirname, 'grammars/moonscript.tmLanguage.json') | 13 | const moonscriptGrammarPath = resolve(__dirname, 'grammars/moonscript.tmLanguage.json') |
| @@ -143,8 +147,8 @@ function createSidebar(basePath: string, zh: boolean) { | |||
| 143 | link: `${basePath}/the-yuescript-library`, | 147 | link: `${basePath}/the-yuescript-library`, |
| 144 | }, | 148 | }, |
| 145 | { | 149 | { |
| 146 | text: zh ? 'MIT 许可证' : 'Licence: MIT', | 150 | text: zh ? 'MIT 许可证' : 'License: MIT', |
| 147 | link: `${basePath}/licence-mit`, | 151 | link: `${basePath}/license-mit`, |
| 148 | }, | 152 | }, |
| 149 | ] | 153 | ] |
| 150 | } | 154 | } |
| @@ -217,7 +221,7 @@ export default defineConfig({ | |||
| 217 | nav: [ | 221 | nav: [ |
| 218 | { text: 'Document', link: '/doc/' }, | 222 | { text: 'Document', link: '/doc/' }, |
| 219 | { text: 'Try yue!', link: '/try/' }, | 223 | { text: 'Try yue!', link: '/try/' }, |
| 220 | { text: 'Github', link: 'https://github.com/IppClub/Yuescript' } | 224 | { text: 'GitHub', link: 'https://github.com/IppClub/Yuescript' } |
| 221 | ], | 225 | ], |
| 222 | sidebar: createSidebar('/doc', false), | 226 | sidebar: createSidebar('/doc', false), |
| 223 | } | 227 | } |
| @@ -230,7 +234,7 @@ export default defineConfig({ | |||
| 230 | nav: [ | 234 | nav: [ |
| 231 | { text: '文档', link: '/zh/doc/' }, | 235 | { text: '文档', link: '/zh/doc/' }, |
| 232 | { text: '试一试!', link: '/zh/try/' }, | 236 | { text: '试一试!', link: '/zh/try/' }, |
| 233 | { text: 'Github', link: 'https://github.com/IppClub/Yuescript' } | 237 | { text: 'GitHub', link: 'https://github.com/IppClub/Yuescript' } |
| 234 | ], | 238 | ], |
| 235 | sidebar: createSidebar('/zh/doc', true), | 239 | sidebar: createSidebar('/zh/doc', true), |
| 236 | } | 240 | } |
diff --git a/doc/docs/.vitepress/theme/components/YueCompiler.vue b/doc/docs/.vitepress/theme/components/YueCompiler.vue index 13a5524..0b7a530 100755 --- a/doc/docs/.vitepress/theme/components/YueCompiler.vue +++ b/doc/docs/.vitepress/theme/components/YueCompiler.vue | |||
| @@ -446,7 +446,8 @@ export default { | |||
| 446 | .childTitle { | 446 | .childTitle { |
| 447 | width: 100%; | 447 | width: 100%; |
| 448 | font-size: 1.2em; | 448 | font-size: 1.2em; |
| 449 | color: #b7ae8f; | 449 | color: var(--vp-c-text-2); |
| 450 | font-weight: bold; | ||
| 450 | text-align: center; | 451 | text-align: center; |
| 451 | padding: 0.2em; | 452 | padding: 0.2em; |
| 452 | height: 2.5em; | 453 | height: 2.5em; |
diff --git a/doc/docs/.vitepress/theme/custom.css b/doc/docs/.vitepress/theme/custom.css index bd89528..f7c58dd 100644 --- a/doc/docs/.vitepress/theme/custom.css +++ b/doc/docs/.vitepress/theme/custom.css | |||
| @@ -1,4 +1,19 @@ | |||
| 1 | @import '@fontsource/merriweather/300.css'; | ||
| 2 | @import '@fontsource/merriweather/400.css'; | ||
| 3 | @import '@fontsource/merriweather/700.css'; | ||
| 4 | @import '@fontsource/merriweather/900.css'; | ||
| 5 | @import '@fontsource/merriweather/300-italic.css'; | ||
| 6 | @import '@fontsource/merriweather/400-italic.css'; | ||
| 7 | @import '@fontsource/merriweather/700-italic.css'; | ||
| 8 | @import '@fontsource/merriweather/900-italic.css'; | ||
| 9 | |||
| 1 | :root { | 10 | :root { |
| 11 | /* --- TYPOGRAPHY --- */ | ||
| 12 | /* Keep standard sans-serif for body text for readability */ | ||
| 13 | --vp-font-family-base: system-ui, sans-serif; | ||
| 14 | --vp-font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; | ||
| 15 | |||
| 16 | /* --- BRAND COLORS (Original Moon Gold) --- */ | ||
| 2 | --vp-c-brand-1: #b4ac8f; | 17 | --vp-c-brand-1: #b4ac8f; |
| 3 | --vp-button-brand-bg: #b4ac8f; | 18 | --vp-button-brand-bg: #b4ac8f; |
| 4 | --vp-button-brand-hover-bg: #b4ac8f; | 19 | --vp-button-brand-hover-bg: #b4ac8f; |
| @@ -7,13 +22,87 @@ | |||
| 7 | --vp-button-brand-hover-border: #b4ac8f; | 22 | --vp-button-brand-hover-border: #b4ac8f; |
| 8 | --vp-button-brand-active-border: #b4ac8f; | 23 | --vp-button-brand-active-border: #b4ac8f; |
| 9 | --vp-button-brand-text: #fff; | 24 | --vp-button-brand-text: #fff; |
| 25 | |||
| 26 | /* --- LIGHT MODE THEME --- */ | ||
| 27 | /* A warmer, "creamy" paper feel instead of harsh white */ | ||
| 28 | --vp-c-bg: #FDFBF7; | ||
| 29 | --vp-c-bg-soft: #F7F5F0; | ||
| 30 | /* Slightly darker for sidebars */ | ||
| 31 | --vp-c-bg-alt: #F0EDE5; | ||
| 32 | /* For code blocks/inputs */ | ||
| 33 | |||
| 34 | /* Text Colors: Deep Navy instead of pure black for softer contrast */ | ||
| 35 | --vp-c-text-1: #1a202c; | ||
| 36 | --vp-c-text-2: #4a5568; | ||
| 37 | } | ||
| 38 | |||
| 39 | /* Hero image - enlarge container to fit 450px image without overflow */ | ||
| 40 | @media (max-width: 960px) { | ||
| 41 | .VPHero .image-container { | ||
| 42 | max-width: 450px !important; | ||
| 43 | } | ||
| 44 | |||
| 45 | .VPHero :deep(.image-src) { | ||
| 46 | max-width: 450px; | ||
| 47 | max-height: 450px; | ||
| 48 | } | ||
| 10 | } | 49 | } |
| 11 | 50 | ||
| 12 | .VPHomeHero .image img { | 51 | /* --- DARK MODE THEME (Midnight Blue) --- */ |
| 13 | width: 450px; | 52 | .dark { |
| 14 | max-width: 450px !important; | 53 | /* Deep Midnight Blue background (replaces standard grey) */ |
| 54 | --vp-c-bg: #0B0E14; | ||
| 55 | --vp-c-bg-soft: #131722; | ||
| 56 | /* Sidebar/Nav */ | ||
| 57 | --vp-c-bg-alt: #1A1F2E; | ||
| 58 | /* Code blocks/inputs */ | ||
| 59 | |||
| 60 | /* Text Colors: Moonlight Silver */ | ||
| 61 | --vp-c-text-1: #E2E8F0; | ||
| 62 | --vp-c-text-2: #94A3B8; | ||
| 63 | |||
| 64 | /* Adjust border colors to blend with blue, not grey */ | ||
| 65 | --vp-c-border: #1E293B; | ||
| 66 | --vp-c-divider: #1E293B; | ||
| 67 | --vp-c-gutter: #1E293B; | ||
| 15 | } | 68 | } |
| 16 | 69 | ||
| 70 | /* --- HEADINGS: Apply the Serif Font --- */ | ||
| 71 | h1, | ||
| 72 | h2, | ||
| 73 | h3, | ||
| 74 | h4, | ||
| 75 | h5, | ||
| 76 | h6, | ||
| 77 | .VPFeature .title, | ||
| 78 | .VPHero .name, | ||
| 79 | .VPNavBarTitle .title { | ||
| 80 | font-family: 'Merriweather', serif !important; | ||
| 81 | letter-spacing: -0.02em; | ||
| 82 | /* Tighter tracking looks more professional on serifs */ | ||
| 83 | } | ||
| 84 | |||
| 85 | /* Make the Hero Title (YueScript) feel more "Editorial" */ | ||
| 86 | .VPHero .name { | ||
| 87 | font-weight: 900 !important; | ||
| 88 | color: var(--vp-c-brand-1); | ||
| 89 | /* Optional: Adds a subtle glow in dark mode */ | ||
| 90 | text-shadow: 0 0 20px rgba(180, 172, 143, 0.2); | ||
| 91 | } | ||
| 92 | |||
| 93 | /* --- BUTTONS --- */ | ||
| 94 | /* Ensure the "Brand" buttons use our Gold color with white text for contrast */ | ||
| 95 | .VPButton.brand { | ||
| 96 | color: #fff !important; | ||
| 97 | background-color: var(--vp-c-brand-1) !important; | ||
| 98 | border-color: var(--vp-c-brand-1) !important; | ||
| 99 | } | ||
| 100 | |||
| 101 | .VPButton.brand:hover { | ||
| 102 | background-color: var(--vp-c-brand-1) !important; | ||
| 103 | } | ||
| 104 | |||
| 105 | |||
| 17 | /* Prism theme for YueCompiler output (shikijs/themes light-plus & dark-plus) */ | 106 | /* Prism theme for YueCompiler output (shikijs/themes light-plus & dark-plus) */ |
| 18 | .code-output, | 107 | .code-output, |
| 19 | .code-output code { | 108 | .code-output code { |
| @@ -121,3 +210,9 @@ | |||
| 121 | .dark .code-output .token.invalid { | 210 | .dark .code-output .token.invalid { |
| 122 | color: #f44747; | 211 | color: #f44747; |
| 123 | } | 212 | } |
| 213 | |||
| 214 | /* --- CODE BLOCKS --- */ | ||
| 215 | /* Slight adjustment to code block background to fit the midnight theme */ | ||
| 216 | .dark .vp-code-group .tabs label { | ||
| 217 | background-color: #1A1F2E; | ||
| 218 | } \ No newline at end of file | ||
diff --git a/doc/docs/doc/licence-mit.md b/doc/docs/doc/licence-mit.md index 253298f..f1d5d60 100644 --- a/doc/docs/doc/licence-mit.md +++ b/doc/docs/doc/licence-mit.md | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # Licence: MIT | 1 | # License: MIT |
| 2 | 2 | ||
| 3 | Copyright (c) 2017-2026 Li Jin \<dragon-fly@qq.com\> | 3 | Copyright (c) 2017-2026 Li Jin \<dragon-fly@qq.com\> |
| 4 | 4 | ||
diff --git a/doc/docs/index.md b/doc/docs/index.md index 03a33dd..6141caf 100644 --- a/doc/docs/index.md +++ b/doc/docs/index.md | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | layout: home | 2 | layout: home |
| 3 | hero: | 3 | hero: |
| 4 | name: YueScript | 4 | name: YueScript |
| 5 | text: A language that compiles to Lua | 5 | tagline: A language that compiles to Lua |
| 6 | image: | 6 | image: |
| 7 | src: /image/yuescript.svg | 7 | src: /image/yuescript.svg |
| 8 | alt: YueScript | 8 | alt: YueScript |
diff --git a/doc/docs/zh/index.md b/doc/docs/zh/index.md index ea42085..5f2dc20 100644 --- a/doc/docs/zh/index.md +++ b/doc/docs/zh/index.md | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | layout: home | 2 | layout: home |
| 3 | hero: | 3 | hero: |
| 4 | name: 月之脚本 | 4 | name: 月之脚本 |
| 5 | text: 一门编译到 Lua 的语言 | 5 | tagline: 一门编译到 Lua 的语言 |
| 6 | image: | 6 | image: |
| 7 | src: /image/yuescript.svg | 7 | src: /image/yuescript.svg |
| 8 | alt: 月之脚本 | 8 | alt: 月之脚本 |
diff --git a/doc/package.json b/doc/package.json index 3e1bd17..d2b903f 100755 --- a/doc/package.json +++ b/doc/package.json | |||
| @@ -25,6 +25,9 @@ | |||
| 25 | "@codemirror/legacy-modes": "^6.5.2", | 25 | "@codemirror/legacy-modes": "^6.5.2", |
| 26 | "@codemirror/state": "^6.5.4", | 26 | "@codemirror/state": "^6.5.4", |
| 27 | "@codemirror/view": "^6.39.12", | 27 | "@codemirror/view": "^6.39.12", |
| 28 | "@fontsource/merriweather": "^5.2.11", | ||
| 29 | "@lezer/highlight": "^1.2.3", | ||
| 30 | "@shikijs/themes": "^3.22.0", | ||
| 28 | "prismjs": "^1.29.0" | 31 | "prismjs": "^1.29.0" |
| 29 | } | 32 | } |
| 30 | } | 33 | } |
