This is an automated email from the ASF dual-hosted git repository.

visortelle pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git


The following commit(s) were added to refs/heads/main by this push:
     new 48985dd249c3 [fix][site] host static resources on the website (#794)
48985dd249c3 is described below

commit 48985dd249c322d68cc8e6bce09b62a318780491
Author: Julien Jakubowski <[email protected]>
AuthorDate: Tue Feb 27 14:00:39 2024 +0100

    [fix][site] host static resources on the website (#794)
    
    * host reference doc Docsify CSS on pulsar.apache.org website
    
    * host reference doc Docsify JS files on pulsar.apache.org website
    
    * host KaTeX CSS file on pulsar.apache.org website
    
    * host Work Sans font on pulsar.apache.org website
    
    * credit docsify-themeable CSS
---
 docusaurus.config.js                               |   5 +-
 src/css/typography.css                             |  20 +-
 static/css/katex-0.13.24.min.css                   |   1 +
 static/fonts/work-sans/OFL.txt                     |  93 ++++
 static/fonts/work-sans/work-sans.woff2             | Bin 0 -> 50560 bytes
 .../docsify-themeable/theme-simple-dark.min.css    |   3 +
 .../css/docsify-themeable/theme-simple.min.css     |   3 +
 static/reference/index.html                        |  18 +-
 static/reference/js/docsify-4/lib/docsify.min.js   |   1 +
 .../reference/js/docsify-4/lib/plugins/search.js   | 540 +++++++++++++++++++++
 .../js/docsify-4/lib/plugins/zoom-image.min.js     |   1 +
 .../dist/docsify-namespaced.min.js                 |   9 +
 .../dist/docsify-plugin-toc.min.js                 |   1 +
 .../dist/docsify-sidebar-collapse.min.js           |   1 +
 .../dist/js/docsify-themeable.min.js               |   9 +
 15 files changed, 690 insertions(+), 15 deletions(-)

diff --git a/docusaurus.config.js b/docusaurus.config.js
index 3513c69e13c5..10e8b123d095 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -478,11 +478,8 @@ module.exports = {
   clientModules: [require.resolve("./matomoClientModule.ts")],
   stylesheets: [
     {
-      href: "https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css";,
+      href: "/css/katex-0.13.24.min.css",
       type: "text/css",
-      integrity:
-        
"sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM",
-      crossorigin: "anonymous",
       media: "print", // load CSS asynchronously to increase performance of 
page first load
       onload: "this.media='all'", // load CSS asynchronously to increase 
performance of page first load
     },
diff --git a/src/css/typography.css b/src/css/typography.css
index 9eb4e744b989..c80b6cc163b7 100644
--- a/src/css/typography.css
+++ b/src/css/typography.css
@@ -1,5 +1,21 @@
-@import 
url("https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,400;0,500;0,600;1,400;1,500;1,600&display=swap";);
-
+@font-face {
+  font-family: 'Work Sans';
+  src: url('/fonts/work-sans/work-sans.woff2') format('woff2');
+  font-weight: 400;
+  font-style: normal;
+}
+@font-face {
+  font-family: 'Work Sans';
+  src: url('/fonts/work-sans/work-sans.woff2') format('woff2');
+  font-weight: 500;
+  font-style: normal;
+}
+@font-face {
+  font-family: 'Work Sans';
+  src: url('/fonts/work-sans/work-sans.woff2') format('woff2');
+  font-weight: 600;
+  font-style: normal;
+}
 :root {
   font-family: "Work Sans", -apple-system, Frutiger, "Frutiger Linotype",
     Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad,
diff --git a/static/css/katex-0.13.24.min.css b/static/css/katex-0.13.24.min.css
new file mode 100644
index 000000000000..f7ebca1f940a
--- /dev/null
+++ b/static/css/katex-0.13.24.min.css
@@ -0,0 +1 @@
+@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(fonts/KaTeX_AMS-Regular.woff2)
 format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) 
format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) 
format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Caligraphic-Bold.woff2)
 format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) 
format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) 
format("truetype")}@font-face{font-family: [...]
diff --git a/static/fonts/work-sans/OFL.txt b/static/fonts/work-sans/OFL.txt
new file mode 100644
index 000000000000..d3a046cf5748
--- /dev/null
+++ b/static/fonts/work-sans/OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2019 The Work Sans Project Authors 
(https://github.com/weiweihuanghuang/Work-Sans)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded, 
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/static/fonts/work-sans/work-sans.woff2 
b/static/fonts/work-sans/work-sans.woff2
new file mode 100644
index 000000000000..f07cbff0dd33
Binary files /dev/null and b/static/fonts/work-sans/work-sans.woff2 differ
diff --git a/static/reference/css/docsify-themeable/theme-simple-dark.min.css 
b/static/reference/css/docsify-themeable/theme-simple-dark.min.css
new file mode 100644
index 000000000000..1aca008c0d18
--- /dev/null
+++ b/static/reference/css/docsify-themeable/theme-simple-dark.min.css
@@ -0,0 +1,3 @@
+.github-corner{position:absolute;z-index:40;top:0;right:0;border-bottom:0;text-decoration:none}.github-corner
 
svg{height:70px;width:70px;fill:var(--theme-color);color:var(--base-background-color)}.github-corner:hover
 .octo-arm{-webkit-animation:octocat-wave 560ms 
ease-in-out;animation:octocat-wave 560ms ease-in-out}@-webkit-keyframes 
octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@keyframes
 octocat-wave{0%,100%{transform:rotate( [...]
+
+/*# sourceMappingURL=theme-simple-dark.css.map */
\ No newline at end of file
diff --git a/static/reference/css/docsify-themeable/theme-simple.min.css 
b/static/reference/css/docsify-themeable/theme-simple.min.css
new file mode 100644
index 000000000000..608d017e12b9
--- /dev/null
+++ b/static/reference/css/docsify-themeable/theme-simple.min.css
@@ -0,0 +1,3 @@
+.github-corner{position:absolute;z-index:40;top:0;right:0;border-bottom:0;text-decoration:none}.github-corner
 
svg{height:70px;width:70px;fill:var(--theme-color);color:var(--base-background-color)}.github-corner:hover
 .octo-arm{-webkit-animation:octocat-wave 560ms 
ease-in-out;animation:octocat-wave 560ms ease-in-out}@-webkit-keyframes 
octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@keyframes
 octocat-wave{0%,100%{transform:rotate( [...]
+
+/*# sourceMappingURL=theme-simple.css.map */
\ No newline at end of file
diff --git a/static/reference/index.html b/static/reference/index.html
index 257af0fe1387..b6288a9aadd5 100644
--- a/static/reference/index.html
+++ b/static/reference/index.html
@@ -14,12 +14,12 @@
     <link
       rel="stylesheet"
       media="(prefers-color-scheme: dark)"
-      
href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple-dark.css";
+      href="./css/docsify-themeable/theme-simple-dark.min.css"
     />
     <link
       rel="stylesheet"
       media="(prefers-color-scheme: light)"
-      
href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple.css";
+      href="./css/docsify-themeable/theme-simple.min.css"
     />
 
     <!-- Plugins -->
@@ -228,16 +228,16 @@
     </script>
 
     <!-- Required -->
-    <script 
src="https://cdn.jsdelivr.net/npm/docsify@4/lib/docsify.min.js";></script>
-    <script 
src="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/js/docsify-themeable.min.js";></script>
+    <script src="./js/docsify-4/lib/docsify.min.js"></script>
+    <script 
src="./js/docsify-themeable-0/dist/js/docsify-themeable.min.js"></script>
 
     <!-- Recommended -->
-    <script 
src="https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/search.js";></script>
-    <script 
src="https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/zoom-image.min.js";></script>
+    <script src="./js/docsify-4/lib/plugins/search.js"></script>
+    <script src="./js/docsify-4/lib/plugins/zoom-image.min.js"></script>
 
     <!-- Plugins -->
-    <script src="https://unpkg.com/docsify-namespaced";></script>
-    <script 
src="https://unpkg.com/[email protected]/dist/docsify-plugin-toc.min.js";></script>
-    <script 
src="https://cdn.jsdelivr.net/npm/docsify-sidebar-collapse/dist/docsify-sidebar-collapse.min.js";></script>
+    <script 
src="./js/docsify-namespaced-0.1.1/dist/docsify-namespaced.min.js"></script>
+    <script 
src="./js/docsify-plugin-toc-1.3.1/dist/docsify-plugin-toc.min.js"></script>
+    <script 
src="./js/docsify-sidebar-collapse/dist/docsify-sidebar-collapse.min.js"></script>
   </body>
 </html>
diff --git a/static/reference/js/docsify-4/lib/docsify.min.js 
b/static/reference/js/docsify-4/lib/docsify.min.js
new file mode 100644
index 000000000000..80be8c5fd8b9
--- /dev/null
+++ b/static/reference/js/docsify-4/lib/docsify.min.js
@@ -0,0 +1 @@
+!function(){function c(i){var o=Object.create(null);return function(e){var 
n=f(e)?e:JSON.stringify(e);return o[n]||(o[n]=i(e))}}var a=c(function(e){return 
e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),u=Object.prototype.hasOwnProperty,m=Object.assign||function(e){for(var
 n=arguments,i=1;i<arguments.length;i++){var o,t=Object(n[i]);for(o in 
t)u.call(t,o)&&(e[o]=t[o])}return e};function f(e){return"string"==typeof 
e||"number"==typeof e}function d(){}function o(e){return"fu [...]
diff --git a/static/reference/js/docsify-4/lib/plugins/search.js 
b/static/reference/js/docsify-4/lib/plugins/search.js
new file mode 100644
index 000000000000..003bc4c30e1b
--- /dev/null
+++ b/static/reference/js/docsify-4/lib/plugins/search.js
@@ -0,0 +1,540 @@
+(function () {
+  /**
+   * Converts a colon formatted string to a object with properties.
+   *
+   * This is process a provided string and look for any tokens in the format
+   * of `:name[=value]` and then convert it to a object and return.
+   * An example of this is ':include :type=code :fragment=demo' is taken and
+   * then converted to:
+   *
+   * ```
+   * {
+   *  include: '',
+   *  type: 'code',
+   *  fragment: 'demo'
+   * }
+   * ```
+   *
+   * @param {string}   str   The string to parse.
+   *
+   * @return {object}  The original string and parsed object, { str, config }.
+   */
+  function getAndRemoveConfig(str) {
+    if ( str === void 0 ) str = '';
+
+    var config = {};
+
+    if (str) {
+      str = str
+        .replace(/^('|")/, '')
+        .replace(/('|")$/, '')
+        .replace(/(?:^|\s):([\w-]+:?)=?([\w-%]+)?/g, function (m, key, value) {
+          if (key.indexOf(':') === -1) {
+            config[key] = (value && value.replace(/&quot;/g, '')) || true;
+            return '';
+          }
+
+          return m;
+        })
+        .trim();
+    }
+
+    return { str: str, config: config };
+  }
+
+  function removeDocsifyIgnoreTag(str) {
+    return str
+      .replace(/<!-- {docsify-ignore} -->/, '')
+      .replace(/{docsify-ignore}/, '')
+      .replace(/<!-- {docsify-ignore-all} -->/, '')
+      .replace(/{docsify-ignore-all}/, '')
+      .trim();
+  }
+
+  /* eslint-disable no-unused-vars */
+
+  var INDEXS = {};
+
+  var LOCAL_STORAGE = {
+    EXPIRE_KEY: 'docsify.search.expires',
+    INDEX_KEY: 'docsify.search.index',
+  };
+
+  function resolveExpireKey(namespace) {
+    return namespace
+      ? ((LOCAL_STORAGE.EXPIRE_KEY) + "/" + namespace)
+      : LOCAL_STORAGE.EXPIRE_KEY;
+  }
+
+  function resolveIndexKey(namespace) {
+    return namespace
+      ? ((LOCAL_STORAGE.INDEX_KEY) + "/" + namespace)
+      : LOCAL_STORAGE.INDEX_KEY;
+  }
+
+  function escapeHtml(string) {
+    var entityMap = {
+      '&': '&amp;',
+      '<': '&lt;',
+      '>': '&gt;',
+      '"': '&quot;',
+      "'": '&#39;',
+    };
+
+    return String(string).replace(/[&<>"']/g, function (s) { return 
entityMap[s]; });
+  }
+
+  function getAllPaths(router) {
+    var paths = [];
+
+    Docsify.dom
+      .findAll('.sidebar-nav a:not(.section-link):not([data-nosearch])')
+      .forEach(function (node) {
+        var href = node.href;
+        var originHref = node.getAttribute('href');
+        var path = router.parse(href).path;
+
+        if (
+          path &&
+          paths.indexOf(path) === -1 &&
+          !Docsify.util.isAbsolutePath(originHref)
+        ) {
+          paths.push(path);
+        }
+      });
+
+    return paths;
+  }
+
+  function getTableData(token) {
+    if (!token.text && token.type === 'table') {
+      token.cells.unshift(token.header);
+      token.text = token.cells
+        .map(function (rows) {
+          return rows.join(' | ');
+        })
+        .join(' |\n ');
+    }
+    return token.text;
+  }
+
+  function getListData(token) {
+    if (!token.text && token.type === 'list') {
+      token.text = token.raw;
+    }
+    return token.text;
+  }
+
+  function saveData(maxAge, expireKey, indexKey) {
+    localStorage.setItem(expireKey, Date.now() + maxAge);
+    localStorage.setItem(indexKey, JSON.stringify(INDEXS));
+  }
+
+  function genIndex(path, content, router, depth) {
+    if ( content === void 0 ) content = '';
+
+    var tokens = window.marked.lexer(content);
+    var slugify = window.Docsify.slugify;
+    var index = {};
+    var slug;
+    var title = '';
+
+    tokens.forEach(function (token, tokenIndex) {
+      if (token.type === 'heading' && token.depth <= depth) {
+        var ref = getAndRemoveConfig(token.text);
+        var str = ref.str;
+        var config = ref.config;
+
+        var text = removeDocsifyIgnoreTag(token.text);
+
+        if (config.id) {
+          slug = router.toURL(path, { id: slugify(config.id) });
+        } else {
+          slug = router.toURL(path, { id: slugify(escapeHtml(text)) });
+        }
+
+        if (str) {
+          title = removeDocsifyIgnoreTag(str);
+        }
+
+        index[slug] = { slug: slug, title: title, body: '' };
+      } else {
+        if (tokenIndex === 0) {
+          slug = router.toURL(path);
+          index[slug] = {
+            slug: slug,
+            title: path !== '/' ? path.slice(1) : 'Home Page',
+            body: token.text || '',
+          };
+        }
+
+        if (!slug) {
+          return;
+        }
+
+        if (!index[slug]) {
+          index[slug] = { slug: slug, title: '', body: '' };
+        } else if (index[slug].body) {
+          token.text = getTableData(token);
+          token.text = getListData(token);
+
+          index[slug].body += '\n' + (token.text || '');
+        } else {
+          token.text = getTableData(token);
+          token.text = getListData(token);
+
+          index[slug].body = token.text || '';
+        }
+      }
+    });
+    slugify.clear();
+    return index;
+  }
+
+  function ignoreDiacriticalMarks(keyword) {
+    if (keyword && keyword.normalize) {
+      return keyword.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
+    }
+    return keyword;
+  }
+
+  /**
+   * @param {String} query Search query
+   * @returns {Array} Array of results
+   */
+  function search(query) {
+    var matchingResults = [];
+    var data = [];
+    Object.keys(INDEXS).forEach(function (key) {
+      data = data.concat(Object.keys(INDEXS[key]).map(function (page) { return 
INDEXS[key][page]; }));
+    });
+
+    query = query.trim();
+    var keywords = query.split(/[\s\-,\\/]+/);
+    if (keywords.length !== 1) {
+      keywords = [].concat(query, keywords);
+    }
+
+    var loop = function ( i ) {
+      var post = data[i];
+      var matchesScore = 0;
+      var resultStr = '';
+      var handlePostTitle = '';
+      var handlePostContent = '';
+      var postTitle = post.title && post.title.trim();
+      var postContent = post.body && post.body.trim();
+      var postUrl = post.slug || '';
+
+      if (postTitle) {
+        keywords.forEach(function (keyword) {
+          // From https://github.com/sindresorhus/escape-string-regexp
+          var regEx = new RegExp(
+            escapeHtml(ignoreDiacriticalMarks(keyword)).replace(
+              /[|\\{}()[\]^$+*?.]/g,
+              '\\$&'
+            ),
+            'gi'
+          );
+          var indexTitle = -1;
+          var indexContent = -1;
+          handlePostTitle = postTitle
+            ? escapeHtml(ignoreDiacriticalMarks(postTitle))
+            : postTitle;
+          handlePostContent = postContent
+            ? escapeHtml(ignoreDiacriticalMarks(postContent))
+            : postContent;
+
+          indexTitle = postTitle ? handlePostTitle.search(regEx) : -1;
+          indexContent = postContent ? handlePostContent.search(regEx) : -1;
+
+          if (indexTitle >= 0 || indexContent >= 0) {
+            matchesScore += indexTitle >= 0 ? 3 : indexContent >= 0 ? 2 : 0;
+            if (indexContent < 0) {
+              indexContent = 0;
+            }
+
+            var start = 0;
+            var end = 0;
+
+            start = indexContent < 11 ? 0 : indexContent - 10;
+            end = start === 0 ? 70 : indexContent + keyword.length + 60;
+
+            if (postContent && end > postContent.length) {
+              end = postContent.length;
+            }
+
+            var matchContent =
+              handlePostContent &&
+              '...' +
+                handlePostContent
+                  .substring(start, end)
+                  .replace(
+                    regEx,
+                    function (word) { return ("<em class=\"search-keyword\">" 
+ word + "</em>"); }
+                  ) +
+                '...';
+
+            resultStr += matchContent;
+          }
+        });
+
+        if (matchesScore > 0) {
+          var matchingPost = {
+            title: handlePostTitle,
+            content: postContent ? resultStr : '',
+            url: postUrl,
+            score: matchesScore,
+          };
+
+          matchingResults.push(matchingPost);
+        }
+      }
+    };
+
+    for (var i = 0; i < data.length; i++) loop( i );
+
+    return matchingResults.sort(function (r1, r2) { return r2.score - 
r1.score; });
+  }
+
+  function init(config, vm) {
+    var isAuto = config.paths === 'auto';
+    var paths = isAuto ? getAllPaths(vm.router) : config.paths;
+
+    var namespaceSuffix = '';
+
+    // only in auto mode
+    if (paths.length && isAuto && config.pathNamespaces) {
+      var path = paths[0];
+
+      if (Array.isArray(config.pathNamespaces)) {
+        namespaceSuffix =
+          config.pathNamespaces.filter(
+            function (prefix) { return path.slice(0, prefix.length) === 
prefix; }
+          )[0] || namespaceSuffix;
+      } else if (config.pathNamespaces instanceof RegExp) {
+        var matches = path.match(config.pathNamespaces);
+
+        if (matches) {
+          namespaceSuffix = matches[0];
+        }
+      }
+      var isExistHome = paths.indexOf(namespaceSuffix + '/') === -1;
+      var isExistReadme = paths.indexOf(namespaceSuffix + '/README') === -1;
+      if (isExistHome && isExistReadme) {
+        paths.unshift(namespaceSuffix + '/');
+      }
+    } else if (paths.indexOf('/') === -1 && paths.indexOf('/README') === -1) {
+      paths.unshift('/');
+    }
+
+    var expireKey = resolveExpireKey(config.namespace) + namespaceSuffix;
+    var indexKey = resolveIndexKey(config.namespace) + namespaceSuffix;
+
+    var isExpired = localStorage.getItem(expireKey) < Date.now();
+
+    INDEXS = JSON.parse(localStorage.getItem(indexKey));
+
+    if (isExpired) {
+      INDEXS = {};
+    } else if (!isAuto) {
+      return;
+    }
+
+    var len = paths.length;
+    var count = 0;
+
+    paths.forEach(function (path) {
+      if (INDEXS[path]) {
+        return count++;
+      }
+
+      Docsify.get(vm.router.getFile(path), false, 
vm.config.requestHeaders).then(
+        function (result) {
+          INDEXS[path] = genIndex(path, result, vm.router, config.depth);
+          len === ++count && saveData(config.maxAge, expireKey, indexKey);
+        }
+      );
+    });
+  }
+
+  /* eslint-disable no-unused-vars */
+
+  var NO_DATA_TEXT = '';
+  var options;
+
+  function style() {
+    var code = "\n.sidebar {\n  padding-top: 0;\n}\n\n.search {\n  
margin-bottom: 20px;\n  padding: 6px;\n  border-bottom: 1px solid 
#eee;\n}\n\n.search .input-wrap {\n  display: flex;\n  align-items: 
center;\n}\n\n.search .results-panel {\n  display: none;\n}\n\n.search 
.results-panel.show {\n  display: block;\n}\n\n.search input {\n  outline: 
none;\n  border: none;\n  width: 100%;\n  padding: 0.6em 7px;\n  font-size: 
inherit;\n  border: 1px solid transparent;\n}\n\n.search input:focus  [...]
+
+    Docsify.dom.style(code);
+  }
+
+  function tpl(defaultValue) {
+    if ( defaultValue === void 0 ) defaultValue = '';
+
+    var html = "<div class=\"input-wrap\">\n      <input type=\"search\" 
value=\"" + defaultValue + "\" aria-label=\"Search text\" />\n      <div 
class=\"clear-button\">\n        <svg width=\"26\" height=\"24\">\n          
<circle cx=\"12\" cy=\"12\" r=\"11\" fill=\"#ccc\" />\n          <path 
stroke=\"white\" stroke-width=\"2\" d=\"M8.25,8.25,15.75,15.75\" />\n          
<path stroke=\"white\" stroke-width=\"2\"d=\"M8.25,15.75,15.75,8.25\" />\n      
  </svg>\n      </div>\n    </div>\n    [...]
+    var el = Docsify.dom.create('div', html);
+    var aside = Docsify.dom.find('aside');
+
+    Docsify.dom.toggleClass(el, 'search');
+    Docsify.dom.before(aside, el);
+  }
+
+  function doSearch(value) {
+    var $search = Docsify.dom.find('div.search');
+    var $panel = Docsify.dom.find($search, '.results-panel');
+    var $clearBtn = Docsify.dom.find($search, '.clear-button');
+    var $sidebarNav = Docsify.dom.find('.sidebar-nav');
+    var $appName = Docsify.dom.find('.app-name');
+
+    if (!value) {
+      $panel.classList.remove('show');
+      $clearBtn.classList.remove('show');
+      $panel.innerHTML = '';
+
+      if (options.hideOtherSidebarContent) {
+        $sidebarNav && $sidebarNav.classList.remove('hide');
+        $appName && $appName.classList.remove('hide');
+      }
+
+      return;
+    }
+
+    var matchs = search(value);
+
+    var html = '';
+    matchs.forEach(function (post) {
+      html += "<div class=\"matching-post\">\n<a href=\"" + (post.url) + 
"\">\n<h2>" + (post.title) + "</h2>\n<p>" + (post.content) + 
"</p>\n</a>\n</div>";
+    });
+
+    $panel.classList.add('show');
+    $clearBtn.classList.add('show');
+    $panel.innerHTML = html || ("<p class=\"empty\">" + NO_DATA_TEXT + "</p>");
+    if (options.hideOtherSidebarContent) {
+      $sidebarNav && $sidebarNav.classList.add('hide');
+      $appName && $appName.classList.add('hide');
+    }
+  }
+
+  function bindEvents() {
+    var $search = Docsify.dom.find('div.search');
+    var $input = Docsify.dom.find($search, 'input');
+    var $inputWrap = Docsify.dom.find($search, '.input-wrap');
+
+    var timeId;
+
+    /**
+      Prevent to Fold sidebar.
+
+      When searching on the mobile end,
+      the sidebar is collapsed when you click the INPUT box,
+      making it impossible to search.
+     */
+    Docsify.dom.on(
+      $search,
+      'click',
+      function (e) { return ['A', 'H2', 'P', 'EM'].indexOf(e.target.tagName) 
=== -1 &&
+        e.stopPropagation(); }
+    );
+    Docsify.dom.on($input, 'input', function (e) {
+      clearTimeout(timeId);
+      timeId = setTimeout(function (_) { return 
doSearch(e.target.value.trim()); }, 100);
+    });
+    Docsify.dom.on($inputWrap, 'click', function (e) {
+      // Click input outside
+      if (e.target.tagName !== 'INPUT') {
+        $input.value = '';
+        doSearch();
+      }
+    });
+  }
+
+  function updatePlaceholder(text, path) {
+    var $input = Docsify.dom.getNode('.search input[type="search"]');
+
+    if (!$input) {
+      return;
+    }
+
+    if (typeof text === 'string') {
+      $input.placeholder = text;
+    } else {
+      var match = Object.keys(text).filter(function (key) { return 
path.indexOf(key) > -1; })[0];
+      $input.placeholder = text[match];
+    }
+  }
+
+  function updateNoData(text, path) {
+    if (typeof text === 'string') {
+      NO_DATA_TEXT = text;
+    } else {
+      var match = Object.keys(text).filter(function (key) { return 
path.indexOf(key) > -1; })[0];
+      NO_DATA_TEXT = text[match];
+    }
+  }
+
+  function updateOptions(opts) {
+    options = opts;
+  }
+
+  function init$1(opts, vm) {
+    var keywords = vm.router.parse().query.s;
+
+    updateOptions(opts);
+    style();
+    tpl(keywords);
+    bindEvents();
+    keywords && setTimeout(function (_) { return doSearch(keywords); }, 500);
+  }
+
+  function update(opts, vm) {
+    updateOptions(opts);
+    updatePlaceholder(opts.placeholder, vm.route.path);
+    updateNoData(opts.noData, vm.route.path);
+  }
+
+  /* eslint-disable no-unused-vars */
+
+  var CONFIG = {
+    placeholder: 'Type to search',
+    noData: 'No Results!',
+    paths: 'auto',
+    depth: 2,
+    maxAge: 86400000, // 1 day
+    hideOtherSidebarContent: false,
+    namespace: undefined,
+    pathNamespaces: undefined,
+  };
+
+  var install = function (hook, vm) {
+    var util = Docsify.util;
+    var opts = vm.config.search || CONFIG;
+
+    if (Array.isArray(opts)) {
+      CONFIG.paths = opts;
+    } else if (typeof opts === 'object') {
+      CONFIG.paths = Array.isArray(opts.paths) ? opts.paths : 'auto';
+      CONFIG.maxAge = util.isPrimitive(opts.maxAge) ? opts.maxAge : 
CONFIG.maxAge;
+      CONFIG.placeholder = opts.placeholder || CONFIG.placeholder;
+      CONFIG.noData = opts.noData || CONFIG.noData;
+      CONFIG.depth = opts.depth || CONFIG.depth;
+      CONFIG.hideOtherSidebarContent =
+        opts.hideOtherSidebarContent || CONFIG.hideOtherSidebarContent;
+      CONFIG.namespace = opts.namespace || CONFIG.namespace;
+      CONFIG.pathNamespaces = opts.pathNamespaces || CONFIG.pathNamespaces;
+    }
+
+    var isAuto = CONFIG.paths === 'auto';
+
+    hook.mounted(function (_) {
+      init$1(CONFIG, vm);
+      !isAuto && init(CONFIG, vm);
+    });
+    hook.doneEach(function (_) {
+      update(CONFIG, vm);
+      isAuto && init(CONFIG, vm);
+    });
+  };
+
+  $docsify.plugins = [].concat(install, $docsify.plugins);
+
+}());
diff --git a/static/reference/js/docsify-4/lib/plugins/zoom-image.min.js 
b/static/reference/js/docsify-4/lib/plugins/zoom-image.min.js
new file mode 100644
index 000000000000..63153aefce71
--- /dev/null
+++ b/static/reference/js/docsify-4/lib/plugins/zoom-image.min.js
@@ -0,0 +1 @@
+!function(){function t(e){return"IMG"===e.tagName}function d(e){function 
t(){for(var e=arguments,t=arguments.length,o=Array(t),n=0;n<t;n++)o[n]=e[n];var 
i=o.reduce(function(e,t){return[].concat(e,z(t))},[]);return 
i.filter(function(e){return-1===m.indexOf(e)}).forEach(function(e){m.push(e),e.classList.add("medium-zoom-image")}),r.forEach(function(e){var
 
t=e.type,o=e.listener,n=e.options;i.forEach(function(e){e.addEventListener(t,o,n)})}),f}function
 o(){var e=(0<arguments.length&&void 0!= [...]
diff --git 
a/static/reference/js/docsify-namespaced-0.1.1/dist/docsify-namespaced.min.js 
b/static/reference/js/docsify-namespaced-0.1.1/dist/docsify-namespaced.min.js
new file mode 100644
index 000000000000..891f5a0d60be
--- /dev/null
+++ 
b/static/reference/js/docsify-namespaced-0.1.1/dist/docsify-namespaced.min.js
@@ -0,0 +1,9 @@
+/*!
+ * docsify-namespaced
+ * v0.1.1
+ * https://github.com/palkan/docsify-namespaced
+ * (c) 2020-2021 Vladimir Dementyev <[email protected]>
+ * MIT license
+ */
+!function(){"use 
strict";window.$docsify=window.$docsify||{},window.$docsify.plugins=[function(n,a){function
 r(n){w?window.location.hash=n:window.location.href=n}function 
l(n){return(n=n||(w?window.location.hash:window.location.pathname)).split(/\//)}function
 
u(n,e,o,t){e.values.includes(n[o+1])?t?n[o+1]=t:n.splice(o+1,1):t&&n.splice(o+1,0,t)}var
 s,f,d,w=!0;n.mounted(function(){var 
n=(s=a.config.namespaces).map(function(n){var 
e="(?:(".concat(n.values.join("|"),")/)");return n.optional&& [...]
+//# sourceMappingURL=docsify-namespaced.min.js.map
diff --git 
a/static/reference/js/docsify-plugin-toc-1.3.1/dist/docsify-plugin-toc.min.js 
b/static/reference/js/docsify-plugin-toc-1.3.1/dist/docsify-plugin-toc.min.js
new file mode 100644
index 000000000000..1a73f45ebe0c
--- /dev/null
+++ 
b/static/reference/js/docsify-plugin-toc-1.3.1/dist/docsify-plugin-toc.min.js
@@ -0,0 +1 @@
+!function(o,n){"object"==typeof exports&&"object"==typeof 
module?module.exports=n():"function"==typeof 
define&&define.amd?define([],n):"object"==typeof 
exports?exports.DocsifyPluginToc=n():o.DocsifyPluginToc=n()}(this,(()=>(()=>{"use
 strict";var o={};function n(o,n){let e=['<div class="page_toc">'];const 
t=[];return(o=document.querySelectorAll(`#main 
${window.$docsify.toc.target}`))&&o.forEach((function(o){const 
n=function(o,n){if(o>=1&&o<=window.$docsify.toc.tocMaxLevel){return['<div cl 
[...]
\ No newline at end of file
diff --git 
a/static/reference/js/docsify-sidebar-collapse/dist/docsify-sidebar-collapse.min.js
 
b/static/reference/js/docsify-sidebar-collapse/dist/docsify-sidebar-collapse.min.js
new file mode 100644
index 000000000000..2b067c7e2504
--- /dev/null
+++ 
b/static/reference/js/docsify-sidebar-collapse/dist/docsify-sidebar-collapse.min.js
@@ -0,0 +1 @@
+!function(e){("object"!=typeof exports||"undefined"==typeof 
module)&&"function"==typeof define&&define.amd?define(e):e()}(function(){"use 
strict";function e(e,n){var t,a=(n=void 
0===n?{}:n).insertAt;e&&"undefined"!=typeof 
document&&(t=document.head||document.getElementsByTagName("head")[0],(n=document.createElement("style")).type="text/css","top"===a&&t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))
 [...]
\ No newline at end of file
diff --git 
a/static/reference/js/docsify-themeable-0/dist/js/docsify-themeable.min.js 
b/static/reference/js/docsify-themeable-0/dist/js/docsify-themeable.min.js
new file mode 100644
index 000000000000..3068c5d61fa5
--- /dev/null
+++ b/static/reference/js/docsify-themeable-0/dist/js/docsify-themeable.min.js
@@ -0,0 +1,9 @@
+/*!
+ * docsify-themeable
+ * v0.9.0
+ * https://jhildenbiddle.github.io/docsify-themeable/
+ * (c) 2018-2022 John Hildenbiddle
+ * MIT license
+ */
+!function(){"use strict";function e(){return 
e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var 
n=arguments[t];for(var r in 
n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return 
e},e.apply(this,arguments)}function t(e){var t=arguments.length>1&&void 
0!==arguments[1]?arguments[1]:{},n={mimeType:t.mimeType||null,onBeforeSend:t.onBeforeSend||Function.prototype,onSuccess:t.onSuccess||Function.prototype,onError:t.onError||Function.prototype,onComplete:t.onComplete|
 [...]
+//# sourceMappingURL=docsify-themeable.min.js.map


Reply via email to