hematite 0.1.10 → 0.1.13

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: 7d562db0ed2225f8650bd5c5f4a463b484254df5c5b6324eb7b2febf6f072e0d
4
- data.tar.gz: 415dee3a5e09d9e84f0f2abb907f613bf68edf2a5224816995462148155415ad
3
+ metadata.gz: 5428a81a66f2c162d5db506a782443ab49ec31a2a2b67a02dec1cab941828768
4
+ data.tar.gz: 4a54bb491b61987364791315c6b4024b6fc019a3ba42f5488f43fb7f9c9ff704
5
5
  SHA512:
6
- metadata.gz: f36ce4207f588d36389548a4755140b78738731be85582c8208e7092940254613e5241417825c7a47d0322b606be5958fd46ed593d971e5dc70ecd9b5a506357
7
- data.tar.gz: daf31b575712939d9de6b0fd0c0500727736fd2da81e9e70c7eff7b2229c07f269ad3394c2231542c9594b2c65dccf08ebfa261ab1d42a10ac12782d9ccf82bf
6
+ metadata.gz: '08188e55d1fc0e2f342a186ac1cc57c0226fe7b138cdb5e2f622716b29f4a5cf41768220f9dafb3971d2081dfef5cbee1cb8f485cd6e041589b6a3472a63204f'
7
+ data.tar.gz: 1ddbfb8aa3b14052e0befc9e5dc6b59f1486705dc5f82033337a08a085368e27b6b1a51601db7e26b9578af0fafe74c0b3951a0e3fcda496ff5de23b35ad4b88
data/_config.yml CHANGED
@@ -2,8 +2,8 @@
2
2
  # Settings for the demo site.
3
3
  # `jekyll serve` does not auto-reload this file.
4
4
 
5
- title: The Hematite Theme
6
- short_title: Hematite Theme
5
+ title: Hematite Theme
6
+ # short_title: Add a shortened version of the title for small screens
7
7
  description: A Jekyll theme intended for course websites
8
8
  permalink: pretty
9
9
 
@@ -0,0 +1,70 @@
1
+ <svg
2
+ viewBox="0 0 64.0 64.0"
3
+ version="1.1"
4
+ class="loading-icon-root"
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ xmlns:svg="http://www.w3.org/2000/svg">
7
+ <style>
8
+ .loading-icon-root {
9
+ cursor: pointer;
10
+ width: 64px;
11
+ height: 64px;
12
+ }
13
+
14
+ .loading-icon-root .rect {
15
+ fill: var(--primary-text-color);
16
+
17
+ transform: translate(0, 0);
18
+ transform-origin: 32px 32px;
19
+ animation: loading-icon-anim 1.5s ease infinite;
20
+ }
21
+
22
+ .loading-icon-root .rect2 {
23
+ animation-delay: 0.25s;
24
+ }
25
+
26
+ .loading-icon-root .rect3 {
27
+ animation-delay: 0.5s;
28
+ }
29
+
30
+ .loading-icon-root .rect4 {
31
+ animation-delay: 0.65s;
32
+ }
33
+
34
+ @keyframes loading-icon-anim {
35
+ 0% { transform: rotate(0); }
36
+ 100% { transform: rotate(-360deg) scale(1, 1); }
37
+ }
38
+ </style>
39
+ <g
40
+ id="layer1">
41
+ <rect
42
+ width="9"
43
+ height="9"
44
+ x="10"
45
+ y="10"
46
+ ry="4.5"
47
+ class="rect" />
48
+ <rect
49
+ width="9"
50
+ height="9"
51
+ x="10"
52
+ y="10"
53
+ ry="4.5"
54
+ class="rect rect2" />
55
+ <rect
56
+ width="9"
57
+ height="9"
58
+ x="10"
59
+ y="10"
60
+ ry="4.5"
61
+ class="rect rect3" />
62
+ <rect
63
+ width="9"
64
+ height="9"
65
+ x="10"
66
+ y="10"
67
+ ry="4.5"
68
+ class="rect rect4" />
69
+ </g>
70
+ </svg>
@@ -1,5 +1,5 @@
1
1
 
2
2
  @font-face {
3
3
  font-family: FoulisGreek;
4
- src: url({{ assets/fonts/FoulisGreek.ttf | absolute_path }});
4
+ src: url({{ "assets/fonts/FoulisGreek.ttf" | relative_url }});
5
5
  }
@@ -14,6 +14,12 @@ layout: default
14
14
 
15
15
  {% assign frame_resource_url = 'assets/html/remark_presentation_frame.html' | relative_url %}
16
16
 
17
+ <div class='loading-icon-container'>
18
+ <center>
19
+ {% include img/loading_icon.svg %}
20
+ </center>
21
+ </div>
22
+
17
23
  <main class="slideshow-mode">
18
24
  <iframe
19
25
  id="presentation_frame"
@@ -113,13 +119,18 @@ layout: default
113
119
  `);
114
120
 
115
121
  presentationWin.initPresentation = (async () => {
116
- presentationDoc.title = presentationFrame.title;
117
- await slideshow.start(presentationFrame.contentWindow, config);
118
-
119
- // Ensure that mermaid has already been run!
120
- if (presentationWin.mermaid) {
121
- presentationWin.mermaid.init();
122
- console.log("Ran mermaid!");
122
+ try {
123
+ presentationDoc.title = presentationFrame.title;
124
+ await slideshow.start(presentationFrame.contentWindow, config);
125
+
126
+ // Ensure that mermaid has already been run!
127
+ if (presentationWin.mermaid) {
128
+ presentationWin.mermaid.init();
129
+ }
130
+ }
131
+ finally {
132
+ // Hide the loading icon
133
+ document.querySelector(".loading-icon-container")?.remove();
123
134
  }
124
135
  });
125
136
 
data/_sass/_layout.scss CHANGED
@@ -178,6 +178,9 @@ main.slideshow-mode {
178
178
  // Transition immediately!
179
179
  transition: width 0s ease, max-width 0s ease;
180
180
  }
181
+
182
+ // Don't scroll, let the inner frame do that.
183
+ overflow: hidden;
181
184
  }
182
185
 
183
186
  // On mobile devices,
@@ -20,7 +20,14 @@ h1, h2, h3 {
20
20
  font-weight: normal;
21
21
  }
22
22
 
23
- .remark-code, .remark-inline-code { font-family: 'Ubuntu Mono', monospace; }
23
+ .remark-code, .remark-inline-code, body.mdSourceView {
24
+ font-family: 'Ubuntu Mono', monospace;
25
+ }
26
+
27
+ body.mdSourceView {
28
+ background: white;
29
+ color: black;
30
+ }
24
31
 
25
32
  /* Show hidden slides to allow preprocessors (e.g. mermaid) to
26
33
  properly account for container size.
@@ -77,6 +77,20 @@ function focusSlideFromHash(slideshow) {
77
77
  }
78
78
  }
79
79
 
80
+ /// Returns true iff the slide viewer should only display markdown.
81
+ function shouldOnlyDisplayMd() {
82
+ let pageArgs = UrlHelper.getPageArgs();
83
+ if (!pageArgs) {
84
+ return false;
85
+ }
86
+
87
+ if (pageArgs.md_only) {
88
+ return true;
89
+ }
90
+
91
+ return false;
92
+ }
93
+
80
94
  async function main(targetWindow, config) {
81
95
  // True if touch navigation is enabled.
82
96
  let usingCustomTouchNav = false;
@@ -88,6 +102,13 @@ async function main(targetWindow, config) {
88
102
  }));
89
103
  }
90
104
 
105
+ // If the user has requested that only the page's markdown be shown,
106
+ if (shouldOnlyDisplayMd()) {
107
+ targetWindow.document.body.innerText = config?.source;
108
+ targetWindow.document.body.classList.add('mdSourceView');
109
+ return;
110
+ }
111
+
91
112
  // Customize touchscreen navigation — the default remark
92
113
  // navigation can break buttons, zooming.
93
114
  if (config?.navigation?.touch === true
@@ -150,6 +171,7 @@ async function main(targetWindow, config) {
150
171
 
151
172
  if (handlingGesture) {
152
173
  evt.preventDefault();
174
+ elemContainer.setPointerCapture();
153
175
  }
154
176
  }
155
177
  });
@@ -205,16 +227,20 @@ function addExtendedControls(targetWindow, slideshow) {
205
227
  targetWindow.print();
206
228
  };
207
229
 
230
+ let updateBtns = (slideIdx) => {
231
+ prevSlideBtn.disabled = (slideIdx == 0);
232
+ nextSlideBtn.disabled = (slideIdx + 1 >= slideshow.getSlideCount());
233
+ };
234
+
208
235
  slideshow.on('showSlide', function(newSlide) {
209
236
  if (!newSlide) {
210
237
  return;
211
238
  }
212
239
 
213
- prevSlideBtn.disabled = (newSlide.getSlideIndex() == 0);
214
- nextSlideBtn.disabled = (newSlide.getSlideIndex() + 1 >= slideshow.getSlideCount());
240
+ updateBtns(newSlide.getSlideIndex());
215
241
  });
216
242
 
217
-
243
+ updateBtns(0);
218
244
 
219
245
  nav.replaceChildren(prevSlideBtn, nextSlideBtn, spacer, printBtn);
220
246
  targetWindow.document.body.appendChild(nav);
data/assets/js/search.mjs CHANGED
@@ -50,15 +50,25 @@ class Searcher {
50
50
  .replaceAll(/[&]ldquo;/g, '"')
51
51
  .replaceAll(/[&]rdquo;/g, '"')
52
52
  .replaceAll(/[&]amp;/g, "&")
53
+ // Remove the astrisks around **bolded** text
54
+ .replaceAll(/(\s|^)[*]{2}[^*]+[*]{2}(\s|$)/g, "$1$2$3")
55
+ // Remove the backticks around `text` that is code-formatted
56
+ .replaceAll(/(\s|^)[`]([^`]+)[`](\s|$)/g, "$1$2$3") // `
53
57
  .replaceAll(/\s+/g, ' ');
54
58
 
55
59
  }
56
60
 
61
+ filterQuery_(query) {
62
+ return query
63
+ .toLowerCase()
64
+ .replaceAll(/\s+/g, ' ');
65
+ }
66
+
57
67
  /// Get number of full matches for [query] in [text].
58
68
  /// @precondition [text] is already in a searchable (i.e.
59
69
  /// filtered) form.
60
70
  getNumberOfMatches(query, text) {
61
- query = query.toLowerCase();
71
+ query = this.filterQuery_(query);
62
72
 
63
73
  return text.toLowerCase().split(query).length - 1;
64
74
  }
@@ -68,7 +78,7 @@ class Searcher {
68
78
  /// is found.
69
79
  /// @precondition [text] is already in a searchable form.
70
80
  getIdxOfFirstMatch(query, text, startPos) {
71
- query = query.toLowerCase();
81
+ query = this.filterQuery_(query);
72
82
 
73
83
  return text.toLowerCase().indexOf(query, startPos);
74
84
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hematite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henry Heino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-28 00:00:00.000000000 Z
11
+ date: 2022-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -37,6 +37,7 @@ files:
37
37
  - _includes/extern_library_imports.html
38
38
  - _includes/footer.html
39
39
  - _includes/img/hamburger_menu.svg
40
+ - _includes/img/loading_icon.svg
40
41
  - _includes/img/search_icon.svg
41
42
  - _includes/katex_includes.html
42
43
  - _includes/mermaid_includes.html