From ecf7afb18f8bf8ebdcd3489327428533e0acd3fe Mon Sep 17 00:00:00 2001 From: Julien Date: Tue, 7 Apr 2020 18:20:57 +0200 Subject: [PATCH 1/4] Remove language, material retrieve it --- src/mkdocs/mkdocs.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mkdocs/mkdocs.yml b/src/mkdocs/mkdocs.yml index cd343bb2a2..7fd4957457 100644 --- a/src/mkdocs/mkdocs.yml +++ b/src/mkdocs/mkdocs.yml @@ -24,8 +24,6 @@ plugins: - minify: minify_html: true - search: - lang: fr - prebuild_index: python # Theme theme: From 2b2cebeadc83be9a53abdc293e76dcda61bf0d7e Mon Sep 17 00:00:00 2001 From: Julien Date: Tue, 7 Apr 2020 18:21:46 +0200 Subject: [PATCH 2/4] Add localsearch plugin and dependencies --- .../theme/assets/javascript/iframe-worker.js | 2 ++ content/theme/main.html | 19 +++++++++++++------ src/mkdocs/mkdocs.yml | 4 ++++ 3 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 content/theme/assets/javascript/iframe-worker.js diff --git a/content/theme/assets/javascript/iframe-worker.js b/content/theme/assets/javascript/iframe-worker.js new file mode 100644 index 0000000000..f7e286ea07 --- /dev/null +++ b/content/theme/assets/javascript/iframe-worker.js @@ -0,0 +1,2 @@ +!function(e,r){for(var t in r)e[t]=r[t]}(window,function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=0)}([function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(1);window.IFrameWorker=n.IFrameWorker,"file:"===location.protocol&&(window.Worker=n.IFrameWorker)},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(2);var o=function(){function e(e,r){var t=this;if(this.url=e,this.onerror=null,this.onmessage=null,this.handleMessage=function(e){e.source===t.worker&&(e.stopImmediatePropagation(),t.dispatchEvent(new MessageEvent("message",{data:e.data})),t.onmessage&&t.onmessage(e))},this.handleError=function(e,r,n,o,i){if(r===t.url.toString()){var s=new ErrorEvent("error",{message:e,filename:r,lineno:n,colno:o,error:i});t.dispatchEvent(s),t.onerror&&t.onerror(s)}},void 0!==r)throw new TypeError("Options are not supported for iframe workers");var o,i=new EventTarget;this.addEventListener=i.addEventListener.bind(i),this.removeEventListener=i.removeEventListener.bind(i),this.dispatchEvent=i.dispatchEvent.bind(i),document.body.appendChild(this.iframe=((o=document.createElement("iframe")).width=o.height=o.frameBorder="0",o)),this.worker.document.open(),this.worker.document.write("\n \n \n + +{% endif %} +{% endblock %} + {% block disqus %} -
- - Contributions à cette page : {{ git_page_authors }} - -
- {% include "partials/integrations/disqus.html" %} +
+ + Contributions à cette page : {{ git_page_authors }} + +
+{% include "partials/integrations/disqus.html" %} {% endblock %} diff --git a/src/mkdocs/mkdocs.yml b/src/mkdocs/mkdocs.yml index 7fd4957457..360a35d9c1 100644 --- a/src/mkdocs/mkdocs.yml +++ b/src/mkdocs/mkdocs.yml @@ -24,6 +24,10 @@ plugins: - minify: minify_html: true - search: + prebuild_index: true + separator: '[\s\-\.]+' + - localsearch: + promise_delay: 100 # Theme theme: From 4468700e969d8e7b6b032725c23c003311bfd574 Mon Sep 17 00:00:00 2001 From: Julien Date: Tue, 7 Apr 2020 18:27:33 +0200 Subject: [PATCH 3/4] Use python to build search index --- src/mkdocs/mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mkdocs/mkdocs.yml b/src/mkdocs/mkdocs.yml index e104466578..caa11dd702 100644 --- a/src/mkdocs/mkdocs.yml +++ b/src/mkdocs/mkdocs.yml @@ -27,7 +27,7 @@ plugins: lang: - en - fr - prebuild_index: true + prebuild_index: python separator: '[\s\-\.]+' # Theme From 63e8e8f84ead4674766675e7f32241853c6f702c Mon Sep 17 00:00:00 2001 From: Julien Date: Tue, 7 Apr 2020 18:30:59 +0200 Subject: [PATCH 4/4] Add localsearch as dependency --- src/mkdocs/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mkdocs/requirements.txt b/src/mkdocs/requirements.txt index 93e5aefbaf..fb304f9dde 100644 --- a/src/mkdocs/requirements.txt +++ b/src/mkdocs/requirements.txt @@ -6,6 +6,7 @@ mkdocs-awesome-pages-plugin==2.2.* mkdocs-git-authors-plugin==0.3.* mkdocs-git-revision-date-localized-plugin==0.5.* +mkdocs-localsearch==0.7.* mkdocs-material>=5.0.* mkdocs-minify-plugin==0.2.* markdown-include==0.5.*