jekyll-theme-hydejack 8.3.2 → 8.4.0
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 +4 -4
- data/README.md +26 -27
- data/_includes/body/footer.html +1 -1
- data/_includes/head/links.html +1 -1
- data/_includes/head/meta.html +5 -1
- data/_includes/head/styles.html +1 -1
- data/_includes/header.txt +1 -1
- data/_includes/scripts.html +33 -0
- data/_layouts/compress.html +1 -1
- data/assets/bower_components/katex/.bower.json +6 -6
- data/assets/bower_components/katex/bower.json +1 -1
- data/assets/bower_components/katex/dist/contrib/auto-render.js +4 -0
- data/assets/bower_components/katex/dist/contrib/auto-render.min.js +1 -1
- data/assets/bower_components/katex/dist/contrib/auto-render.mjs +215 -0
- data/assets/bower_components/katex/dist/contrib/copy-tex.js +9 -4
- data/assets/bower_components/katex/dist/contrib/copy-tex.min.css +1 -1
- data/assets/bower_components/katex/dist/contrib/copy-tex.min.js +1 -1
- data/assets/bower_components/katex/dist/contrib/copy-tex.mjs +85 -0
- data/assets/bower_components/katex/dist/contrib/mathtex-script-type.min.js +1 -1
- data/assets/bower_components/katex/dist/contrib/mathtex-script-type.mjs +24 -0
- data/assets/bower_components/katex/dist/contrib/mhchem.js +3241 -0
- data/assets/bower_components/katex/dist/contrib/mhchem.min.js +1 -0
- data/assets/bower_components/katex/dist/contrib/mhchem.mjs +3109 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/katex.css +8 -4
- data/assets/bower_components/katex/dist/katex.js +470 -414
- data/assets/bower_components/katex/dist/katex.min.css +1 -1
- data/assets/bower_components/katex/dist/katex.min.js +1 -1
- data/assets/bower_components/katex/dist/katex.mjs +495 -456
- data/assets/bower_components/katex/yarn.lock +3091 -2622
- data/assets/css/{hydejack-8.3.2.css → hydejack-7.5.2.css} +0 -0
- data/assets/css/hydejack-8.4.0.css +3 -0
- data/assets/js/hydejack-8.4.0.js +47 -0
- data/assets/version.json +1 -1
- metadata +12 -5
- data/assets/bower_components/katex/dist/README.md +0 -90
- data/assets/bower_components/katex/lint_blacklist.txt +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 12a2ea5a7563b85475351cfeb46e01ff40521977
|
|
4
|
+
data.tar.gz: 85c04dea0b8e7be84303a8dae2eb55af0f0dce30
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 58910d20fddb272eed7b832918b40648aab4aab3e4e2176367c9ab516e889e6648f9789b9541fc883ac48ad3e30ff664141c5b78d8db0006de55e96e88f1f60a
|
|
7
|
+
data.tar.gz: 5f04362e44fe40d162277de2aa1847cb19ef5855c9e5e04ef9f4761d0152b67808156f561aa21381c54b793338ee7ab261cddef7cfba86bec953b7f7fb3442a6
|
data/README.md
CHANGED
|
@@ -14,9 +14,25 @@ Hydejack's cover page on a variety of screens.
|
|
|
14
14
|
|
|
15
15
|
There are two versions of **Hydejack**: The base version is free, while features that are specific to *professionals* are a payed upgrade.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
| | Free | PRO |
|
|
18
|
+
|:-----------------------|:--------------:|:--------:|
|
|
19
|
+
| Blog | ✔ | ✔ |
|
|
20
|
+
| [Features] | ✔ | ✔ |
|
|
21
|
+
| [Portfolio] | | ✔ |
|
|
22
|
+
| [Resume] | | ✔ |
|
|
23
|
+
| [Welcome] | | ✔ |
|
|
24
|
+
| [Newsletter Box][news] | | ✔ |
|
|
25
|
+
| [Custom Forms][forms] | | ✔ |
|
|
26
|
+
| Dark Mode | | ✔ |
|
|
27
|
+
| Cookie Banner | | ✔ |
|
|
28
|
+
| Offline Support | | ✔ |
|
|
29
|
+
| No Hydejack Branding | | ✔ |
|
|
30
|
+
| License | [GPL-3.0][lic] | [PRO] |
|
|
31
|
+
| Source | [GitHub][src] | Included |
|
|
32
|
+
| Support[^1] | No | No |
|
|
33
|
+
| Price | Free | $59 |
|
|
34
|
+
| | [**Download**][kit] <br/>-- or --<br/> [![Deploy to Netlify][dtn]][nfy] | [**Buy PRO**][buy] |
|
|
35
|
+
|
|
20
36
|
|
|
21
37
|
|
|
22
38
|
## A Free Blogging Theme
|
|
@@ -64,32 +80,12 @@ They say math is beautiful — and with **Hydejack**'s [math support][latex] it'
|
|
|
64
80
|
Hydejack uses KaTeX to efficiently render math.
|
|
65
81
|
|
|
66
82
|
|
|
67
|
-
<!-- $$
|
|
68
|
-
\begin{aligned}
|
|
69
|
-
\phi(x,y) &= \phi \left(\sum_{i=1}^n x_ie_i, \sum_{j=1}^n y_je_j \right) \\[2em]
|
|
70
|
-
&= \sum_{i=1}^n \sum_{j=1}^n x_i y_j \phi(e_i, e_j) \\[2em]
|
|
71
|
-
&= (x_1, \ldots, x_n)
|
|
72
|
-
\left(\begin{array}{ccc}
|
|
73
|
-
\phi(e_1, e_1) & \cdots & \phi(e_1, e_n) \\
|
|
74
|
-
\vdots & \ddots & \vdots \\
|
|
75
|
-
\phi(e_n, e_1) & \cdots & \phi(e_n, e_n)
|
|
76
|
-
\end{array}\right)
|
|
77
|
-
\left(\begin{array}{c}
|
|
78
|
-
y_1 \\
|
|
79
|
-
\vdots \\
|
|
80
|
-
y_n
|
|
81
|
-
\end{array}\right)
|
|
82
|
-
\end{aligned}
|
|
83
|
-
$$ -->
|
|
84
|
-
|
|
85
83
|
|
|
86
84
|
## Build an Audience
|
|
87
85
|
The PRO version has built-in support for customizable [Tinyletter] newsletter subscription boxes.
|
|
88
86
|
|
|
89
87
|
If you are using a different service like MailChimp, you can build a custom newsletter subscription box using [Custom Forms][forms].
|
|
90
88
|
|
|
91
|
-
{% include pro/newsletter.html %}
|
|
92
|
-
|
|
93
89
|
|
|
94
90
|
## A Personal Site That Belongs to You
|
|
95
91
|
**Hydejack** is 100% built on Open Source software, and is Open Source itself, save for parts of the PRO version. The PRO version is a one-time payment that gives you the right to use it forever.
|
|
@@ -103,7 +99,7 @@ An incomplete list of features included in all versions of **Hydejack**:
|
|
|
103
99
|
* Lazy image loading with cancellation and placeholder, powered by [hy-img]
|
|
104
100
|
* Advanced FLIP animations, inspired by Material Design
|
|
105
101
|
* 99/100 [Google PageSpeed Score][gpss][^2]
|
|
106
|
-
* [Syntax highlighting]
|
|
102
|
+
* [Syntax highlighting][syntax], powered by [Rouge]
|
|
107
103
|
* [LaTeX math blocks][latex], powered by [KaTeX]
|
|
108
104
|
* Change the wording of built-in strings and possibly translate in other languages
|
|
109
105
|
* Support for categories and tags
|
|
@@ -112,7 +108,6 @@ An incomplete list of features included in all versions of **Hydejack**:
|
|
|
112
108
|
* Structured Data for core entities
|
|
113
109
|
* Author section below each article and support for multiple authors
|
|
114
110
|
* Google Analytics and Google Fonts support
|
|
115
|
-
* Disqus comments
|
|
116
111
|
|
|
117
112
|
|
|
118
113
|
## Download
|
|
@@ -139,7 +134,9 @@ This table below shows what's included in each version:
|
|
|
139
134
|
| Source | [GitHub][src] | Included |
|
|
140
135
|
| Support[^1] | No | No |
|
|
141
136
|
| Price | Free | $59 |
|
|
142
|
-
| | [**Download**][kit] | [**Buy PRO**][buy] |
|
|
137
|
+
| | [**Download**][kit] <br/>-- or --<br/> [![Deploy to Netlify][dtn]][nfy] | [**Buy PRO**][buy] |
|
|
138
|
+
|
|
139
|
+
|
|
143
140
|
|
|
144
141
|
|
|
145
142
|
[^1]: You MAY open an issue on GitHub, but no response and/or fix is guaranteed.
|
|
@@ -163,10 +160,12 @@ This table below shows what's included in each version:
|
|
|
163
160
|
[pro]: licenses/PRO.md
|
|
164
161
|
[docs]: docs/README.md
|
|
165
162
|
|
|
166
|
-
[kit]: https://github.com/qwtel/
|
|
163
|
+
[kit]: https://github.com/qwtel/hydejack-starter-kit/archive/v8.4.0.zip
|
|
167
164
|
[src]: https://github.com/qwtel/hydejack
|
|
168
165
|
[gem]: https://rubygems.org/gems/jekyll-theme-hydejack
|
|
169
166
|
[buy]: https://app.simplegoods.co/i/NATYVLYT
|
|
167
|
+
[nfy]: https://app.netlify.com/start/deploy?repository=https://github.com/qwtel/hydejack-starter-kit
|
|
168
|
+
[dtn]: https://www.netlify.com/img/deploy/button.svg
|
|
170
169
|
|
|
171
170
|
[gpss]: https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fhydejack.com%2F
|
|
172
171
|
[hy-push-state]: https://qwtel.com/hy-push-state/
|
data/_includes/body/footer.html
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
{% endfor %}
|
|
14
14
|
</small></nav>
|
|
15
15
|
{% endif %}
|
|
16
|
-
<p><small>Powered by <a class="external" href="https://hydejack.com/">Hydejack</a> v<span id="_version">8.
|
|
16
|
+
<p><small>Powered by <a class="external" href="https://hydejack.com/">Hydejack</a> v<span id="_version">8.4.0</span></small></p>
|
|
17
17
|
<hr class="sr-only"/>
|
|
18
18
|
</footer>
|
|
19
19
|
{% endif %}
|
data/_includes/head/links.html
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
This is to avoid hard-coding URLs in JS (where they can't be discovered by automated tools).
|
|
21
21
|
-->{% endcomment %}
|
|
22
22
|
<link rel="dns-prefetch" href="{{ '/' | relative_url }}" id="_baseURL">
|
|
23
|
-
<link rel="dns-prefetch" href="{{ '/assets/js/hydejack-8.
|
|
23
|
+
<link rel="dns-prefetch" href="{{ '/assets/js/hydejack-8.4.0.js' | relative_url }}" id="_hrefJS">
|
|
24
24
|
<link rel="dns-prefetch" href="{{ '/sw.js' | relative_url }}" id="_hrefSW">
|
|
25
25
|
<link rel="dns-prefetch" href="{{ '/assets/bower_components/fontfaceobserver/fontfaceobserver.standalone.js' | relative_url }}" id="_hrefFFO">
|
|
26
26
|
<link rel="dns-prefetch" href="{{ '/assets/bower_components/katex/dist/katex.min.js' | relative_url }}" id="_hrefKatexJS">
|
data/_includes/head/meta.html
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
3
3
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
4
4
|
|
|
5
|
+
{% if page.noindex %}
|
|
6
|
+
<meta name="robots" content="noindex">
|
|
7
|
+
{% endif %}
|
|
8
|
+
|
|
5
9
|
{% unless page.redirect %}
|
|
6
10
|
{% if plugins contains 'jekyll-seo-tag' %}{% include head/seo-tag.html %}
|
|
7
11
|
{% else %}{% include head/seo-fallback.html %}{% endif %}
|
|
@@ -27,4 +31,4 @@
|
|
|
27
31
|
<meta name="theme-color" content="{{ theme_color | default:'#193747' }}">
|
|
28
32
|
{% endunless %}
|
|
29
33
|
|
|
30
|
-
<meta name="generator" content="Hydejack v8.
|
|
34
|
+
<meta name="generator" content="Hydejack v8.4.0" />
|
data/_includes/head/styles.html
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--[if gt IE 8]><!---->
|
|
2
|
-
{% capture style_url %}{% link assets/css/hydejack-8.
|
|
2
|
+
{% capture style_url %}{% link assets/css/hydejack-8.4.0.css %}{% endcapture %}
|
|
3
3
|
{% capture icons_url %}{% link assets/icomoon/style.css %}{% endcapture %}
|
|
4
4
|
{% capture fonts_url %}https://fonts.googleapis.com/css?family={{ google_fonts }}{% endcapture %}
|
|
5
5
|
|
data/_includes/header.txt
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{% unless page.redirect %}
|
|
2
|
+
{% if site.google_analytics %}
|
|
3
|
+
<script>
|
|
4
|
+
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
|
5
|
+
{% if site.hydejack.cookies_banner %}
|
|
6
|
+
if (navigator.CookiesOK) {
|
|
7
|
+
ga('create', '{{ site.google_analytics }}', 'auto');
|
|
8
|
+
} else if (localStorage && localStorage.getItem('hy:cookiesOK')) {
|
|
9
|
+
ga('create', '{{ site.google_analytics }}', {
|
|
10
|
+
'storage': 'none',
|
|
11
|
+
'clientId': localStorage.getItem('ga:clientId')
|
|
12
|
+
});
|
|
13
|
+
} else {
|
|
14
|
+
ga('create', '{{ site.google_analytics }}', {
|
|
15
|
+
'storage': 'none'
|
|
16
|
+
});
|
|
17
|
+
ga('set', 'forceSSL', true);
|
|
18
|
+
ga('set', 'anonymizeIp', true);
|
|
19
|
+
}
|
|
20
|
+
{% else %}
|
|
21
|
+
ga('create', '{{ site.google_analytics }}', 'auto');
|
|
22
|
+
{% endif %}
|
|
23
|
+
ga('send', 'pageview');
|
|
24
|
+
loadJSDeferred('https://www.google-analytics.com/analytics.js');
|
|
25
|
+
</script>
|
|
26
|
+
{% endif %}
|
|
27
|
+
|
|
28
|
+
<!--[if gt IE 9]><!---->
|
|
29
|
+
{% capture js_url %}{% link assets/js/hydejack-7.5.2.js %}{% endcapture %}
|
|
30
|
+
<script>loadJSDeferred('{{ js_url | relative_url }}');</script>
|
|
31
|
+
{% include my-scripts.html %}
|
|
32
|
+
<!--<![endif]-->
|
|
33
|
+
{% endunless %}
|
data/_layouts/compress.html
CHANGED
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
/\___/ \ \____/
|
|
11
11
|
\/__/ \/___/
|
|
12
12
|
|
|
13
|
-
Powered by Hydejack v8.
|
|
13
|
+
Powered by Hydejack v8.4.0 <https://hydejack.com/>
|
|
14
14
|
-->{% capture _LINE_FEED %}
|
|
15
15
|
{% endcapture %}{% if site.compress_html.ignore.envs contains jekyll.environment %}{{ content }}{% else %}{% capture _content %}{{ content }}{% endcapture %}{% assign _profile = site.compress_html.profile %}{% if site.compress_html.endings == "all" %}{% assign _endings = "html head body li dt dd p rt rp optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% else %}{% assign _endings = site.compress_html.endings %}{% endif %}{% for _element in _endings %}{% capture _end %}</{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if _profile and _endings %}{% assign _profile_endings = _content | size | plus: 1 %}{% endif %}{% for _element in site.compress_html.startings %}{% capture _start %}<{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _start %}{% endfor %}{% if _profile and site.compress_html.startings %}{% assign _profile_startings = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.comments == "all" %}{% assign _comments = "<!-- -->" | split: " " %}{% else %}{% assign _comments = site.compress_html.comments %}{% endif %}{% if _comments.size == 2 %}{% capture _comment_befores %}.{{ _content }}{% endcapture %}{% assign _comment_befores = _comment_befores | split: _comments.first %}{% for _comment_before in _comment_befores %}{% if forloop.first %}{% continue %}{% endif %}{% capture _comment_outside %}{% if _carry %}{{ _comments.first }}{% endif %}{{ _comment_before }}{% endcapture %}{% capture _comment %}{% unless _carry %}{{ _comments.first }}{% endunless %}{{ _comment_outside | split: _comments.last | first }}{% if _comment_outside contains _comments.last %}{{ _comments.last }}{% assign _carry = false %}{% else %}{% assign _carry = true %}{% endif %}{% endcapture %}{% assign _content = _content | remove_first: _comment %}{% endfor %}{% if _profile %}{% assign _profile_comments = _content | size | plus: 1 %}{% endif %}{% endif %}{% assign _pre_befores = _content | split: "<pre" %}{% assign _content = "" %}{% for _pre_before in _pre_befores %}{% assign _pres = _pre_before | split: "</pre>" %}{% assign _pres_after = "" %}{% if _pres.size != 0 %}{% if site.compress_html.blanklines %}{% assign _lines = _pres.last | split: _LINE_FEED %}{% capture _pres_after %}{% for _line in _lines %}{% assign _trimmed = _line | split: " " | join: " " %}{% if _trimmed != empty or forloop.last %}{% unless forloop.first %}{{ _LINE_FEED }}{% endunless %}{{ _line }}{% endif %}{% endfor %}{% endcapture %}{% else %}{% assign _pres_after = _pres.last | split: " " | join: " " %}{% endif %}{% endif %}{% capture _content %}{{ _content }}{% if _pre_before contains "</pre>" %}<pre{{ _pres.first }}</pre>{% endif %}{% unless _pre_before contains "</pre>" and _pres.size == 1 %}{{ _pres_after }}{% endunless %}{% endcapture %}{% endfor %}{% if _profile %}{% assign _profile_collapse = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.clippings == "all" %}{% assign _clippings = "html head title base link meta style body article section nav aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr blockquote ol ul li dl dt dd figure figcaption main div table caption colgroup col tbody thead tfoot tr td th" | split: " " %}{% else %}{% assign _clippings = site.compress_html.clippings %}{% endif %}{% for _element in _clippings %}{% assign _edges = " <e;<e; </e>;</e>;</e> ;</e>" | replace: "e", _element | split: ";" %}{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}{% endfor %}{% if _profile and _clippings %}{% assign _profile_clippings = _content | size | plus: 1 %}{% endif %}{{ _content }}{% if _profile %} <table id="compress_html_profile_{{ site.time | date: "%Y%m%d" }}" class="compress_html_profile"> <thead> <tr> <td>Step <td>Bytes <tbody> <tr> <td>raw <td>{{ content | size }}{% if _profile_endings %} <tr> <td>endings <td>{{ _profile_endings }}{% endif %}{% if _profile_startings %} <tr> <td>startings <td>{{ _profile_startings }}{% endif %}{% if _profile_comments %} <tr> <td>comments <td>{{ _profile_comments }}{% endif %}{% if _profile_collapse %} <tr> <td>collapse <td>{{ _profile_collapse }}{% endif %}{% if _profile_clippings %} <tr> <td>clippings <td>{{ _profile_clippings }}{% endif %} </table>{% endif %}{% endif %}</html>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
|
-
"url": "git://github.com/
|
|
17
|
+
"url": "git://github.com/KaTeX/KaTeX.git"
|
|
18
18
|
},
|
|
19
19
|
"ignore": [
|
|
20
20
|
"**/.*",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"/static",
|
|
34
34
|
"/website"
|
|
35
35
|
],
|
|
36
|
-
"version": "0.10.
|
|
37
|
-
"_release": "0.10.
|
|
36
|
+
"version": "0.10.1",
|
|
37
|
+
"_release": "0.10.1",
|
|
38
38
|
"_resolution": {
|
|
39
39
|
"type": "version",
|
|
40
|
-
"tag": "v0.10.
|
|
41
|
-
"commit": "
|
|
40
|
+
"tag": "v0.10.1",
|
|
41
|
+
"commit": "e77bf08983d4d5f8df6490e703173fa9ea9aac8b"
|
|
42
42
|
},
|
|
43
43
|
"_source": "https://github.com/Khan/KaTeX.git",
|
|
44
|
-
"_target": "0.10.
|
|
44
|
+
"_target": "0.10.1",
|
|
45
45
|
"_originalSource": "katex",
|
|
46
46
|
"_direct": true
|
|
47
47
|
}
|
|
@@ -242,6 +242,10 @@ var auto_render_renderMathInText = function renderMathInText(text, optionsCopy)
|
|
|
242
242
|
optionsCopy.displayMode = data[i].display;
|
|
243
243
|
|
|
244
244
|
try {
|
|
245
|
+
if (optionsCopy.preProcess) {
|
|
246
|
+
math = optionsCopy.preProcess(math);
|
|
247
|
+
}
|
|
248
|
+
|
|
245
249
|
external_katex_default.a.render(math, span, optionsCopy);
|
|
246
250
|
} catch (e) {
|
|
247
251
|
if (!(e instanceof external_katex_default.a.ParseError)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,function(
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n),a=function(e,t,r){for(var n=r,o=0,a=e.length;n<t.length;){var i=t[n];if(o<=0&&t.slice(n,n+a)===e)return n;"\\"===i?n++:"{"===i?o++:"}"===i&&o--,n++}return-1},i=function(e,t,r,n){for(var o=[],i=0;i<e.length;i++)if("text"===e[i].type){var l=e[i].data,d=!0,s=0,f=void 0;for(-1!==(f=l.indexOf(t))&&(s=f,o.push({type:"text",data:l.slice(0,s)}),d=!1);;){if(d){if(-1===(f=l.indexOf(t,s)))break;o.push({type:"text",data:l.slice(s,f)}),s=f}else{if(-1===(f=a(r,l,s+t.length)))break;o.push({type:"math",data:l.slice(s+t.length,f),rawData:l.slice(s,f+r.length),display:n}),s=f+r.length}d=!d}o.push({type:"text",data:l.slice(s)})}else o.push(e[i]);return o},l=function(e,t){for(var r=function(e,t){for(var r=[{type:"text",data:e}],n=0;n<t.length;n++){var o=t[n];r=i(r,o.left,o.right,o.display||!1)}return r}(e,t.delimiters),n=document.createDocumentFragment(),a=0;a<r.length;a++)if("text"===r[a].type)n.appendChild(document.createTextNode(r[a].data));else{var l=document.createElement("span"),d=r[a].data;t.displayMode=r[a].display;try{t.preProcess&&(d=t.preProcess(d)),o.a.render(d,l,t)}catch(e){if(!(e instanceof o.a.ParseError))throw e;t.errorCallback("KaTeX auto-render: Failed to parse `"+r[a].data+"` with ",e),n.appendChild(document.createTextNode(r[a].rawData));continue}n.appendChild(l)}return n};t.default=function(e,t){if(!e)throw new Error("No element provided to render");var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);r.delimiters=r.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\[",right:"\\]",display:!0}],r.ignoredTags=r.ignoredTags||["script","noscript","style","textarea","pre","code"],r.ignoredClasses=r.ignoredClasses||[],r.errorCallback=r.errorCallback||console.error,r.macros=r.macros||{},function e(t,r){for(var n=0;n<t.childNodes.length;n++){var o=t.childNodes[n];if(3===o.nodeType){var a=l(o.textContent,r);n+=a.childNodes.length-1,t.replaceChild(a,o)}else 1===o.nodeType&&function(){var t=" "+o.className+" ";-1===r.ignoredTags.indexOf(o.nodeName.toLowerCase())&&r.ignoredClasses.every(function(e){return-1===t.indexOf(" "+e+" ")})&&e(o,r)}()}}(e,r)}}]).default});
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import katex from '../katex.mjs';
|
|
2
|
+
|
|
3
|
+
/* eslint no-constant-condition:0 */
|
|
4
|
+
const findEndOfMath = function findEndOfMath(delimiter, text, startIndex) {
|
|
5
|
+
// Adapted from
|
|
6
|
+
// https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx
|
|
7
|
+
let index = startIndex;
|
|
8
|
+
let braceLevel = 0;
|
|
9
|
+
const delimLength = delimiter.length;
|
|
10
|
+
|
|
11
|
+
while (index < text.length) {
|
|
12
|
+
const character = text[index];
|
|
13
|
+
|
|
14
|
+
if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) {
|
|
15
|
+
return index;
|
|
16
|
+
} else if (character === "\\") {
|
|
17
|
+
index++;
|
|
18
|
+
} else if (character === "{") {
|
|
19
|
+
braceLevel++;
|
|
20
|
+
} else if (character === "}") {
|
|
21
|
+
braceLevel--;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
index++;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return -1;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const splitAtDelimiters = function splitAtDelimiters(startData, leftDelim, rightDelim, display) {
|
|
31
|
+
const finalData = [];
|
|
32
|
+
|
|
33
|
+
for (let i = 0; i < startData.length; i++) {
|
|
34
|
+
if (startData[i].type === "text") {
|
|
35
|
+
const text = startData[i].data;
|
|
36
|
+
let lookingForLeft = true;
|
|
37
|
+
let currIndex = 0;
|
|
38
|
+
let nextIndex;
|
|
39
|
+
nextIndex = text.indexOf(leftDelim);
|
|
40
|
+
|
|
41
|
+
if (nextIndex !== -1) {
|
|
42
|
+
currIndex = nextIndex;
|
|
43
|
+
finalData.push({
|
|
44
|
+
type: "text",
|
|
45
|
+
data: text.slice(0, currIndex)
|
|
46
|
+
});
|
|
47
|
+
lookingForLeft = false;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
while (true) {
|
|
51
|
+
if (lookingForLeft) {
|
|
52
|
+
nextIndex = text.indexOf(leftDelim, currIndex);
|
|
53
|
+
|
|
54
|
+
if (nextIndex === -1) {
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
finalData.push({
|
|
59
|
+
type: "text",
|
|
60
|
+
data: text.slice(currIndex, nextIndex)
|
|
61
|
+
});
|
|
62
|
+
currIndex = nextIndex;
|
|
63
|
+
} else {
|
|
64
|
+
nextIndex = findEndOfMath(rightDelim, text, currIndex + leftDelim.length);
|
|
65
|
+
|
|
66
|
+
if (nextIndex === -1) {
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
finalData.push({
|
|
71
|
+
type: "math",
|
|
72
|
+
data: text.slice(currIndex + leftDelim.length, nextIndex),
|
|
73
|
+
rawData: text.slice(currIndex, nextIndex + rightDelim.length),
|
|
74
|
+
display: display
|
|
75
|
+
});
|
|
76
|
+
currIndex = nextIndex + rightDelim.length;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
lookingForLeft = !lookingForLeft;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
finalData.push({
|
|
83
|
+
type: "text",
|
|
84
|
+
data: text.slice(currIndex)
|
|
85
|
+
});
|
|
86
|
+
} else {
|
|
87
|
+
finalData.push(startData[i]);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return finalData;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/* eslint no-console:0 */
|
|
95
|
+
|
|
96
|
+
const splitWithDelimiters = function splitWithDelimiters(text, delimiters) {
|
|
97
|
+
let data = [{
|
|
98
|
+
type: "text",
|
|
99
|
+
data: text
|
|
100
|
+
}];
|
|
101
|
+
|
|
102
|
+
for (let i = 0; i < delimiters.length; i++) {
|
|
103
|
+
const delimiter = delimiters[i];
|
|
104
|
+
data = splitAtDelimiters(data, delimiter.left, delimiter.right, delimiter.display || false);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return data;
|
|
108
|
+
};
|
|
109
|
+
/* Note: optionsCopy is mutated by this method. If it is ever exposed in the
|
|
110
|
+
* API, we should copy it before mutating.
|
|
111
|
+
*/
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
const renderMathInText = function renderMathInText(text, optionsCopy) {
|
|
115
|
+
const data = splitWithDelimiters(text, optionsCopy.delimiters);
|
|
116
|
+
const fragment = document.createDocumentFragment();
|
|
117
|
+
|
|
118
|
+
for (let i = 0; i < data.length; i++) {
|
|
119
|
+
if (data[i].type === "text") {
|
|
120
|
+
fragment.appendChild(document.createTextNode(data[i].data));
|
|
121
|
+
} else {
|
|
122
|
+
const span = document.createElement("span");
|
|
123
|
+
let math = data[i].data; // Override any display mode defined in the settings with that
|
|
124
|
+
// defined by the text itself
|
|
125
|
+
|
|
126
|
+
optionsCopy.displayMode = data[i].display;
|
|
127
|
+
|
|
128
|
+
try {
|
|
129
|
+
if (optionsCopy.preProcess) {
|
|
130
|
+
math = optionsCopy.preProcess(math);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
katex.render(math, span, optionsCopy);
|
|
134
|
+
} catch (e) {
|
|
135
|
+
if (!(e instanceof katex.ParseError)) {
|
|
136
|
+
throw e;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e);
|
|
140
|
+
fragment.appendChild(document.createTextNode(data[i].rawData));
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
fragment.appendChild(span);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return fragment;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const renderElem = function renderElem(elem, optionsCopy) {
|
|
152
|
+
for (let i = 0; i < elem.childNodes.length; i++) {
|
|
153
|
+
const childNode = elem.childNodes[i];
|
|
154
|
+
|
|
155
|
+
if (childNode.nodeType === 3) {
|
|
156
|
+
// Text node
|
|
157
|
+
const frag = renderMathInText(childNode.textContent, optionsCopy);
|
|
158
|
+
i += frag.childNodes.length - 1;
|
|
159
|
+
elem.replaceChild(frag, childNode);
|
|
160
|
+
} else if (childNode.nodeType === 1) {
|
|
161
|
+
// Element node
|
|
162
|
+
const className = ' ' + childNode.className + ' ';
|
|
163
|
+
const shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(x => className.indexOf(' ' + x + ' ') === -1);
|
|
164
|
+
|
|
165
|
+
if (shouldRender) {
|
|
166
|
+
renderElem(childNode, optionsCopy);
|
|
167
|
+
}
|
|
168
|
+
} // Otherwise, it's something else, and ignore it.
|
|
169
|
+
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const renderMathInElement = function renderMathInElement(elem, options) {
|
|
174
|
+
if (!elem) {
|
|
175
|
+
throw new Error("No element provided to render");
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const optionsCopy = {}; // Object.assign(optionsCopy, option)
|
|
179
|
+
|
|
180
|
+
for (const option in options) {
|
|
181
|
+
if (options.hasOwnProperty(option)) {
|
|
182
|
+
optionsCopy[option] = options[option];
|
|
183
|
+
}
|
|
184
|
+
} // default options
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
optionsCopy.delimiters = optionsCopy.delimiters || [{
|
|
188
|
+
left: "$$",
|
|
189
|
+
right: "$$",
|
|
190
|
+
display: true
|
|
191
|
+
}, {
|
|
192
|
+
left: "\\(",
|
|
193
|
+
right: "\\)",
|
|
194
|
+
display: false
|
|
195
|
+
}, // LaTeX uses $…$, but it ruins the display of normal `$` in text:
|
|
196
|
+
// {left: "$", right: "$", display: false},
|
|
197
|
+
// \[…\] must come last in this array. Otherwise, renderMathInElement
|
|
198
|
+
// will search for \[ before it searches for $$ or \(
|
|
199
|
+
// That makes it susceptible to finding a \\[0.3em] row delimiter and
|
|
200
|
+
// treating it as if it were the start of a KaTeX math zone.
|
|
201
|
+
{
|
|
202
|
+
left: "\\[",
|
|
203
|
+
right: "\\]",
|
|
204
|
+
display: true
|
|
205
|
+
}];
|
|
206
|
+
optionsCopy.ignoredTags = optionsCopy.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code"];
|
|
207
|
+
optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || [];
|
|
208
|
+
optionsCopy.errorCallback = optionsCopy.errorCallback || console.error; // Enable sharing of global macros defined via `\gdef` between different
|
|
209
|
+
// math elements within a single call to `renderMathInElement`.
|
|
210
|
+
|
|
211
|
+
optionsCopy.macros = optionsCopy.macros || {};
|
|
212
|
+
renderElem(elem, optionsCopy);
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
export default renderMathInElement;
|