From 0299d4bffd40111b4e953c9cf2c8e6117a798df8 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Sun, 29 Mar 2020 15:06:41 +0200 Subject: [PATCH] Added localsearch plugin to documentation --- docs/getting-started.md | 6 ++++-- docs/plugins/search.md | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 4ba6bedd1..273213ea6 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -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 diff --git a/docs/plugins/search.md b/docs/plugins/search.md index 213f9fd40..1782eb9d4 100644 --- a/docs/plugins/search.md +++ b/docs/plugins/search.md @@ -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