Added localsearch plugin to documentation

This commit is contained in:
squidfunk 2020-03-29 15:06:41 +02:00
parent e5f20b540d
commit 0299d4bffd
2 changed files with 16 additions and 4 deletions

View File

@ -719,11 +719,13 @@ including more information regarding installation and usage:
* [Search][32] (enabled by default)
* [Minification][33]
* [Revision date][34]
* [Awesome pages][35]
For further reference, the MkDocs wiki contains a list of all
[available plugins][35].
[available plugins][36].
[32]: plugins/search.md
[33]: plugins/minification.md
[34]: plugins/revision-date.md
[35]: https://github.com/mkdocs/mkdocs/wiki/MkDocs-Plugins
[35]: plugins/awesome-pages.md
[36]: https://github.com/mkdocs/mkdocs/wiki/MkDocs-Plugins

View File

@ -9,9 +9,19 @@ and is implemented using [lunr.js][2] which includes stemmers for the English
language by default, while stemmers for other languages are included with
[lunr-languages][3], both of which are integrated with this theme.
!!! tip "Add the [localsearch][4] plugin to support search from `file://`"
While search will not work for the `file://` protocol, as web workers and
the use of `XMLHTTPRequest` are both blocked by modern browsers for security
reasons, the [localsearch][4] plugin and @squidfunk's [iframe-worker][5]
polyfill add support for cases where this is a mandatory requirement, e.g.,
for offline use.
[1]: https://www.mkdocs.org/user-guide/configuration/#search
[2]: https://lunrjs.com
[3]: https://github.com/MihaiValentin/lunr-languages
[4]: https://github.com/wilhelmer/mkdocs-localsearch
[5]: https://github.com/squidfunk/iframe-worker
## Installation
@ -102,7 +112,7 @@ plugins:
> Default: `false`
MkDocs can generate a [prebuilt index][4] of all pages during build time, which
MkDocs can generate a [prebuilt index][6] of all pages during build time, which
provides performance improvements at the cost of more bandwidth. This may be
beneficial for large documentation projects that are served with appropriate
HTTP headers (e.g. `Content-Encoding: gzip`).
@ -116,7 +126,7 @@ plugins:
prebuild_index: true
```
[4]: https://www.mkdocs.org/user-guide/configuration/#prebuild_index
[6]: https://www.mkdocs.org/user-guide/configuration/#prebuild_index
## Usage