Skip to content

Commit

Permalink
Add docusaurus-lunr-search plugin (langchain4j#1221)
Browse files Browse the repository at this point in the history
## Issue
[https://github.com/langchain4j/langchain4j/issues/1219](https://github.com/langchain4j/langchain4j/issues/1219)


## Change
Added the `docusaurus-lunr-search` plugin.

It may seem that for search feature we would need a server. But nothing
stops us from passing that logic to the client)

So, if the index for pages is not too big, we will delegate the search
functionality to client. That's what this plugin does (I think).

It works with `npm run serve`, but I couldn't test it with just opening
the `index.html` file.

Oh, I'm sorry, my editor autoformatted the file)

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
  • Loading branch information
InAnYan authored Jul 3, 2024
1 parent 234141b commit 038f24d
Show file tree
Hide file tree
Showing 3 changed files with 779 additions and 7 deletions.
15 changes: 8 additions & 7 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// There are various equivalent ways to declare your Docusaurus config.
// See: https://docusaurus.io/docs/api/docusaurus-config

import {themes as prismThemes} from 'prism-react-renderer';
import { themes as prismThemes } from 'prism-react-renderer';

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand Down Expand Up @@ -64,7 +64,7 @@ const config = {
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
Expand All @@ -86,15 +86,15 @@ const config = {
position: 'left',
label: 'Introduction',
},
{to: '/get-started', label: 'Get Started', position: 'left'},
{to: '/category/tutorials', label: 'Tutorials', position: 'left'},
{ to: '/get-started', label: 'Get Started', position: 'left' },
{ to: '/category/tutorials', label: 'Tutorials', position: 'left' },
{
href: 'https://github.com/langchain4j/langchain4j-examples',
label: 'Examples',
position: 'left',
},
{to: '/category/integrations', label: 'Integrations', position: 'left'},
{to: '/useful-materials', label: 'Useful Materials', position: 'left'},
{ to: '/category/integrations', label: 'Integrations', position: 'left' },
{ to: '/useful-materials', label: 'Useful Materials', position: 'left' },
{
href: 'https://docs.langchain4j.dev/apidocs/index.html',
label: 'Javadoc',
Expand Down Expand Up @@ -181,7 +181,8 @@ const config = {
markdown: {
mermaid: true,
},
themes: ['@docusaurus/theme-mermaid']
themes: ['@docusaurus/theme-mermaid'],
plugins: [require.resolve("docusaurus-lunr-search")]
};

export default config;
Loading

0 comments on commit 038f24d

Please sign in to comment.