just-the-docs 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ed236fbe2e6a8dbf8408db5674c662ed9b5b65513e6dab45f7aa965fd93b80a
4
- data.tar.gz: dd4461bac3d6c2b09c28d7c8e3f91409d35097d222c48ce3d013911993066894
3
+ metadata.gz: 8da437a0662b9534edf0a1c8060a5b3894caabe99be0c3ac56ec6e7a8bc825aa
4
+ data.tar.gz: 10ca8573282118ffcbc00cbd17b4cab7ad19955ff87c7d220f44a7caab304216
5
5
  SHA512:
6
- metadata.gz: f1dd17f6683dc2757a208eb709f6655684dce68f8128dbda4d15e6b7ba1fa3cbb362c178f4714352281d8660d4b81cc12ab45db2a3a09bdb546b605cac27ff36
7
- data.tar.gz: 4485b31d17822613e31f92186f9ab63a2e3f062249b127d9bc5cdd05069c56aec25fa7d7c46b52e306893f782ad9929ce331f282ae0f829c90017dd1df0c8616
6
+ metadata.gz: 9c938189dd92258ab2739b451b2f0b8a8967b5c08ae2db274564065b407c049f847271edd9f4016b69fdae5e08b9c2d9c60e38d3c16b2e0c9a7fcd906da93137
7
+ data.tar.gz: 6a72bbb17462114abcdac3fa529c9e0a779d328a755df2a7fbc458fd3cbc3406ae1bd502f587b1bb4805fcea41991e399649302992102a4dcafbd65d762e14ed
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  <br><br>
5
5
  <p align="center">
6
6
  <h1 align="center">Just the Docs</h1>
7
- <p align="center">A modern, high customizable, responsive Jekyll theme for documentation with built-in search.<br>Easily hosted on GitHub Pages with few dependencies.</p>
7
+ <p align="center">A modern, highly customizable, and responsive Jekyll theme for documentation with built-in search.<br>Easily hosted on GitHub Pages with few dependencies.</p>
8
8
  <p align="center"><strong><a href="https://pmarsceill.github.io/just-the-docs/">See it in action!</a></strong></p>
9
9
  <br><br><br>
10
10
  </p>
@@ -1 +1,5 @@
1
- {{ site.title }}
1
+ {% if site.logo %}
2
+ <div class="site-logo"></div>
3
+ {% else %}
4
+ {{ site.title }}
5
+ {% endif %}
@@ -7,6 +7,12 @@ layout: table_wrappers
7
7
  <html lang="{{ site.lang | default: "en-US" }}">
8
8
  {% include head.html %}
9
9
  <body>
10
+ <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
11
+ <symbol id="link" viewBox="0 0 16 16">
12
+ <title>Link</title>
13
+ <path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
14
+ </symbol>
15
+ </svg>
10
16
 
11
17
  <div class="page-wrap">
12
18
  <div class="side-bar">
@@ -60,7 +66,7 @@ layout: table_wrappers
60
66
  {% endunless %}
61
67
  <div id="main-content" class="page-content" role="main">
62
68
  {% if site.heading_anchors != false %}
63
- {% include vendor/anchor_headings.html html=content beforeHeading = "true" anchorBody="<svg class=\"d-inline-block v-align-middle\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"18\" height=\"18\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>" anchorClass="anchor-heading" %}
69
+ {% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><use xlink:href=\"#link\"></use></svg>" anchorClass="anchor-heading" %}
64
70
  {% else %}
65
71
  {{ content }}
66
72
  {% endif %}
@@ -73,7 +79,7 @@ layout: table_wrappers
73
79
  {% for child in children_list %}
74
80
  {% if child.parent == page.title and child.title != page.title %}
75
81
  <li>
76
- <a href="{{ child.url | absolute_url }}">{{ child.title }}</a>
82
+ <a href="{{ child.url | absolute_url }}">{{ child.title }}</a>{% if child.summary %} - {{ child.summary }}{% endif %}
77
83
  </li>
78
84
  {% endif %}
79
85
  {% endfor %}
@@ -88,7 +88,8 @@ code {
88
88
  line-height: $body-line-height;
89
89
  }
90
90
 
91
- figure {
91
+ figure,
92
+ pre {
92
93
  margin: 0;
93
94
  }
94
95
 
@@ -116,26 +116,37 @@
116
116
 
117
117
  .anchor-heading {
118
118
  position: absolute;
119
- right: -$sp-3;
119
+ right: -$sp-4;
120
120
  width: $sp-5;
121
121
  height: 100%;
122
+ padding-right: $sp-1;
123
+ padding-left: $sp-1;
122
124
  overflow: visible;
123
- fill: $link-color;
124
- visibility: hidden;
125
125
 
126
126
  @include mq(md) {
127
127
  right: auto;
128
128
  left: -$sp-5;
129
129
  }
130
+
131
+ svg {
132
+ display: inline-block;
133
+ width: 100%;
134
+ height: 100%;
135
+ fill: $link-color;
136
+ visibility: hidden;
137
+ }
130
138
  }
131
139
 
140
+ .anchor-heading:hover,
132
141
  h1:hover > .anchor-heading,
133
142
  h2:hover > .anchor-heading,
134
143
  h3:hover > .anchor-heading,
135
144
  h4:hover > .anchor-heading,
136
145
  h5:hover > .anchor-heading,
137
146
  h6:hover > .anchor-heading {
138
- visibility: visible;
147
+ svg {
148
+ visibility: visible;
149
+ }
139
150
  }
140
151
 
141
152
  h1,
@@ -125,12 +125,12 @@
125
125
 
126
126
  .site-header {
127
127
  display: flex;
128
+ min-height: $header-height;
128
129
  align-items: center;
129
130
 
130
131
  @include mq(md) {
131
132
  z-index: 101;
132
133
  height: $header-height;
133
- min-height: $header-height;
134
134
  max-height: $header-height;
135
135
  border-bottom: $border $border-color;
136
136
  }
@@ -142,10 +142,26 @@
142
142
  display: flex;
143
143
  height: 100%;
144
144
  align-items: center;
145
- padding-top: $gutter-spacing-sm;
146
- padding-bottom: $gutter-spacing-sm;
145
+ padding-top: $sp-3;
146
+ padding-bottom: $sp-3;
147
147
  color: $body-heading-color;
148
148
  @include fs-6;
149
+
150
+ @include mq(md) {
151
+ padding-top: $sp-2;
152
+ padding-bottom: $sp-2;
153
+ }
154
+ }
155
+
156
+ @if variable-exists(logo) {
157
+ .site-logo {
158
+ width: 100%;
159
+ height: 100%;
160
+ background-image: url($logo);
161
+ background-repeat: no-repeat;
162
+ background-position: left center;
163
+ background-size: contain;
164
+ }
149
165
  }
150
166
 
151
167
  .menu-button {
@@ -0,0 +1,3 @@
1
+ //
2
+ // Custom overrides from a user.
3
+ //
@@ -2,10 +2,16 @@
2
2
  // Utility classes for lists
3
3
  //
4
4
 
5
- // stylelint-disable primer/selector-no-utility, primer/no-override
5
+ // stylelint-disable primer/selector-no-utility, primer/no-override, selector-max-type
6
6
 
7
7
  .list-style-none {
8
8
  padding: 0 !important;
9
9
  margin: 0 !important;
10
10
  list-style: none !important;
11
+
12
+ li {
13
+ &::before {
14
+ display: none !important;
15
+ }
16
+ }
11
17
  }
@@ -3,6 +3,10 @@
3
3
  # only Main files contain this front matter, not partials.
4
4
  ---
5
5
 
6
+ {% if site.logo %}
7
+ $logo: "{{ site.logo | absolute_url }}";
8
+ {% endif %}
9
+
6
10
  //
7
11
  // Import external dependencies
8
12
  //
@@ -3,6 +3,10 @@
3
3
  # only Main files contain this front matter, not partials.
4
4
  ---
5
5
 
6
+ {% if site.logo %}
7
+ $logo: "{{ site.logo | absolute_url }}";
8
+ {% endif %}
9
+
6
10
  //
7
11
  // Import external dependencies
8
12
  //
@@ -42,3 +46,4 @@
42
46
  @import "./tables";
43
47
  @import "./code";
44
48
  @import "./utilities/utilities";
49
+ @import "./overrides";
@@ -0,0 +1,23 @@
1
+ document.addEventListener("DOMContentLoaded", function(){
2
+
3
+ const toggleDarkMode = document.querySelector('.js-toggle-dark-mode')
4
+ const cssFile = document.querySelector('[rel="stylesheet"]')
5
+ const originalCssRef = cssFile.getAttribute('href')
6
+ const darkModeCssRef = originalCssRef.replace('just-the-docs.css', 'dark-mode-preview.css')
7
+ const buttonCopy = ['Return to the light side', 'Preview dark color scheme']
8
+ const updateButtonText = function(toggleDarkMode) {
9
+ toggleDarkMode.textContent === buttonCopy[0] ?
10
+ toggleDarkMode.textContent = buttonCopy[1] :
11
+ toggleDarkMode.textContent = buttonCopy[0]
12
+ }
13
+
14
+ jtd.addEvent(toggleDarkMode, 'click', function(){
15
+ if (cssFile.getAttribute('href') === originalCssRef) {
16
+ cssFile.setAttribute('href', darkModeCssRef)
17
+ updateButtonText(toggleDarkMode)
18
+ } else {
19
+ cssFile.setAttribute('href', originalCssRef)
20
+ updateButtonText(toggleDarkMode)
21
+ }
22
+ })
23
+ })
@@ -52,8 +52,13 @@ function initSearch() {
52
52
  if (request.status >= 200 && request.status < 400) {
53
53
  // Success!
54
54
  var data = JSON.parse(request.responseText);
55
-
55
+
56
+ {% if site.search_tokenizer_separator != nil %}
57
+ lunr.tokenizer.separator = {{ site.search_tokenizer_separator }}
58
+ {% else %}
56
59
  lunr.tokenizer.separator = /[\s\-/]+/
60
+ {% endif %}
61
+
57
62
  var index = lunr(function () {
58
63
  this.ref('id');
59
64
  this.field('title', { boost: 200 });
@@ -1,11 +1,12 @@
1
1
  ---
2
2
  ---
3
3
  {
4
- {% for page in site.html_pages %}{% if page.search_exclude != true %}"{{ forloop.index0 }}": {
4
+ {% assign comma = false %}
5
+ {% for page in site.html_pages %}{% if page.search_exclude != true %}{% if comma == true%},{% endif %}"{{ forloop.index0 }}": {
5
6
  "title": "{{ page.title | replace: '&amp;', '&' }}",
6
7
  "content": "{{ page.content | markdownify | replace: '</h', ' . </h' | replace: '<hr', ' . <hr' | replace: '</p', ' . </p' | replace: '</ul', ' . </ul' | replace: '</tr', ' . </tr' | replace: '</li', ' | </li' | replace: '</td', ' | </td' | strip_html | escape_once | remove: 'Table of contents' | remove: '```' | remove: '---' | replace: '\', ' ' | replace: ' . . . ', ' . ' | replace: ' . . ', ' . ' | normalize_whitespace }}",
7
8
  "url": "{{ page.url | absolute_url }}",
8
9
  "relUrl": "{{ page.url }}"
9
- }{% unless forloop.last %},{% endunless %}
10
+ }{% assign comma = true %}
10
11
  {% endif %}{% endfor %}
11
- }
12
+ }
@@ -4,7 +4,7 @@ namespace :search do
4
4
  puts 'Creating search data json file...'
5
5
  mkdir_p 'assets/js'
6
6
  touch 'assets/js/search-data.json'
7
- content = %Q[{{ page.content | markdownify | strip_html | escape_once | remove: 'Table of contents' | remove: '```' | remove: '---' | replace: '\\', ' ' | normalize_whitespace }}]
7
+ content = %Q[{{ page.content | markdownify | replace: '</h', ' . </h' | replace: '<hr', ' . <hr' | replace: '</p', ' . </p' | replace: '</ul', ' . </ul' | replace: '</tr', ' . </tr' | replace: '</li', ' | </li' | replace: '</td', ' | </td' | strip_html | escape_once | remove: 'Table of contents' | remove: '```' | remove: '---' | replace: '\', ' ' | replace: ' . . . ', ' . ' | replace: ' . . ', ' . ' | normalize_whitespace }}]
8
8
  puts 'Done.'
9
9
  puts 'Generating content...'
10
10
 
@@ -12,13 +12,13 @@ namespace :search do
12
12
  f.puts '---
13
13
  ---
14
14
  {
15
- {% for page in site.html_pages %}{% if page.search_exclude != true %}"{{ forloop.index0 }}": {
16
- "id": "{{ forloop.index0 }}",
17
- "title": "{{ page.title | replace: \'&amp;\', \'&\' }}",
15
+ {% assign comma = false %}
16
+ {% for page in site.html_pages %}{% if page.search_exclude != true %}{% if comma == true%},{% endif %}"{{ forloop.index0 }}": {
17
+ "title": "{{ page.title | replace: '&amp;', '&' }}",
18
18
  "content": "'+content+'",
19
19
  "url": "{{ page.url | absolute_url }}",
20
20
  "relUrl": "{{ page.url }}"
21
- }{% unless forloop.last %},{% endunless %}
21
+ }{% assign comma = true %}
22
22
  {% endif %}{% endfor %}
23
23
  }'
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: just-the-docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Marsceill
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-14 00:00:00.000000000 Z
11
+ date: 2019-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -99,6 +99,7 @@ files:
99
99
  - _sass/labels.scss
100
100
  - _sass/layout.scss
101
101
  - _sass/navigation.scss
102
+ - _sass/overrides.scss
102
103
  - _sass/search.scss
103
104
  - _sass/support/_functions.scss
104
105
  - _sass/support/_variables.scss
@@ -122,6 +123,7 @@ files:
122
123
  - assets/css/just-the-docs.scss
123
124
  - assets/images/just-the-docs.png
124
125
  - assets/images/search.svg
126
+ - assets/js/dark-mode-preview.js
125
127
  - assets/js/just-the-docs.js
126
128
  - assets/js/search-data.json
127
129
  - assets/js/vendor/lunr.min.js
@@ -149,6 +151,6 @@ requirements: []
149
151
  rubygems_version: 3.0.3
150
152
  signing_key:
151
153
  specification_version: 4
152
- summary: A modern, high customizable, responsive Jekyll theme for documention with
153
- built-in search.
154
+ summary: A modern, highly customizable, and responsive Jekyll theme for documention
155
+ with built-in search.
154
156
  test_files: []