Skip to content

Commit

Permalink
Add search plugin, build docs task
Browse files Browse the repository at this point in the history
  • Loading branch information
aNNiMON committed Jan 12, 2024
1 parent 9581c09 commit b719420
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
.temp
.cache
docs/.vuepress/configs/modules.js
docs/.vuepress/dist/
docs/*/modules/
10 changes: 9 additions & 1 deletion docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 9 additions & 1 deletion docs/docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -11,6 +12,7 @@ definePrismOwnLang(Prism)
const __dirname = getDirname(import.meta.url)

export default defineUserConfig({
base: "/docs/ownlang/",
locales: {
'/en/': {
lang: 'en-US',
Expand Down Expand Up @@ -50,6 +52,12 @@ export default defineUserConfig({
}),
registerComponentsPlugin({
componentsDir: path.resolve(__dirname, './components'),
})
}),
searchPlugin({
locales: {
'/en/': { placeholder: 'Search' },
'/ru/': { placeholder: 'Поиск' },
},
}),
],
})
2 changes: 1 addition & 1 deletion docs/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ actions:
- text: 🇺🇸 English
link: /en/
type: primary
- text: 🇷🇺 Русский
- text: 🇪🇷 Русский
link: /ru/
type: primary
footer: © 2024 aNNiMON
Expand Down
7 changes: 6 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
19 changes: 19 additions & 0 deletions docs/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b719420

Please sign in to comment.