just-the-docs 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/_includes/title.html +5 -1
- data/_layouts/default.html +8 -2
- data/_sass/base.scss +2 -1
- data/_sass/content.scss +15 -4
- data/_sass/layout.scss +19 -3
- data/_sass/overrides.scss +3 -0
- data/_sass/utilities/_lists.scss +7 -1
- data/assets/css/dark-mode-preview.scss +4 -0
- data/assets/css/just-the-docs.scss +5 -0
- data/assets/js/dark-mode-preview.js +23 -0
- data/assets/js/just-the-docs.js +6 -1
- data/assets/js/search-data.json +4 -3
- data/lib/tasks/search.rake +5 -5
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8da437a0662b9534edf0a1c8060a5b3894caabe99be0c3ac56ec6e7a8bc825aa
|
4
|
+
data.tar.gz: 10ca8573282118ffcbc00cbd17b4cab7ad19955ff87c7d220f44a7caab304216
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
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>
|
data/_includes/title.html
CHANGED
data/_layouts/default.html
CHANGED
@@ -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
|
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 %}
|
data/_sass/base.scss
CHANGED
data/_sass/content.scss
CHANGED
@@ -116,26 +116,37 @@
|
|
116
116
|
|
117
117
|
.anchor-heading {
|
118
118
|
position: absolute;
|
119
|
-
right: -$sp-
|
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
|
-
|
147
|
+
svg {
|
148
|
+
visibility: visible;
|
149
|
+
}
|
139
150
|
}
|
140
151
|
|
141
152
|
h1,
|
data/_sass/layout.scss
CHANGED
@@ -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: $
|
146
|
-
padding-bottom: $
|
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 {
|
data/_sass/utilities/_lists.scss
CHANGED
@@ -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
|
//
|
@@ -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
|
+
})
|
data/assets/js/just-the-docs.js
CHANGED
@@ -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 });
|
data/assets/js/search-data.json
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
---
|
2
2
|
---
|
3
3
|
{
|
4
|
-
{%
|
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: '&', '&' }}",
|
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
|
-
}{%
|
10
|
+
}{% assign comma = true %}
|
10
11
|
{% endif %}{% endfor %}
|
11
|
-
}
|
12
|
+
}
|
data/lib/tasks/search.rake
CHANGED
@@ -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: '
|
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
|
-
{%
|
16
|
-
|
17
|
-
"title": "{{ page.title | replace:
|
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: '&', '&' }}",
|
18
18
|
"content": "'+content+'",
|
19
19
|
"url": "{{ page.url | absolute_url }}",
|
20
20
|
"relUrl": "{{ page.url }}"
|
21
|
-
}{%
|
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.
|
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-
|
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,
|
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: []
|