jekyll-rtd-theme 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17d21728bc57e4cf176a94b347ec1fa282bc3330a2fb1fafd4fae290a81c6f9a
4
- data.tar.gz: 5b7a0c810f57c8c819e5eb204e05fb9a364c7ab917b8a261c3764b060901cac1
3
+ metadata.gz: 23a52d768800e6af7ea1d5c4c35a91cee56046bade55174bcc0eb4d31e9ed676
4
+ data.tar.gz: 3d005a4cb29f27c512492cccfcdc9da428303af00df3f2ba5a7f3bc3a22e5c07
5
5
  SHA512:
6
- metadata.gz: 25d5137a9c12bfcae20f06eccf5a63f6468be384a7e8e3d2449da2d6a042a0f57a4aef8e5238ff69328103ae85328b5f5382360de935ae712c3b2ad2082777b7
7
- data.tar.gz: c98a582a2bf2f770e4d167242983832fdb3443a74d7428deee6db8cf809f04dacb8b24862e439e25ffff83cd34035ff0283a56017419312797a3b99488d15c44
6
+ metadata.gz: 022acda52128c5ced54cb84635fd067ff26ed77c99a8bc4e50762ba40d3769104d739e82ad08f56958b802f8eed716407c7d1e094cdcec75c7e3c264791cf0a8
7
+ data.tar.gz: 68f91d2be6fb03d1c00b2d29c84acd297c4539478a6b1622fbf69dee85a71b91d8ea1326d98e1687b6676621bba2027e2e858602bb24f8333eaaa0a6bc7815c5
@@ -1,14 +1,26 @@
1
1
  $(document).ready(function() {
2
2
  let analytics = new URL("https://rundocs-analytics.glitch.me/collect?v={{ version }}&lang={{ lang }}");
3
3
  let highlight = new URL(location.href).searchParams.get("highlight");
4
+ let current = $(".wy-menu-vertical").find(`[href="${location.pathname}"]`);
4
5
 
6
+ /* directory toc */
7
+ if (current.length > 0) {
8
+ current.closest("li.toctree-l1").parent().addClass("current");
9
+ current.closest("li.toctree-l1").addClass("current");
10
+ current.closest("li.toctree-l2").addClass("current");
11
+ current.closest("li.toctree-l3").addClass("current");
12
+ current.closest("li.toctree-l4").addClass("current");
13
+ current.closest("li.toctree-l5").addClass("current");
14
+ current[0].scrollIntoView();
15
+ }
5
16
  /* content toc */
6
17
  $(".wy-menu-vertical li.current").append(function() {
7
- let level = parseInt($(this).attr("class").match(/toctree-l(\d)/)[1]) + 1;
18
+ let level = parseInt($(this).attr("class").match(/toctree-l(\d+)/)[1]) + 1;
8
19
  let toc = ["<ul>"];
20
+ let sort = parseInt(this.dataset.sort);
9
21
 
10
22
  $(".document").find("h2,h3,h4,h5,h6").each(function() {
11
- toc.push(`<li class="toctree-l${level}"><a class="reference internal" href="#${this.id}">${$(this).html()}</a></li>`);
23
+ toc.push(`<li class="toctree-l${level}"><a class="reference internal" href="#${this.id}">${$(this).text()}</a></li>`);
12
24
  });
13
25
  toc.push("</ul>");
14
26
  /* return is apend */
@@ -18,22 +30,10 @@ $(document).ready(function() {
18
30
  return toc.join("");
19
31
  }
20
32
  });
21
-
22
- SphinxRtdTheme.Navigation.reset = function() {
23
- const link = $(".wy-menu-vertical").find(`[href="${location.pathname}"]`);
24
- if (link.length > 0) {
25
- $(".wy-menu-vertical .current").removeClass("current");
26
- link.addClass("current");
27
- link.closest("li.toctree-l1").parent().addClass("current");
28
- link.closest("li.toctree-l1").addClass("current");
29
- link.closest("li.toctree-l2").addClass("current");
30
- link.closest("li.toctree-l3").addClass("current");
31
- link.closest("li.toctree-l4").addClass("current");
32
- link.closest("li.toctree-l5").addClass("current");
33
- }
34
- };
33
+ /* native nav */
35
34
  SphinxRtdTheme.Navigation.enable(true);
36
35
 
36
+ /* search highlight */
37
37
  if (highlight) {
38
38
  $(".section").find("*").each(function() {
39
39
  try {
@@ -50,11 +50,14 @@ $(document).ready(function() {
50
50
  }
51
51
  });
52
52
  }
53
+ /* admonition */
53
54
  $(".admonition-title").each(function() {
54
55
  $(this).html(ui.admonition[$(this).attr("ui")]);
55
56
  });
57
+ /* anchors */
56
58
  anchors.add();
57
59
 
60
+ /* analytics */
58
61
  analytics.searchParams.append("user_lang", navigator.language);
59
62
  analytics.searchParams.append("host", location.host);
60
63
  analytics.searchParams.append("platform", navigator.platform);
@@ -24,7 +24,7 @@
24
24
  {%- assign level = level | minus: 1 -%}
25
25
  {%- endif -%}
26
26
 
27
- <li class="toctree-l{{ level }} {{ current }}">
27
+ <li class="toctree-l{{ level }} {{ current }}" data-sort="{{ item.sort }}">
28
28
  <a class="reference internal {{ current }}" href="{{ item.url | relative_url }}">
29
29
  {%- if item.sort and site.show_sorted != false -%}
30
30
  {{ item.sort }}. {{ item.title | default: item.url }}
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  {%- assign description = content | strip_html | split: " " | join: " " | escape | truncate: 150 -%}
2
- {%- assign version = "1.1.3" -%}
2
+ {%- assign version = "1.1.4" -%}
3
3
  {%- assign addons = "github, i18n, plugins, analytics" | split: ", " -%}
4
4
 
5
5
  {%- assign schema_date = page.date | default: site.time | date_to_xmlschema -%}
@@ -109,6 +109,7 @@ layout: plugins/compress
109
109
  }
110
110
  };
111
111
  </script>
112
+ {% include extra/head.html %}
112
113
  </head>
113
114
 
114
115
  <body class="wy-body-for-nav">
@@ -177,12 +178,17 @@ layout: plugins/compress
177
178
  </section>
178
179
  </div>
179
180
  {%- if site.addons %}{% include addons.liquid %}{% endif %}
181
+ {% include extra/footer.html %}
180
182
  <!-- script -->
181
183
  <script src="{{ cdn }}/assets/js/theme.js"></script>
182
184
  <script src="{{ cdn }}/assets/js/anchor.min.js"></script>
183
185
  {% comment %} mermaid {% endcomment %}
184
186
  {%- if content contains '<pre class="language-mermaid">' -%}
185
- <script src="{{ cdn }}/assets/js/mermaid.min.js"></script>
187
+ {%- if site.mermaid.src -%}
188
+ <script src="{{ site.mermaid.src }}"></script>
189
+ {%- else -%}
190
+ <script src="{{ cdn }}/assets/js/mermaid.min.js"></script>
191
+ {%- endif -%}
186
192
  <script>mermaid.initialize({startOnLoad: true});</script>
187
193
  {%- endif -%}
188
194
  <script>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-rtd-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - saowang
@@ -47,6 +47,8 @@ files:
47
47
  - _includes/extend/list.liquid
48
48
  - _includes/extend/tabs.liquid
49
49
  - _includes/extend/toctree.liquid
50
+ - _includes/extra/footer.html
51
+ - _includes/extra/head.html
50
52
  - _includes/footer.liquid
51
53
  - _includes/i18n/en.liquid
52
54
  - _includes/i18n/es.liquid