All Projects → lelouch77 → Docusaurus Lunr Search

lelouch77 / Docusaurus Lunr Search

Licence: mit
Local / Offline Search for docusaurus

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Docusaurus Lunr Search

Docs
API Platform documentation
Stars: ✭ 119 (-7.75%)
Mutual labels:  documentation
Docs
📚 Documentation for 🚀 Fiber
Stars: ✭ 121 (-6.2%)
Mutual labels:  documentation
Waves Documentation
Waves platform documentation
Stars: ✭ 127 (-1.55%)
Mutual labels:  documentation
L5 Swagger
OpenApi or Swagger integration to Laravel
Stars: ✭ 1,781 (+1280.62%)
Mutual labels:  documentation
Lurker
📖 The ultimate tool for documenting and testing APIs in Rails
Stars: ✭ 120 (-6.98%)
Mutual labels:  documentation
Gdscript Docs Maker
Create documentation and class references from your Godot GDScript code
Stars: ✭ 121 (-6.2%)
Mutual labels:  documentation
Kotlinlang.ru
Russian translation of Kotlin reference
Stars: ✭ 118 (-8.53%)
Mutual labels:  documentation
Algo ds notes
It is a repository that is a collection of algorithms and data structures with implementation in various languages.
Stars: ✭ 1,897 (+1370.54%)
Mutual labels:  documentation
Cypress Docs Pt Br
Tradução da documentação oficial do framework Cypress.io - traduzida pela comunidade em Português-BR 🌐
Stars: ✭ 112 (-13.18%)
Mutual labels:  documentation
V2fly Github Io
V2Fly Website & Documentation
Stars: ✭ 124 (-3.88%)
Mutual labels:  documentation
Frontend Develops Skill Summary
Development experience with javascript, jQuery, Vuejs, Wechat MiniProgram and so on
Stars: ✭ 120 (-6.98%)
Mutual labels:  documentation
Devdocs
Shopware 5 Developers Website
Stars: ✭ 120 (-6.98%)
Mutual labels:  documentation
Mulesoft Docs
Main MuleSoft documentation repository
Stars: ✭ 122 (-5.43%)
Mutual labels:  documentation
Lodash.com
The Lodash website.
Stars: ✭ 119 (-7.75%)
Mutual labels:  documentation
Docsh
Erlang Docs in the Shell
Stars: ✭ 127 (-1.55%)
Mutual labels:  documentation
Wiki
Awesome way to learn together! 🤣
Stars: ✭ 119 (-7.75%)
Mutual labels:  documentation
Remix Ide
Documentation for Remix IDE
Stars: ✭ 1,768 (+1270.54%)
Mutual labels:  documentation
Handbook
📖 Complete documentation for WP-CLI
Stars: ✭ 129 (+0%)
Mutual labels:  documentation
Preact And Typescript
Some simple patterns for Typescript usage with Preact
Stars: ✭ 127 (-1.55%)
Mutual labels:  documentation
Vue Live
A component to demo components, inspired by react-live
Stars: ✭ 123 (-4.65%)
Mutual labels:  documentation

docusaurus-lunr-search

Offline Search for Docusaurus V2

Demo Website

MIT Licence

npm version

Sample

Prerequisites

worker_thread is needed, suggested node version > 12.X For older version of node use docusaurus-lunr-search version 2.1.0 (npm i [email protected])

How to Use ?

  1. Install this package
npm i docusaurus-lunr-search  --save
  1. Then run npm install to update, build, and link the packages
npm install
  1. Then run docusaurus swizzle
npm run swizzle docusaurus-lunr-search SearchBar -- --danger
  1. Add the docusaurus-lunr-search plugin to your docusaurus.config.js
module.exports = {
  // ...
    plugins: [require.resolve('docusaurus-lunr-search')],
}
  1. Then build your Docusaurus project
npm run build
  1. Serve your application
npx http-server ./build

Note: Docusaurus search information can only be generated from a production build. Local development is currently not supported.

Language options

module.exports = {
  // ...
    plugins: [[ require.resolve('docusaurus-lunr-search'), {
      languages: ['en', 'de'] // language codes
    }],
}

Supports all the language listed here https://github.com/MihaiValentin/lunr-languages

Other options

excludeRoutes

You can exclude certain routes from the search by using this option:

module.exports = {
  // ...
    plugins: [
    [require.resolve('docusaurus-lunr-search'), {
        excludeRoutes: [
            'docs/changelogs/**/*', // exclude changelogs from indexing
        ]
    }]
  ],
}

indexBaseUrl

Base url will not indexed by default, if you want to index the base url set this option to true

module.exports = {
  // ...
    plugins: [
        [require.resolve('docusaurus-lunr-search'),
            {
                indexBaseUrl: true
            }
        ]
    ],
}

Thanks to algolia/docsearch.js, I modified it to create this search component

And thanks cmfcmf, I used the code from his library docusaurus-search-local for multi-language support.

Changelog

Checkout the releases page for changelog.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].