jekyll-rtd-theme 1.1.7 → 1.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +71 -29
  4. data/_includes/addons/analytics.liquid +6 -13
  5. data/_includes/addons/github.liquid +19 -18
  6. data/_includes/assets/sw.caches.js +38 -28
  7. data/_includes/class/_breadcrumbs.liquid +28 -0
  8. data/_includes/class/_footer.liquid +38 -0
  9. data/_includes/{toctree.liquid → class/_toctree.liquid} +0 -3
  10. data/_includes/{addons.liquid → class/rst-versions.liquid} +6 -12
  11. data/_includes/class/wy-nav-content.liquid +15 -0
  12. data/_includes/class/wy-nav-side.liquid +18 -0
  13. data/_includes/class/wy-nav-top.liquid +8 -0
  14. data/_includes/extend/list.liquid +2 -2
  15. data/_includes/extend/toctree.liquid +0 -10
  16. data/_includes/node/links.liquid +24 -0
  17. data/_includes/node/metadata.liquid +21 -0
  18. data/_includes/node/script.extension.liquid +29 -0
  19. data/_includes/node/script.liquid +20 -0
  20. data/_includes/node/script.schema.liquid +27 -0
  21. data/_includes/node/title.liquid +1 -0
  22. data/_includes/reset/defaults.liquid +56 -55
  23. data/_includes/reset/i18n.liquid +1 -31
  24. data/_includes/{extend → reset}/tabs.liquid +0 -0
  25. data/_includes/reset/workdir.liquid +1 -15
  26. data/_includes/shortcodes/danger.liquid +6 -0
  27. data/_includes/shortcodes/mermaid.liquid +1 -0
  28. data/_includes/shortcodes/note.liquid +6 -0
  29. data/_includes/shortcodes/tip.liquid +6 -0
  30. data/_includes/shortcodes/warning.liquid +6 -0
  31. data/_layouts/default.liquid +24 -240
  32. data/_layouts/plugins/compress.liquid +13 -10
  33. data/_layouts/plugins/extension.liquid +32 -22
  34. data/_sass/highlight.scss +214 -0
  35. data/_sass/theme.scss +15 -0
  36. data/assets/404.liquid +1 -1
  37. data/assets/css/{theme.css → theme.min.css} +0 -0
  38. data/assets/js/theme.js +294 -0
  39. data/assets/js/theme.min.js +1 -0
  40. data/assets/search.liquid +0 -15
  41. metadata +26 -52
  42. data/_includes/addons/i18n.liquid +0 -13
  43. data/_includes/addons/plugins.liquid +0 -6
  44. data/_includes/album.liquid +0 -7
  45. data/_includes/assets/common.js +0 -167
  46. data/_includes/assets/search.js +0 -76
  47. data/_includes/breadcrumbs.liquid +0 -43
  48. data/_includes/footer.liquid +0 -39
  49. data/_includes/i18n/en.liquid +0 -29
  50. data/_includes/i18n/es.liquid +0 -29
  51. data/_includes/i18n/fr.liquid +0 -29
  52. data/_includes/i18n/it.liquid +0 -29
  53. data/_includes/i18n/ja.liquid +0 -29
  54. data/_includes/i18n/ko.liquid +0 -29
  55. data/_includes/i18n/ru.liquid +0 -29
  56. data/_includes/i18n/sv.liquid +0 -29
  57. data/_includes/i18n/zh-cn.liquid +0 -29
  58. data/_includes/reset/languages.liquid +0 -110
  59. data/_sass/_album.scss +0 -19
  60. data/_sass/_embed.scss +0 -23
  61. data/_sass/fluid.scss +0 -7
  62. data/_sass/jekyll-rtd-theme.scss +0 -162
  63. data/assets/css/rougify/base16.css +0 -1
  64. data/assets/css/rougify/base16.dark.css +0 -1
  65. data/assets/css/rougify/base16.light.css +0 -1
  66. data/assets/css/rougify/base16.monokai.css +0 -1
  67. data/assets/css/rougify/base16.monokai.dark.css +0 -1
  68. data/assets/css/rougify/base16.monokai.light.css +0 -1
  69. data/assets/css/rougify/base16.solarized.css +0 -1
  70. data/assets/css/rougify/base16.solarized.dark.css +0 -1
  71. data/assets/css/rougify/base16.solarized.light.css +0 -1
  72. data/assets/css/rougify/bw.css +0 -1
  73. data/assets/css/rougify/colorful.css +0 -1
  74. data/assets/css/rougify/github.css +0 -1
  75. data/assets/css/rougify/gruvbox.css +0 -1
  76. data/assets/css/rougify/gruvbox.dark.css +0 -1
  77. data/assets/css/rougify/gruvbox.light.css +0 -1
  78. data/assets/css/rougify/igorpro.css +0 -1
  79. data/assets/css/rougify/magritte.css +0 -1
  80. data/assets/css/rougify/molokai.css +0 -1
  81. data/assets/css/rougify/monokai.css +0 -1
  82. data/assets/css/rougify/monokai.sublime.css +0 -1
  83. data/assets/css/rougify/pastie.css +0 -1
  84. data/assets/css/rougify/thankful_eyes.css +0 -1
  85. data/assets/css/rougify/tulip.css +0 -1
  86. data/assets/js/anchor.min.js +0 -9
  87. data/assets/js/html5shiv.min.js +0 -4
@@ -0,0 +1 @@
1
+ !function(t){var e={};function n(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(r,a,function(e){return t[e]}.bind(null,a));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){t.exports=n(1)},function(t,e){function n(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var a=0,o=function(){};return{s:o,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,l=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return l=t.done,t},e:function(t){s=!0,c=t},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw c}}}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}$(document).ready((function(){function t(){console.debug.apply(console,arguments)}function e(t){var e=$(".wy-menu-vertical").find('[href="'.concat(decodeURI(t),'"]'));e.length>0&&($(".wy-menu-vertical .current").removeClass("current"),e.addClass("current"),e.closest("li.toctree-l1").parent().addClass("current"),e.closest("li.toctree-l1").addClass("current"),e.closest("li.toctree-l2").addClass("current"),e.closest("li.toctree-l3").addClass("current"),e.closest("li.toctree-l4").addClass("current"),e.closest("li.toctree-l5").addClass("current"))}function r(t){var e=t.closest("li");e.siblings("li.current").removeClass("current"),e.siblings().find("li.current").removeClass("current"),e.find("> ul li.current").removeClass("current"),e.toggleClass("current")}function a(t,e){return localStorage.setItem(t,e)}function o(t){return localStorage.getItem(t)||!1}"serviceWorker"in navigator?navigator.serviceWorker.register("".concat(ui.baseurl,"/sw.caches.js")):t("Service Worker not supported!");var c,l,s,i,u,h=new URL("https://rundocs-analytics.glitch.me/collect?v=".concat(ui.version,"&lang=").concat(ui.lang));h.searchParams.append("user_lang",navigator.language),h.searchParams.append("host",location.host),h.searchParams.append("platform",navigator.platform),$.getJSON(h.toString(),(function(t){return $("#counter").html(t.count)})),location.pathname=="".concat(ui.baseurl,"/search.html")&&$.ajax("".concat(ui.baseurl,"/pages.json")).done((function(e){var r=new URL(location.href).searchParams.get("q");new URL(location.href).searchParams.get("lang")||ui.lang,$("input[name='q']").val(r);var a=[],o=new RegExp;try{o=new RegExp(r,"im")}catch(e){return $(".search").empty(),$(".search-summary").html(ui.i18n.search_results_not_found),$("#search-results h2").html(ui.i18n.search_results),t(e.message)}function c(t,e,n){return t.slice(e,n).replace(o,(function(t){return'<span class="highlighted">'.concat(t,"</span>")}))}var l,s=n(e);try{for(s.s();!(l=s.n()).done;){page=l.value;var i=null,u=null;try{page.title?i=page.title.match(o):"/"==page.url?page.title=ui.title:page.title=page.url}catch(e){t(e.message)}try{page.content&&(page.content=$("<div/>").html(page.content).text(),u=page.content.match(o))}catch(e){t(e.message)}if(i||u){var h=['<a href="'.concat(ui.baseurl).concat(page.url,"?highlight=").concat(r,'">').concat(page.title,"</a>")];if(u){var f=u.index-100,g=u.index+100,d="...",p="...";f<0&&(d="",f=0),g>page.content.length&&(p="",g=page.content.length),h.push('<p class="context">'.concat(d).concat(c(page.content,f,g)).concat(p,"</p>"))}a.push("<li>".concat(h.join(""),"</li>"))}}}catch(t){s.e(t)}finally{s.f()}a.length>0&&r.length>0?($(".search").html(a.join("")),$(".search-summary").html(ui.i18n.search_results_found.replace("#",a.length))):($(".search").empty(),$(".search-summary").html(ui.i18n.search_results_not_found)),$("#search-results h2").html(ui.i18n.search_results)})).fail((function(e,n){return t(n)})),$(".wy-menu-vertical li.current").append('<ul class="content-toc"></ul>').html((function(){var t=parseInt(this.dataset.level),e=0,n=[$(this).find(".content-toc")];$(".document").find("h2,h3,h4,h5,h6").each((function(){var r=$("<a/>").addClass("reference internal").text($(this).text()).attr("href","#".concat(this.id)),a=parseInt(this.tagName.slice(1))-1;if(a>e){var o=n[0].children("li:last")[0];o&&n.unshift($("<ul/>").appendTo(o))}else n.splice(0,Math.min(e-a,Math.max(n.length-1,0)));e=a,$("<li/>").addClass("toctree-l".concat(t+a)).append(r).appendTo(n[0])})),n[0].html()||n[0].remove()})),e(location.pathname),c=o("scroll"),l=o("scrollTime"),s=o("scrollHost"),c&&l&&s&&s==location.host&&Date.now()-l<6e5&&$(".wy-side-scroll").scrollTop(c),$(".wy-side-scroll").scroll((function(){a("scroll",this.scrollTop),a("scrollTime",Date.now()),a("scrollHost",location.host)})),i=new URL(location.href).searchParams.get("highlight"),u=".highlighted-box",i&&($(".section").find("*").each((function(){try{this.outerHTML.match(new RegExp(i,"im"))&&$(this).addClass("highlighted-box")}catch(e){t(e.message)}})),$(".section").find(u).each((function(){$(this).find(u).length>0&&$(this).removeClass(u)}))),$(".wy-menu-vertical ul").siblings("a").each((function(){var t=$(this),e=$('<span class="toctree-expand"></span>');e.on("click",(function(e){return e.stopPropagation(),r(t),!1})),t.prepend(e)})),$(document).on("click",'[data-toggle="wy-nav-top"]',(function(){$('[data-toggle="wy-nav-shift"]').toggleClass("shift"),$('[data-toggle="rst-versions"]').toggleClass("shift")})),$(document).on("click",".wy-menu-vertical .current ul li a",(function(){$('[data-toggle="wy-nav-shift"]').removeClass("shift"),$('[data-toggle="rst-versions"]').toggleClass("shift"),r($(this))})),$(document).on("scroll",(function(){var t=$(this).scrollTop()+5,n=[];$(".document").find("h1,h2,h3,h4,h5,h6").each((function(){n.push({offset:$(this).offset().top,id:this.id,level:parseInt(this.tagName.slice(1))})}));for(var r=0;r<n.length;r++)t>n[r].offset&&(r<n.length-1?t<n[r+1].offset&&(1==n[r].level?e(location.pathname):e("#"+n[r].id)):e("#"+n[r].id))})),$(document).on("click",'[data-toggle="rst-current-version"]',(function(){$('[data-toggle="rst-versions"]').toggleClass("shift-up")})),$(window).bind("resize",(function(){requestAnimationFrame((function(){}))})),$(window).bind("hashchange",(function(){return e(location.hash||location.pathname)}))}))}]);
@@ -11,18 +11,3 @@ permalink: /search.html
11
11
  <p class="search-summary"></p>
12
12
  <ul class="search"></ul>
13
13
  </div>
14
-
15
- <script>
16
- const i18n = {
17
- {%- for lang in site_langs -%}
18
- {%- include i18n/{{ lang }}.liquid %}
19
- "{{ lang }}": {
20
- search_docs: "{{ __search_docs }}",
21
- search_results: "{{ __search_results }}",
22
- search_results_found: "{{ __search_results_found }}",
23
- search_results_not_found: "{{ __search_results_not_found }}"
24
- }{% unless forloop.last %},{% endunless %}
25
- {%- endfor -%}
26
- };
27
- </script>
28
- <script>{% include assets/search.js %}</script>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-rtd-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - saowang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-27 00:00:00.000000000 Z
11
+ date: 2020-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github-pages
@@ -33,47 +33,44 @@ extra_rdoc_files: []
33
33
  files:
34
34
  - LICENSE
35
35
  - README.md
36
- - _includes/addons.liquid
37
36
  - _includes/addons/analytics.liquid
38
37
  - _includes/addons/github.liquid
39
- - _includes/addons/i18n.liquid
40
- - _includes/addons/plugins.liquid
41
- - _includes/album.liquid
42
- - _includes/assets/common.js
43
38
  - _includes/assets/custom.js
44
39
  - _includes/assets/custom.scss
45
- - _includes/assets/search.js
46
40
  - _includes/assets/sw.caches.js
47
- - _includes/breadcrumbs.liquid
41
+ - _includes/class/_breadcrumbs.liquid
42
+ - _includes/class/_footer.liquid
43
+ - _includes/class/_toctree.liquid
44
+ - _includes/class/rst-versions.liquid
45
+ - _includes/class/wy-nav-content.liquid
46
+ - _includes/class/wy-nav-side.liquid
47
+ - _includes/class/wy-nav-top.liquid
48
48
  - _includes/extend/list.liquid
49
- - _includes/extend/tabs.liquid
50
49
  - _includes/extend/toctree.liquid
51
50
  - _includes/extra/footer.html
52
51
  - _includes/extra/head.html
53
- - _includes/footer.liquid
54
- - _includes/i18n/en.liquid
55
- - _includes/i18n/es.liquid
56
- - _includes/i18n/fr.liquid
57
- - _includes/i18n/it.liquid
58
- - _includes/i18n/ja.liquid
59
- - _includes/i18n/ko.liquid
60
- - _includes/i18n/ru.liquid
61
- - _includes/i18n/sv.liquid
62
- - _includes/i18n/zh-cn.liquid
63
52
  - _includes/list.liquid
53
+ - _includes/node/links.liquid
54
+ - _includes/node/metadata.liquid
55
+ - _includes/node/script.extension.liquid
56
+ - _includes/node/script.liquid
57
+ - _includes/node/script.schema.liquid
58
+ - _includes/node/title.liquid
64
59
  - _includes/reset/defaults.liquid
65
60
  - _includes/reset/i18n.liquid
66
- - _includes/reset/languages.liquid
67
61
  - _includes/reset/site_pages.liquid
62
+ - _includes/reset/tabs.liquid
68
63
  - _includes/reset/workdir.liquid
69
- - _includes/toctree.liquid
64
+ - _includes/shortcodes/danger.liquid
65
+ - _includes/shortcodes/mermaid.liquid
66
+ - _includes/shortcodes/note.liquid
67
+ - _includes/shortcodes/tip.liquid
68
+ - _includes/shortcodes/warning.liquid
70
69
  - _layouts/default.liquid
71
70
  - _layouts/plugins/compress.liquid
72
71
  - _layouts/plugins/extension.liquid
73
- - _sass/_album.scss
74
- - _sass/_embed.scss
75
- - _sass/fluid.scss
76
- - _sass/jekyll-rtd-theme.scss
72
+ - _sass/highlight.scss
73
+ - _sass/theme.scss
77
74
  - assets/404.liquid
78
75
  - assets/css/fonts/Roboto-Slab-Bold.woff
79
76
  - assets/css/fonts/Roboto-Slab-Bold.woff2
@@ -92,35 +89,12 @@ files:
92
89
  - assets/css/fonts/lato-normal-italic.woff2
93
90
  - assets/css/fonts/lato-normal.woff
94
91
  - assets/css/fonts/lato-normal.woff2
95
- - assets/css/rougify/base16.css
96
- - assets/css/rougify/base16.dark.css
97
- - assets/css/rougify/base16.light.css
98
- - assets/css/rougify/base16.monokai.css
99
- - assets/css/rougify/base16.monokai.dark.css
100
- - assets/css/rougify/base16.monokai.light.css
101
- - assets/css/rougify/base16.solarized.css
102
- - assets/css/rougify/base16.solarized.dark.css
103
- - assets/css/rougify/base16.solarized.light.css
104
- - assets/css/rougify/bw.css
105
- - assets/css/rougify/colorful.css
106
- - assets/css/rougify/github.css
107
- - assets/css/rougify/gruvbox.css
108
- - assets/css/rougify/gruvbox.dark.css
109
- - assets/css/rougify/gruvbox.light.css
110
- - assets/css/rougify/igorpro.css
111
- - assets/css/rougify/magritte.css
112
- - assets/css/rougify/molokai.css
113
- - assets/css/rougify/monokai.css
114
- - assets/css/rougify/monokai.sublime.css
115
- - assets/css/rougify/pastie.css
116
- - assets/css/rougify/thankful_eyes.css
117
- - assets/css/rougify/tulip.css
118
- - assets/css/theme.css
92
+ - assets/css/theme.min.css
119
93
  - assets/favicon.liquid
120
- - assets/js/anchor.min.js
121
- - assets/js/html5shiv.min.js
122
94
  - assets/js/jquery.min.js
123
95
  - assets/js/mermaid.min.js
96
+ - assets/js/theme.js
97
+ - assets/js/theme.min.js
124
98
  - assets/pages.liquid
125
99
  - assets/robots.liquid
126
100
  - assets/search.liquid
@@ -1,13 +0,0 @@
1
- <dl>
2
- <dt>{{ __translations }}</dt>
3
- {%- for item in site_langs -%}
4
- <dd>
5
- {%- if item == site_lang -%}
6
- {%- assign url = "" -%}
7
- {%- else -%}
8
- {%- assign url = item | append: "/" -%}
9
- {%- endif -%}
10
- <a href="{{ site.baseurl }}/{{ url }}"><i class="fa fa-language"></i> {{ item }}</a>
11
- </dd>
12
- {%- endfor -%}
13
- </dl>
@@ -1,6 +0,0 @@
1
- <dl>
2
- <dt>{{ __plugins }}</dt>
3
- {%- for item in site.plugins %}
4
- <dd><a href="https://rubygems.org/gems/{{ item }}"><i class="fa fa-cog"></i> {{ item }}</a></dd>
5
- {%- endfor %}
6
- </dl>
@@ -1,7 +0,0 @@
1
- <div class="album">
2
- {%- for item in include.data -%}
3
- <a class="item" href="{{ item.link | default: '#' }}">
4
- <img src="{{ item.image }}" alt="{{ item.title }}">{{ item.title }}
5
- </a>
6
- {%- endfor -%}
7
- </div>
@@ -1,167 +0,0 @@
1
- $(document).ready(function() {
2
- function initialize(name) {
3
- let link = $(".wy-menu-vertical").find(`[href="${decodeURI(name)}"]`);
4
- if (link.length > 0) {
5
- $(".wy-menu-vertical .current").removeClass("current");
6
- link.addClass("current");
7
- link.closest("li.toctree-l1").parent().addClass("current");
8
- link.closest("li.toctree-l1").addClass("current");
9
- link.closest("li.toctree-l2").addClass("current");
10
- link.closest("li.toctree-l3").addClass("current");
11
- link.closest("li.toctree-l4").addClass("current");
12
- link.closest("li.toctree-l5").addClass("current");
13
- }
14
- }
15
-
16
- function toggleCurrent(link) {
17
- let closest = link.closest("li");
18
- closest.siblings("li.current").removeClass("current");
19
- closest.siblings().find("li.current").removeClass("current");
20
- closest.find("> ul li.current").removeClass("current");
21
- closest.toggleClass("current");
22
- }
23
-
24
- function toc() {
25
- $(".wy-menu-vertical li.current").append('<ul class="content-toc"></ul>').html(function() {
26
- let level = parseInt(this.dataset.level);
27
- let temp = 0;
28
- let stack = [$(this).find(".content-toc")];
29
-
30
- $(".document").find("h2,h3,h4,h5,h6").each(function() {
31
- let anchor = $("<a/>").addClass("reference internal").text($(this).text()).attr("href", `#${this.id}`);
32
- let tagLevel = parseInt(this.tagName.slice(1)) - 1;
33
-
34
- if (tagLevel > temp) {
35
- let parent = stack[0].children("li:last")[0];
36
- if (parent) {
37
- stack.unshift($("<ul/>").appendTo(parent));
38
- }
39
- } else {
40
- stack.splice(0, Math.min(temp - tagLevel, Math.max(stack.length - 1, 0)));
41
- }
42
- temp = tagLevel;
43
-
44
- $("<li/>").addClass(`toctree-l${level + tagLevel}`).append(anchor).appendTo(stack[0]);
45
- });
46
- if (!stack[0].html()) {
47
- stack[0].remove();
48
- }
49
- });
50
- }
51
-
52
- function set(name, value) {
53
- return localStorage.setItem(name, value);
54
- }
55
-
56
- function get(name) {
57
- return localStorage.getItem(name) || false;
58
- }
59
-
60
- function restore() {
61
- let scroll = get("scroll");
62
- let scrollTime = get("scrollTime");
63
- let scrollHost = get("scrollHost");
64
-
65
- if (scroll && scrollTime && scrollHost) {
66
- if (scrollHost == location.host && (Date.now() - scrollTime < 6e5)) {
67
- $(".wy-side-scroll").scrollTop(scroll);
68
- }
69
- }
70
- $(".wy-side-scroll").scroll(function() {
71
- set("scroll", this.scrollTop);
72
- set("scrollTime", Date.now());
73
- set("scrollHost", location.host);
74
- });
75
- }
76
-
77
- function highlight() {
78
- let text = new URL(location.href).searchParams.get("highlight");
79
- let box = ".highlighted-box";
80
-
81
- if (text) {
82
- $(".section").find("*").each(function() {
83
- try {
84
- if (this.outerHTML.match(new RegExp(text, "im"))) {
85
- $(this).addClass("highlighted-box");
86
- }
87
- } catch (e) {
88
- debug(e.message);
89
- }
90
- });
91
- $(".section").find(box).each(function() {
92
- if (($(this).find(box).length > 0)) {
93
- $(this).removeClass(box);
94
- }
95
- });
96
- }
97
- }
98
-
99
- anchors.add();
100
- toc();
101
- initialize(location.pathname);
102
- restore();
103
- highlight();
104
-
105
- /* nested ul */
106
- $(".wy-menu-vertical ul").siblings("a").each(function() {
107
- let link = $(this);
108
- let expand = $('<span class="toctree-expand"></span>');
109
-
110
- expand.on("click", function(e) {
111
- e.stopPropagation();
112
- toggleCurrent(link);
113
- return false;
114
- });
115
- link.prepend(expand);
116
- });
117
-
118
- /* admonition */
119
- $(".admonition-title").each(function() {
120
- $(this).html(ui.admonition[$(this).attr("ui")]);
121
- });
122
-
123
- /* bind */
124
- $(document).on("click", '[data-toggle="wy-nav-top"]', function() {
125
- $('[data-toggle="wy-nav-shift"]').toggleClass("shift");
126
- $('[data-toggle="rst-versions"]').toggleClass("shift");
127
- });
128
- $(document).on("click", ".wy-menu-vertical .current ul li a", function() {
129
- $('[data-toggle="wy-nav-shift"]').removeClass("shift");
130
- $('[data-toggle="rst-versions"]').toggleClass("shift");
131
- toggleCurrent($(this));
132
- });
133
- $(document).on("scroll", function() {
134
- let start = $(this).scrollTop() + 5;
135
- let items = [];
136
-
137
- $(".document").find("h1,h2,h3,h4,h5,h6").each(function() {
138
- items.push({
139
- offset: $(this).offset().top,
140
- id: this.id,
141
- level: parseInt(this.tagName.slice(1))
142
- });
143
- });
144
- for (let i = 0; i < items.length; i++) {
145
- if (start > items[i].offset) {
146
- if (i < items.length - 1) {
147
- if (start < items[i + 1].offset) {
148
- if (items[i].level == 1) {
149
- initialize(location.pathname);
150
- } else {
151
- initialize("#" + items[i].id);
152
- }
153
- }
154
- } else {
155
- initialize("#" + items[i].id);
156
- }
157
- }
158
- }
159
- });
160
- $(document).on("click", '[data-toggle="rst-current-version"]', function() {
161
- $('[data-toggle="rst-versions"]').toggleClass("shift-up");
162
- });
163
- $(window).bind("resize", function() {
164
- requestAnimationFrame(function() {});
165
- });
166
- $(window).bind("hashchange", () => initialize(location.hash || location.pathname));
167
- });
@@ -1,76 +0,0 @@
1
- function search(data) {
2
- let text = new URL(location.href).searchParams.get("q");
3
- let lang = new URL(location.href).searchParams.get("lang") || ui.lang;
4
-
5
- $("input[name='q']").val(text);
6
- $("input[name='q']").attr("placeholder", i18n[lang].search_docs + "...");
7
-
8
- let results = [];
9
- let regexp = new RegExp();
10
- try {
11
- regexp = new RegExp(text, "im");
12
- } catch (e) {
13
- $(".search").empty();
14
- $(".search-summary").html(i18n[lang].search_results_not_found);
15
- $("#search-results h2").html(i18n[lang].search_results);
16
- return debug(e.message);
17
- }
18
-
19
- function slice(content, min, max) {
20
- return content.slice(min, max).replace(regexp, (match) => `<span class="highlighted">${match}</span>`);
21
- }
22
- for (page of data) {
23
- let [title, content] = [null, null];
24
- try {
25
- if (page.title) {
26
- title = page.title.match(regexp);
27
- } else {
28
- if (page.url == "/") {
29
- page.title = ui.title;
30
- } else {
31
- page.title = page.url;
32
- }
33
- }
34
- } catch (e) {
35
- debug(e.message);
36
- }
37
- try {
38
- if (page.content) {
39
- page.content = $("<div/>").html(page.content).text();
40
- content = page.content.match(regexp);
41
- }
42
- } catch (e) {
43
- debug(e.message);
44
- }
45
- if (title || content) {
46
- let result = [`<a href="${ui.baseurl}${page.url}?highlight=${text}">${page.title}</a>`];
47
- if (content) {
48
- let [min, max] = [content.index - 100, content.index + 100];
49
- let [prefix, suffix] = ["...", "..."];
50
-
51
- if (min < 0) {
52
- prefix = "";
53
- min = 0;
54
- }
55
- if (max > page.content.length) {
56
- suffix = "";
57
- max = page.content.length;
58
- }
59
- result.push(`<p class="context">${prefix}${slice(page.content ,min, max)}${suffix}</p>`);
60
- }
61
- results.push(`<li>${result.join("")}</li>`);
62
- }
63
- }
64
- if (results.length > 0 && text.length > 0) {
65
- $(".search").html(results.join(""));
66
- $(".search-summary").html(i18n[lang].search_results_found.replace("#", results.length));
67
- } else {
68
- $(".search").empty();
69
- $(".search-summary").html(i18n[lang].search_results_not_found);
70
- }
71
- $("#search-results h2").html(i18n[lang].search_results);
72
- }
73
-
74
- $(document).ready(function() {
75
- $.ajax(`${ui.baseurl}/pages.json`).done(search).fail((xhr, message) => debug(message));
76
- });
@@ -1,43 +0,0 @@
1
- <div role="navigation" aria-label="breadcrumbs navigation">
2
- <ul class="wy-breadcrumbs">
3
- <li>
4
- <a href="{{ site.baseurl }}/" class="icon icon-home"></a><i class="fa fa-angle-double-right"></i>
5
- </li>
6
- {%- case page.url -%}
7
- {%- when "/search.html" %}
8
- <li>{{ __search }}</li>
9
- {%- when "/404.html" %}
10
- <li>{{ __404 }}</li>
11
- {%- else -%}
12
- {%- assign blocks = page.path | split: "/" -%}
13
- {%- assign length = blocks | size -%}
14
- {%- if page.dir == page.url and page.url != "/" -%}
15
- {%- assign length = blocks | size | minus: 1 -%}
16
- {%- endif -%}
17
- {%- for block in blocks limit: length -%}
18
- {%- if forloop.last %}
19
- <li>{{ page.title }}</li>
20
- {%- else -%}
21
- {%- capture href -%}
22
- {{ site.baseurl }}/{% for block in blocks limit: forloop.index %}{{ block | append: "/" }}{% endfor %}
23
- {%- endcapture %}
24
- <li>
25
- <a href="{{ href }}">
26
- {%- if block == lang -%}
27
- {{ block }}
28
- {%- else -%}
29
- {{ block | capitalize }}
30
- {%- endif -%}
31
- </a><i class="fa fa-angle-double-right"></i>
32
- </li>
33
- {%- endif -%}
34
- {%- endfor -%}
35
- {%- endcase %}
36
- {%- if site.edit and site.github_metadata != false -%}
37
- <li class="wy-breadcrumbs-aside">
38
- <a href="{{ github_edit_link }}" class="fa fa-edit" target="_blank"></a>
39
- </li>
40
- {%- endif -%}
41
- </ul>
42
- <hr>
43
- </div>