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.
@@ -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} { margin: #{$size} !important; }
16
- .mt-#{$scale} { margin-top: #{$size} !important; }
17
- .mr-#{$scale} { margin-right: #{$size} !important; }
18
- .mb-#{$scale} { margin-bottom: #{$size} !important; }
19
- .ml-#{$scale} { margin-left: #{$size} !important; }
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
- .mx-auto {
38
- margin-right: auto !important;
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} { margin: #{$size} !important; }
50
- .mt-#{$media-query}-#{$scale} { margin-top: #{$size} !important; }
51
- .mr-#{$media-query}-#{$scale} { margin-right: #{$size} !important; }
52
- .mb-#{$media-query}-#{$scale} { margin-bottom: #{$size} !important; }
53
- .ml-#{$media-query}-#{$scale} { margin-left: #{$size} !important; }
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} { padding: #{$size} !important; }
81
- .pt-#{$scale} { padding-top: #{$size} !important; }
82
- .pr-#{$scale} { padding-right: #{$size} !important; }
83
- .pb-#{$scale} { padding-bottom: #{$size} !important; }
84
- .pl-#{$scale} { padding-left: #{$size} !important; }
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} { padding: #{$size} !important; }
105
- .pt-#{$media-query}-#{$scale} { padding-top: #{$size} !important; }
106
- .pr-#{$media-query}-#{$scale} { padding-right: #{$size} !important; }
107
- .pb-#{$media-query}-#{$scale} { padding-bottom: #{$size} !important; }
108
- .pl-#{$media-query}-#{$scale} { padding-left: #{$size} !important; }
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;
@@ -0,0 +1,3 @@
1
+ ---
2
+ ---
3
+ {% include css/just-the-docs.scss.liquid color_scheme="dark" %}
@@ -0,0 +1,8 @@
1
+ ---
2
+ ---
3
+ {% if site.color_scheme and site.color_scheme != "nil" %}
4
+ {% assign color_scheme = site.color_scheme %}
5
+ {% else %}
6
+ {% assign color_scheme = "light" %}
7
+ {% endif %}
8
+ {% include css/just-the-docs.scss.liquid color_scheme=color_scheme %}
@@ -0,0 +1,3 @@
1
+ ---
2
+ ---
3
+ {% include css/just-the-docs.scss.liquid color_scheme="light" %}
@@ -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(){
@@ -9,4 +9,4 @@
9
9
  "relUrl": "{{ page.url }}"
10
10
  }{% assign comma = true %}
11
11
  {% endif %}{% endfor %}
12
- }
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 | 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
+ 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: \'&amp;\', \'&\' }}",
18
- "content": "\'+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.8
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-04-23 00:00:00.000000000 Z
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: :runtime
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/dark-mode-preview.scss
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
@@ -1,3 +0,0 @@
1
- //
2
- // Custom overrides from a user.
3
- //
@@ -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
- })