From b7194207709454156848ad2fc9ee5a7b18d831b5 Mon Sep 17 00:00:00 2001 From: aNNiMON Date: Thu, 11 Jan 2024 22:12:14 +0200 Subject: [PATCH] Add search plugin, build docs task --- docs/.gitignore | 1 + docs/build.gradle | 10 +++++++++- docs/docs/.vuepress/config.js | 10 +++++++++- docs/docs/README.md | 2 +- docs/package.json | 7 ++++++- docs/pnpm-lock.yaml | 19 +++++++++++++++++++ 6 files changed, 45 insertions(+), 4 deletions(-) diff --git a/docs/.gitignore b/docs/.gitignore index b25f853..c561d8e 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -2,4 +2,5 @@ node_modules .temp .cache docs/.vuepress/configs/modules.js +docs/.vuepress/dist/ docs/*/modules/ diff --git a/docs/build.gradle b/docs/build.gradle index 7e25b7c..72811d4 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -30,12 +30,20 @@ tasks.register('generateMarkdownModules') { tasks.register('runDocsDev', Exec) { group = "documentation" - description = "Run sample program" + description = "Start docs dev server" dependsOn generateMarkdownModules workingDir '../docs/docs' commandLine 'pnpm', 'docs:dev' } +tasks.register('buildDocs', Exec) { + group = "documentation" + description = "Build docs to static site" + dependsOn generateMarkdownModules + workingDir '../docs/docs' + commandLine 'pnpm', 'docs:build' +} + tasks.register('generateModuleInfo', JavaExec) { group = "documentation" description = "Run sample program" diff --git a/docs/docs/.vuepress/config.js b/docs/docs/.vuepress/config.js index f660608..78845b5 100644 --- a/docs/docs/.vuepress/config.js +++ b/docs/docs/.vuepress/config.js @@ -2,6 +2,7 @@ import { defineUserConfig, defaultTheme } from 'vuepress' import { getDirname, path } from '@vuepress/utils' import { registerComponentsPlugin } from '@vuepress/plugin-register-components' import { prismjsPlugin } from '@vuepress/plugin-prismjs' +import { searchPlugin } from '@vuepress/plugin-search' import { sidebarConfig } from './configs/sidebar' import { navbarConfig } from './configs/navbar' import Prism from 'prismjs'; @@ -11,6 +12,7 @@ definePrismOwnLang(Prism) const __dirname = getDirname(import.meta.url) export default defineUserConfig({ + base: "/docs/ownlang/", locales: { '/en/': { lang: 'en-US', @@ -50,6 +52,12 @@ export default defineUserConfig({ }), registerComponentsPlugin({ componentsDir: path.resolve(__dirname, './components'), - }) + }), + searchPlugin({ + locales: { + '/en/': { placeholder: 'Search' }, + '/ru/': { placeholder: 'Поиск' }, + }, + }), ], }) diff --git a/docs/docs/README.md b/docs/docs/README.md index 5336004..1c14e3b 100644 --- a/docs/docs/README.md +++ b/docs/docs/README.md @@ -7,7 +7,7 @@ actions: - text: 🇺🇸 English link: /en/ type: primary - - text: 🇷🇺 Русский + - text: 🇪🇷 Русский link: /ru/ type: primary footer: © 2024 aNNiMON diff --git a/docs/package.json b/docs/package.json index f9ff718..4d455a4 100644 --- a/docs/package.json +++ b/docs/package.json @@ -7,13 +7,18 @@ "docs:dev": "vuepress dev docs", "docs:build": "vuepress build docs" }, - "keywords": ["documentation", "ownlang", "programming-language"], + "keywords": [ + "documentation", + "ownlang", + "programming-language" + ], "author": "aNNiMON", "license": "MIT", "devDependencies": { "@vuepress/client": "2.0.0-rc.0", "@vuepress/plugin-prismjs": "2.0.0-rc.0", "@vuepress/plugin-register-components": "2.0.0-rc.0", + "@vuepress/plugin-search": "2.0.0-rc.0", "@vuepress/utils": "2.0.0-rc.0", "prismjs": "^1.29.0", "vue": "^3.3.8", diff --git a/docs/pnpm-lock.yaml b/docs/pnpm-lock.yaml index 92a719d..d659b8e 100644 --- a/docs/pnpm-lock.yaml +++ b/docs/pnpm-lock.yaml @@ -14,6 +14,9 @@ devDependencies: '@vuepress/plugin-register-components': specifier: 2.0.0-rc.0 version: 2.0.0-rc.0 + '@vuepress/plugin-search': + specifier: 2.0.0-rc.0 + version: 2.0.0-rc.0 '@vuepress/utils': specifier: 2.0.0-rc.0 version: 2.0.0-rc.0 @@ -831,6 +834,22 @@ packages: - typescript dev: true + /@vuepress/plugin-search@2.0.0-rc.0: + resolution: {integrity: sha512-1ikJUgIN+7QrcAftxpWUKTrNVHEN2+k/az0Sjz7Ok7EthMHcG6qQsIb+AoK4WIQMsJkwVPLxwym/M1FbBTZDWQ==} + dependencies: + '@vuepress/client': 2.0.0-rc.0 + '@vuepress/core': 2.0.0-rc.0 + '@vuepress/shared': 2.0.0-rc.0 + '@vuepress/utils': 2.0.0-rc.0 + chokidar: 3.5.3 + vue: 3.3.8 + vue-router: 4.2.5(vue@3.3.8) + transitivePeerDependencies: + - '@vue/composition-api' + - supports-color + - typescript + dev: true + /@vuepress/plugin-theme-data@2.0.0-rc.0: resolution: {integrity: sha512-FXY3/Ml+rM6gNKvwdBF6vKAcwnSvtXCzKgQwJAw3ppQTKUkLcbOxqM+h4d8bzHWAAvdnEvQFug5uEZgWllBQbA==} dependencies: