just-the-docs 0.2.8 → 0.2.9
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/css/custom.scss.liquid +1 -0
- data/_includes/css/just-the-docs.scss.liquid +7 -0
- data/_includes/head.html +4 -4
- data/_includes/nav.html +15 -4
- data/_layouts/default.html +43 -6
- data/_layouts/table_wrappers.html +1 -1
- data/_sass/base.scss +14 -17
- data/_sass/code.scss +207 -68
- data/_sass/color_schemes/dark.scss +0 -1
- data/_sass/color_schemes/light.scss +0 -0
- data/_sass/content.scss +33 -0
- data/_sass/custom/custom.scss +0 -129
- data/_sass/labels.scss +5 -4
- data/_sass/layout.scss +3 -2
- data/_sass/modules.scss +19 -0
- data/_sass/support/_functions.scss +2 -3
- data/_sass/support/_variables.scss +7 -6
- data/_sass/support/mixins/_layout.scss +1 -3
- data/_sass/support/mixins/_typography.scss +6 -1
- data/_sass/typography.scss +9 -7
- data/_sass/utilities/_layout.scss +74 -17
- data/_sass/utilities/_spacing.scss +69 -25
- data/assets/css/just-the-docs-dark.scss +3 -0
- data/assets/css/just-the-docs-default.scss +8 -0
- data/assets/css/just-the-docs-light.scss +3 -0
- data/assets/js/just-the-docs.js +14 -0
- data/assets/js/search-data.json +1 -1
- data/lib/tasks/search.rake +2 -2
- metadata +10 -7
- data/_sass/overrides.scss +0 -3
- data/assets/css/dark-mode-preview.scss +0 -45
- data/assets/css/just-the-docs.scss +0 -49
- data/assets/js/dark-mode-preview.js +0 -23
@@ -7,16 +7,31 @@
|
|
7
7
|
|
8
8
|
// Margin spacer utilities
|
9
9
|
|
10
|
+
.mx-auto {
|
11
|
+
margin-right: auto !important;
|
12
|
+
margin-left: auto !important;
|
13
|
+
}
|
14
|
+
|
10
15
|
@for $i from 1 through length($spacers) {
|
11
16
|
$size: #{map-get($spacers, sp-#{$i - 1})};
|
12
17
|
$scale: #{$i - 1};
|
13
18
|
|
14
19
|
// .m-0, .m-1, .m-2...
|
15
|
-
.m-#{$scale}
|
16
|
-
|
17
|
-
|
18
|
-
.
|
19
|
-
|
20
|
+
.m-#{$scale} {
|
21
|
+
margin: #{$size} !important;
|
22
|
+
}
|
23
|
+
.mt-#{$scale} {
|
24
|
+
margin-top: #{$size} !important;
|
25
|
+
}
|
26
|
+
.mr-#{$scale} {
|
27
|
+
margin-right: #{$size} !important;
|
28
|
+
}
|
29
|
+
.mb-#{$scale} {
|
30
|
+
margin-bottom: #{$size} !important;
|
31
|
+
}
|
32
|
+
.ml-#{$scale} {
|
33
|
+
margin-left: #{$size} !important;
|
34
|
+
}
|
20
35
|
|
21
36
|
.mx-#{$scale} {
|
22
37
|
margin-right: #{$size} !important;
|
@@ -32,11 +47,10 @@
|
|
32
47
|
margin-right: -#{$size} !important;
|
33
48
|
margin-left: -#{$size} !important;
|
34
49
|
}
|
35
|
-
}
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
margin-left: auto !important;
|
50
|
+
.mx-#{$scale}-auto {
|
51
|
+
margin-right: auto !important;
|
52
|
+
margin-left: auto !important;
|
53
|
+
}
|
40
54
|
}
|
41
55
|
|
42
56
|
@each $media-query in map-keys($media-queries) {
|
@@ -46,11 +60,21 @@
|
|
46
60
|
$scale: #{$i - 1};
|
47
61
|
|
48
62
|
// .m-sm-0, .m-md-1, .m-lg-2...
|
49
|
-
.m-#{$media-query}-#{$scale}
|
50
|
-
|
51
|
-
|
52
|
-
.
|
53
|
-
|
63
|
+
.m-#{$media-query}-#{$scale} {
|
64
|
+
margin: #{$size} !important;
|
65
|
+
}
|
66
|
+
.mt-#{$media-query}-#{$scale} {
|
67
|
+
margin-top: #{$size} !important;
|
68
|
+
}
|
69
|
+
.mr-#{$media-query}-#{$scale} {
|
70
|
+
margin-right: #{$size} !important;
|
71
|
+
}
|
72
|
+
.mb-#{$media-query}-#{$scale} {
|
73
|
+
margin-bottom: #{$size} !important;
|
74
|
+
}
|
75
|
+
.ml-#{$media-query}-#{$scale} {
|
76
|
+
margin-left: #{$size} !important;
|
77
|
+
}
|
54
78
|
|
55
79
|
.mx-#{$media-query}-#{$scale} {
|
56
80
|
margin-right: #{$size} !important;
|
@@ -77,11 +101,21 @@
|
|
77
101
|
$scale: #{$i - 1};
|
78
102
|
|
79
103
|
// .p-0, .p-1, .p-2...
|
80
|
-
.p-#{$scale}
|
81
|
-
|
82
|
-
|
83
|
-
.
|
84
|
-
|
104
|
+
.p-#{$scale} {
|
105
|
+
padding: #{$size} !important;
|
106
|
+
}
|
107
|
+
.pt-#{$scale} {
|
108
|
+
padding-top: #{$size} !important;
|
109
|
+
}
|
110
|
+
.pr-#{$scale} {
|
111
|
+
padding-right: #{$size} !important;
|
112
|
+
}
|
113
|
+
.pb-#{$scale} {
|
114
|
+
padding-bottom: #{$size} !important;
|
115
|
+
}
|
116
|
+
.pl-#{$scale} {
|
117
|
+
padding-left: #{$size} !important;
|
118
|
+
}
|
85
119
|
|
86
120
|
.px-#{$scale} {
|
87
121
|
padding-right: #{$size} !important;
|
@@ -101,11 +135,21 @@
|
|
101
135
|
$scale: #{$i - 1};
|
102
136
|
|
103
137
|
// .p-sm-0, .p-md-1, .p-lg-2...
|
104
|
-
.p-#{$media-query}-#{$scale}
|
105
|
-
|
106
|
-
|
107
|
-
.
|
108
|
-
|
138
|
+
.p-#{$media-query}-#{$scale} {
|
139
|
+
padding: #{$size} !important;
|
140
|
+
}
|
141
|
+
.pt-#{$media-query}-#{$scale} {
|
142
|
+
padding-top: #{$size} !important;
|
143
|
+
}
|
144
|
+
.pr-#{$media-query}-#{$scale} {
|
145
|
+
padding-right: #{$size} !important;
|
146
|
+
}
|
147
|
+
.pb-#{$media-query}-#{$scale} {
|
148
|
+
padding-bottom: #{$size} !important;
|
149
|
+
}
|
150
|
+
.pl-#{$media-query}-#{$scale} {
|
151
|
+
padding-left: #{$size} !important;
|
152
|
+
}
|
109
153
|
|
110
154
|
.px-#{$media-query}-#{$scale} {
|
111
155
|
padding-right: #{$size} !important;
|
data/assets/js/just-the-docs.js
CHANGED
@@ -279,11 +279,25 @@ function initSearch() {
|
|
279
279
|
}
|
280
280
|
}
|
281
281
|
|
282
|
+
// Focus
|
283
|
+
|
282
284
|
function pageFocus() {
|
283
285
|
var mainContent = document.querySelector('.js-main-content');
|
284
286
|
mainContent.focus();
|
285
287
|
}
|
286
288
|
|
289
|
+
// Switch theme
|
290
|
+
|
291
|
+
jtd.getTheme = function() {
|
292
|
+
var cssFileHref = document.querySelector('[rel="stylesheet"]').getAttribute('href');
|
293
|
+
return cssFileHref.substring(cssFileHref.lastIndexOf('-') + 1, cssFileHref.length - 4);
|
294
|
+
}
|
295
|
+
|
296
|
+
jtd.setTheme = function(theme) {
|
297
|
+
var cssFile = document.querySelector('[rel="stylesheet"]');
|
298
|
+
cssFile.setAttribute('href', '{{ "assets/css/just-the-docs-" | absolute_url }}' + theme + '.css');
|
299
|
+
}
|
300
|
+
|
287
301
|
// Document ready
|
288
302
|
|
289
303
|
jtd.onReady(function(){
|
data/assets/js/search-data.json
CHANGED
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 | 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: '
|
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
|
|
@@ -15,7 +15,7 @@ namespace :search do
|
|
15
15
|
{% assign comma = false %}
|
16
16
|
{% for page in site.html_pages %}{% if page.search_exclude != true %}{% if comma == true%},{% endif %}"{{ forloop.index0 }}": {
|
17
17
|
"title": "{{ page.title | replace: \'&\', \'&\' }}",
|
18
|
-
"content": "
|
18
|
+
"content": "'+content+'",
|
19
19
|
"url": "{{ page.url | absolute_url }}",
|
20
20
|
"relUrl": "{{ page.url }}"
|
21
21
|
}{% assign comma = true %}
|
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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Marsceill
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -17,7 +17,7 @@ dependencies:
|
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 2.1.4
|
20
|
-
type: :
|
20
|
+
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
@@ -89,6 +89,8 @@ files:
|
|
89
89
|
- LICENSE.txt
|
90
90
|
- README.md
|
91
91
|
- Rakefile
|
92
|
+
- _includes/css/custom.scss.liquid
|
93
|
+
- _includes/css/just-the-docs.scss.liquid
|
92
94
|
- _includes/head.html
|
93
95
|
- _includes/head_custom.html
|
94
96
|
- _includes/js/custom.js
|
@@ -106,12 +108,13 @@ files:
|
|
106
108
|
- _sass/buttons.scss
|
107
109
|
- _sass/code.scss
|
108
110
|
- _sass/color_schemes/dark.scss
|
111
|
+
- _sass/color_schemes/light.scss
|
109
112
|
- _sass/content.scss
|
110
113
|
- _sass/custom/custom.scss
|
111
114
|
- _sass/labels.scss
|
112
115
|
- _sass/layout.scss
|
116
|
+
- _sass/modules.scss
|
113
117
|
- _sass/navigation.scss
|
114
|
-
- _sass/overrides.scss
|
115
118
|
- _sass/search.scss
|
116
119
|
- _sass/support/_functions.scss
|
117
120
|
- _sass/support/_variables.scss
|
@@ -131,11 +134,11 @@ files:
|
|
131
134
|
- _sass/vendor/normalize.scss/README.md
|
132
135
|
- _sass/vendor/normalize.scss/normalize.scss
|
133
136
|
- _sass/vendor/normalize.scss/package.json
|
134
|
-
- assets/css/
|
135
|
-
- assets/css/just-the-docs.scss
|
137
|
+
- assets/css/just-the-docs-dark.scss
|
138
|
+
- assets/css/just-the-docs-default.scss
|
139
|
+
- assets/css/just-the-docs-light.scss
|
136
140
|
- assets/images/just-the-docs.png
|
137
141
|
- assets/images/search.svg
|
138
|
-
- assets/js/dark-mode-preview.js
|
139
142
|
- assets/js/just-the-docs.js
|
140
143
|
- assets/js/search-data.json
|
141
144
|
- assets/js/vendor/lunr.min.js
|
data/_sass/overrides.scss
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
---
|
2
|
-
# this ensures Jekyll reads the file to be transformed into CSS later
|
3
|
-
# only Main files contain this front matter, not partials.
|
4
|
-
---
|
5
|
-
|
6
|
-
{% if site.logo %}
|
7
|
-
$logo: "{{ site.logo | absolute_url }}";
|
8
|
-
{% endif %}
|
9
|
-
|
10
|
-
//
|
11
|
-
// Import external dependencies
|
12
|
-
//
|
13
|
-
|
14
|
-
@import "./vendor/normalize.scss/normalize.scss";
|
15
|
-
|
16
|
-
//
|
17
|
-
// Import Just the Docs scss
|
18
|
-
//
|
19
|
-
|
20
|
-
// Support
|
21
|
-
@import "./support/support";
|
22
|
-
|
23
|
-
//
|
24
|
-
// Import custom color scheme scss
|
25
|
-
//
|
26
|
-
|
27
|
-
@import "./color_schemes/dark.scss";
|
28
|
-
|
29
|
-
// Modules
|
30
|
-
@import "./base";
|
31
|
-
@import "./layout";
|
32
|
-
@import "./content";
|
33
|
-
@import "./navigation";
|
34
|
-
@import "./typography";
|
35
|
-
@import "./labels";
|
36
|
-
@import "./buttons";
|
37
|
-
@import "./search";
|
38
|
-
@import "./tables";
|
39
|
-
@import "./code";
|
40
|
-
@import "./utilities/utilities";
|
41
|
-
|
42
|
-
//
|
43
|
-
// Import custom overrides
|
44
|
-
//
|
45
|
-
@import "./custom/custom";
|
@@ -1,49 +0,0 @@
|
|
1
|
-
---
|
2
|
-
# this ensures Jekyll reads the file to be transformed into CSS later
|
3
|
-
# only Main files contain this front matter, not partials.
|
4
|
-
---
|
5
|
-
|
6
|
-
{% if site.logo %}
|
7
|
-
$logo: "{{ site.logo | absolute_url }}";
|
8
|
-
{% endif %}
|
9
|
-
|
10
|
-
//
|
11
|
-
// Import external dependencies
|
12
|
-
//
|
13
|
-
|
14
|
-
@import "./vendor/normalize.scss/normalize.scss";
|
15
|
-
|
16
|
-
//
|
17
|
-
// Import Just the Docs scss
|
18
|
-
//
|
19
|
-
|
20
|
-
// Support
|
21
|
-
@import "./support/support";
|
22
|
-
|
23
|
-
//
|
24
|
-
// Import custom overrides
|
25
|
-
//
|
26
|
-
|
27
|
-
@import "./custom/custom";
|
28
|
-
|
29
|
-
//
|
30
|
-
// Import custom color scheme scss
|
31
|
-
//
|
32
|
-
|
33
|
-
{% if site.color_scheme == "dark" %}
|
34
|
-
@import "./color_schemes/dark.scss";
|
35
|
-
{% endif %}
|
36
|
-
|
37
|
-
// Modules
|
38
|
-
@import "./base";
|
39
|
-
@import "./layout";
|
40
|
-
@import "./content";
|
41
|
-
@import "./navigation";
|
42
|
-
@import "./typography";
|
43
|
-
@import "./labels";
|
44
|
-
@import "./buttons";
|
45
|
-
@import "./search";
|
46
|
-
@import "./tables";
|
47
|
-
@import "./code";
|
48
|
-
@import "./utilities/utilities";
|
49
|
-
@import "./overrides";
|
@@ -1,23 +0,0 @@
|
|
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
|
-
})
|