jekyll-theme-hydebetty 1.0.1
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 +7 -0
- data/LICENSE.md +622 -0
- data/README.md +180 -0
- data/_includes/body/analytics.html +43 -0
- data/_includes/body/comments.html +6 -0
- data/_includes/body/footer.html +19 -0
- data/_includes/body/index.html +22 -0
- data/_includes/body/main.html +18 -0
- data/_includes/body/menu.html +24 -0
- data/_includes/body/nav.html +41 -0
- data/_includes/body/scripts.html +9 -0
- data/_includes/body/sidebar.html +47 -0
- data/_includes/components/about.html +8 -0
- data/_includes/components/author.html +24 -0
- data/_includes/components/avatar-tag.html +4 -0
- data/_includes/components/hy-img.html +40 -0
- data/_includes/components/link.html +12 -0
- data/_includes/components/message.html +14 -0
- data/_includes/components/pagination.html +15 -0
- data/_includes/components/post-list-item.html +7 -0
- data/_includes/components/post.html +49 -0
- data/_includes/components/related-posts.html +25 -0
- data/_includes/components/social-list-item.html +40 -0
- data/_includes/components/social.html +23 -0
- data/_includes/components/tag-list.html +26 -0
- data/_includes/head/feed-tag.html +1 -0
- data/_includes/head/index.html +9 -0
- data/_includes/head/links.html +33 -0
- data/_includes/head/meta.html +34 -0
- data/_includes/head/page-style.html +6 -0
- data/_includes/head/scripts.html +9 -0
- data/_includes/head/seo-fallback.html +13 -0
- data/_includes/head/seo-tag.html +4 -0
- data/_includes/head/styles.html +41 -0
- data/_includes/header.txt +13 -0
- data/_includes/icon-github.html +2 -0
- data/_includes/my-body.html +42 -0
- data/_includes/my-comments.html +24 -0
- data/_includes/my-head.html +13 -0
- data/_includes/my-scripts.html +55 -0
- data/_includes/scripts/cssrelpreload.min.js +1 -0
- data/_includes/scripts/load-js.js +60 -0
- data/_includes/scripts/load-js.min.js +0 -0
- data/_includes/scripts/loadCSS.min.js +1 -0
- data/_includes/scripts/nomodule.js +21 -0
- data/_includes/scripts/nomodule.min.js +0 -0
- data/_includes/scripts.html +33 -0
- data/_includes/smart-url.txt +1 -0
- data/_includes/styles/inline.scss +62 -0
- data/_includes/styles/page-style.scss +64 -0
- data/_includes/styles/style.scss +113 -0
- data/_includes/templates/animation.html +7 -0
- data/_includes/templates/back.html +6 -0
- data/_includes/templates/error.html +10 -0
- data/_includes/templates/forward.html +6 -0
- data/_includes/templates/index.html +12 -0
- data/_includes/templates/loading.html +6 -0
- data/_includes/templates/permalink.html +6 -0
- data/_layouts/about.html +43 -0
- data/_layouts/base.html +38 -0
- data/_layouts/blog.html +32 -0
- data/_layouts/compress.html +15 -0
- data/_layouts/default.html +56 -0
- data/_layouts/home.html +20 -0
- data/_layouts/list.html +46 -0
- data/_layouts/not-found.html +37 -0
- data/_layouts/page.html +27 -0
- data/_layouts/post.html +34 -0
- data/_layouts/redirect.html +23 -0
- data/_sass/_mixins.scss +63 -0
- data/_sass/_reboot-mod.scss +286 -0
- data/_sass/_spinner.scss +45 -0
- data/_sass/_syntax.scss +131 -0
- data/_sass/_variables.scss +63 -0
- data/_sass/hydejack/__inline__/_avatar.scss +48 -0
- data/_sass/hydejack/__inline__/_base.scss +73 -0
- data/_sass/hydejack/__inline__/_break-layout.scss +25 -0
- data/_sass/hydejack/__inline__/_content.scss +59 -0
- data/_sass/hydejack/__inline__/_footer.scss +25 -0
- data/_sass/hydejack/__inline__/_images.scss +38 -0
- data/_sass/hydejack/__inline__/_katex.scss +25 -0
- data/_sass/hydejack/__inline__/_links.scss +45 -0
- data/_sass/hydejack/__inline__/_mark-external.scss +25 -0
- data/_sass/hydejack/__inline__/_menu.scss +67 -0
- data/_sass/hydejack/__inline__/_sidebar.scss +144 -0
- data/_sass/hydejack/__inline__/_social.scss +58 -0
- data/_sass/hydejack/__inline__/_utilities.scss +45 -0
- data/_sass/hydejack/__link__/_avatar.scss +38 -0
- data/_sass/hydejack/__link__/_base.scss +42 -0
- data/_sass/hydejack/__link__/_break-layout.scss +64 -0
- data/_sass/hydejack/__link__/_content.scss +32 -0
- data/_sass/hydejack/__link__/_footer.scss +47 -0
- data/_sass/hydejack/__link__/_images.scss +90 -0
- data/_sass/hydejack/__link__/_katex.scss +57 -0
- data/_sass/hydejack/__link__/_links.scss +53 -0
- data/_sass/hydejack/__link__/_mark-external.scss +51 -0
- data/_sass/hydejack/__link__/_menu.scss +42 -0
- data/_sass/hydejack/__link__/_sidebar.scss +114 -0
- data/_sass/hydejack/__link__/_social.scss +33 -0
- data/_sass/hydejack/__link__/_utilities.scss +54 -0
- data/_sass/hydejack/_avatar.pre.scss +44 -0
- data/_sass/hydejack/_base.pre.scss +78 -0
- data/_sass/hydejack/_break-layout.pre.scss +55 -0
- data/_sass/hydejack/_content.pre.scss +56 -0
- data/_sass/hydejack/_footer.pre.scss +38 -0
- data/_sass/hydejack/_images.pre.scss +83 -0
- data/_sass/hydejack/_katex.pre.scss +48 -0
- data/_sass/hydejack/_links.pre.scss +47 -0
- data/_sass/hydejack/_mark-external.pre.scss +42 -0
- data/_sass/hydejack/_menu.pre.scss +74 -0
- data/_sass/hydejack/_sidebar.pre.scss +175 -0
- data/_sass/hydejack/_social.pre.scss +55 -0
- data/_sass/hydejack/_utilities.pre.scss +46 -0
- data/_sass/my-inline.scss +16 -0
- data/_sass/my-style.scss +9 -0
- data/_sass/my-variables.scss +1 -0
- data/_sass/pooleparty/__inline__/_base.scss +75 -0
- data/_sass/pooleparty/__inline__/_code.scss +25 -0
- data/_sass/pooleparty/__inline__/_footer.scss +25 -0
- data/_sass/pooleparty/__inline__/_footnotes.scss +25 -0
- data/_sass/pooleparty/__inline__/_message.scss +35 -0
- data/_sass/pooleparty/__inline__/_pagination.scss +25 -0
- data/_sass/pooleparty/__inline__/_posts.scss +49 -0
- data/_sass/pooleparty/__inline__/_read-more.scss +25 -0
- data/_sass/pooleparty/__inline__/_related.scss +38 -0
- data/_sass/pooleparty/__inline__/_table.scss +53 -0
- data/_sass/pooleparty/__inline__/_type.scss +88 -0
- data/_sass/pooleparty/__link__/_base.scss +40 -0
- data/_sass/pooleparty/__link__/_code.scss +75 -0
- data/_sass/pooleparty/__link__/_footer.scss +25 -0
- data/_sass/pooleparty/__link__/_footnotes.scss +80 -0
- data/_sass/pooleparty/__link__/_message.scss +25 -0
- data/_sass/pooleparty/__link__/_pagination.scss +90 -0
- data/_sass/pooleparty/__link__/_posts.scss +38 -0
- data/_sass/pooleparty/__link__/_read-more.scss +45 -0
- data/_sass/pooleparty/__link__/_related.scss +33 -0
- data/_sass/pooleparty/__link__/_table.scss +171 -0
- data/_sass/pooleparty/__link__/_type.scss +141 -0
- data/_sass/pooleparty/_base.pre.scss +74 -0
- data/_sass/pooleparty/_code.pre.scss +66 -0
- data/_sass/pooleparty/_footer.pre.scss +16 -0
- data/_sass/pooleparty/_footnotes.pre.scss +71 -0
- data/_sass/pooleparty/_message.pre.scss +26 -0
- data/_sass/pooleparty/_pagination.pre.scss +81 -0
- data/_sass/pooleparty/_posts.pre.scss +52 -0
- data/_sass/pooleparty/_read-more.pre.scss +36 -0
- data/_sass/pooleparty/_related.pre.scss +35 -0
- data/_sass/pooleparty/_table.pre.scss +180 -0
- data/_sass/pooleparty/_type.pre.scss +193 -0
- data/assets/Resume.pdf +0 -0
- data/assets/bower.json +11 -0
- data/assets/bower_components/html5shiv/.bower.json +26 -0
- data/assets/bower_components/html5shiv/Gruntfile.js +61 -0
- data/assets/bower_components/html5shiv/bower.json +15 -0
- data/assets/bower_components/html5shiv/dist/html5shiv-printshiv.js +524 -0
- data/assets/bower_components/html5shiv/dist/html5shiv-printshiv.min.js +4 -0
- data/assets/bower_components/html5shiv/dist/html5shiv.js +326 -0
- data/assets/bower_components/html5shiv/dist/html5shiv.min.js +4 -0
- data/assets/bower_components/html5shiv/package.json +16 -0
- data/assets/bower_components/katex/.bower.json +47 -0
- data/assets/bower_components/katex/LICENSE +21 -0
- data/assets/bower_components/katex/bower.json +36 -0
- data/assets/bower_components/katex/dist/contrib/auto-render.js +339 -0
- data/assets/bower_components/katex/dist/contrib/auto-render.min.js +1 -0
- data/assets/bower_components/katex/dist/contrib/auto-render.mjs +215 -0
- data/assets/bower_components/katex/dist/contrib/copy-tex.css +14 -0
- data/assets/bower_components/katex/dist/contrib/copy-tex.js +213 -0
- data/assets/bower_components/katex/dist/contrib/copy-tex.min.css +1 -0
- data/assets/bower_components/katex/dist/contrib/copy-tex.min.js +1 -0
- data/assets/bower_components/katex/dist/contrib/copy-tex.mjs +85 -0
- data/assets/bower_components/katex/dist/contrib/mathtex-script-type.js +137 -0
- data/assets/bower_components/katex/dist/contrib/mathtex-script-type.min.js +1 -0
- 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 +1021 -0
- data/assets/bower_components/katex/dist/katex.js +16809 -0
- data/assets/bower_components/katex/dist/katex.min.css +1 -0
- data/assets/bower_components/katex/dist/katex.min.js +1 -0
- data/assets/bower_components/katex/dist/katex.mjs +16342 -0
- data/assets/bower_components/katex/yarn.lock +8952 -0
- data/assets/css/hydejack-7.5.2.css +3 -0
- data/assets/css/hydejack-8.5.2.css +3 -0
- data/assets/icomoon/fonts/icomoon.eot +0 -0
- data/assets/icomoon/fonts/icomoon.svg +96 -0
- data/assets/icomoon/fonts/icomoon.ttf +0 -0
- data/assets/icomoon/fonts/icomoon.woff +0 -0
- data/assets/icomoon/selection.json +1 -0
- data/assets/icomoon/style.css +284 -0
- data/assets/icons/favicon.ico +0 -0
- data/assets/icons/icon.png +0 -0
- data/assets/icons/icon@0,25x.png +0 -0
- data/assets/icons/icon@0,5x.png +0 -0
- data/assets/icons/icon@0,75x.png +0 -0
- data/assets/icons/icon@2x.png +0 -0
- data/assets/icons/icon@3x.png +0 -0
- data/assets/icons/tile-large.png +0 -0
- data/assets/icons/tile-medium.png +0 -0
- data/assets/icons/tile-small.png +0 -0
- data/assets/icons/tile-wide.png +0 -0
- data/assets/ieconfig.xml +15 -0
- data/assets/img/blog/COLOURlovers.com-Hydejack.png +0 -0
- data/assets/img/blog/blog-layout.jpg +0 -0
- data/assets/img/blog/caleb-george-old.jpg +0 -0
- data/assets/img/blog/caleb-george.jpg +0 -0
- data/assets/img/blog/cover-page.jpg +0 -0
- data/assets/img/blog/dark-mode-ii.jpg +0 -0
- data/assets/img/blog/dark-mode.jpg +0 -0
- data/assets/img/blog/example-content-ii.jpg +0 -0
- data/assets/img/blog/example-content-iii.jpg +0 -0
- data/assets/img/blog/hydejack-8.png +0 -0
- data/assets/img/blog/hydejack-8@0,25x.png +0 -0
- data/assets/img/blog/hydejack-8@0,5x.png +0 -0
- data/assets/img/blog/lazy-images.jpg +0 -0
- data/assets/img/blog/louis-hansel.jpg +0 -0
- data/assets/img/blog/resume.png +0 -0
- data/assets/img/blog/steve-harvey.jpg +0 -0
- data/assets/img/blog/w3m.png +0 -0
- data/assets/img/blog/wade-lambert.jpg +0 -0
- data/assets/img/docs/google-fonts.png +0 -0
- data/assets/img/projects/hy-drawer.svg +12 -0
- data/assets/img/projects/hy-img.svg +17 -0
- data/assets/img/projects/hy-push-state.svg +13 -0
- data/assets/img/sidebar-bg.jpg +0 -0
- data/assets/img/swipe.svg +22 -0
- data/assets/js/hydejack-8.5.2.js +161 -0
- data/assets/js/hydejack-legacy-8.5.2.js +190 -0
- data/assets/manifest.json +46 -0
- data/assets/version.json +3 -0
- data/assets/video/blog-layout.mp4 +0 -0
- data/assets/video/cover-page.mp4 +0 -0
- data/assets/video/dark-mode.mp4 +0 -0
- data/assets/video/lazy-images.mp4 +0 -0
- data/licenses/Apache-2.0.md +208 -0
- data/licenses/GPL-3.0.md +620 -0
- data/licenses/MIT.md +21 -0
- data/licenses/PRO.md +136 -0
- data/licenses/README.md +10 -0
- data/licenses/W3C.md +31 -0
- metadata +385 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory(require("katex"));
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define(["katex"], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["renderMathInElement"] = factory(require("katex"));
|
|
8
|
+
else
|
|
9
|
+
root["renderMathInElement"] = factory(root["katex"]);
|
|
10
|
+
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__0__) {
|
|
11
|
+
return /******/ (function(modules) { // webpackBootstrap
|
|
12
|
+
/******/ // The module cache
|
|
13
|
+
/******/ var installedModules = {};
|
|
14
|
+
/******/
|
|
15
|
+
/******/ // The require function
|
|
16
|
+
/******/ function __webpack_require__(moduleId) {
|
|
17
|
+
/******/
|
|
18
|
+
/******/ // Check if module is in cache
|
|
19
|
+
/******/ if(installedModules[moduleId]) {
|
|
20
|
+
/******/ return installedModules[moduleId].exports;
|
|
21
|
+
/******/ }
|
|
22
|
+
/******/ // Create a new module (and put it into the cache)
|
|
23
|
+
/******/ var module = installedModules[moduleId] = {
|
|
24
|
+
/******/ i: moduleId,
|
|
25
|
+
/******/ l: false,
|
|
26
|
+
/******/ exports: {}
|
|
27
|
+
/******/ };
|
|
28
|
+
/******/
|
|
29
|
+
/******/ // Execute the module function
|
|
30
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
31
|
+
/******/
|
|
32
|
+
/******/ // Flag the module as loaded
|
|
33
|
+
/******/ module.l = true;
|
|
34
|
+
/******/
|
|
35
|
+
/******/ // Return the exports of the module
|
|
36
|
+
/******/ return module.exports;
|
|
37
|
+
/******/ }
|
|
38
|
+
/******/
|
|
39
|
+
/******/
|
|
40
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
41
|
+
/******/ __webpack_require__.m = modules;
|
|
42
|
+
/******/
|
|
43
|
+
/******/ // expose the module cache
|
|
44
|
+
/******/ __webpack_require__.c = installedModules;
|
|
45
|
+
/******/
|
|
46
|
+
/******/ // define getter function for harmony exports
|
|
47
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
48
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
49
|
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
50
|
+
/******/ }
|
|
51
|
+
/******/ };
|
|
52
|
+
/******/
|
|
53
|
+
/******/ // define __esModule on exports
|
|
54
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
55
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
56
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
57
|
+
/******/ }
|
|
58
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
59
|
+
/******/ };
|
|
60
|
+
/******/
|
|
61
|
+
/******/ // create a fake namespace object
|
|
62
|
+
/******/ // mode & 1: value is a module id, require it
|
|
63
|
+
/******/ // mode & 2: merge all properties of value into the ns
|
|
64
|
+
/******/ // mode & 4: return value when already ns object
|
|
65
|
+
/******/ // mode & 8|1: behave like require
|
|
66
|
+
/******/ __webpack_require__.t = function(value, mode) {
|
|
67
|
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
68
|
+
/******/ if(mode & 8) return value;
|
|
69
|
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
70
|
+
/******/ var ns = Object.create(null);
|
|
71
|
+
/******/ __webpack_require__.r(ns);
|
|
72
|
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
73
|
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
74
|
+
/******/ return ns;
|
|
75
|
+
/******/ };
|
|
76
|
+
/******/
|
|
77
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
78
|
+
/******/ __webpack_require__.n = function(module) {
|
|
79
|
+
/******/ var getter = module && module.__esModule ?
|
|
80
|
+
/******/ function getDefault() { return module['default']; } :
|
|
81
|
+
/******/ function getModuleExports() { return module; };
|
|
82
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
83
|
+
/******/ return getter;
|
|
84
|
+
/******/ };
|
|
85
|
+
/******/
|
|
86
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
|
87
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
88
|
+
/******/
|
|
89
|
+
/******/ // __webpack_public_path__
|
|
90
|
+
/******/ __webpack_require__.p = "";
|
|
91
|
+
/******/
|
|
92
|
+
/******/
|
|
93
|
+
/******/ // Load entry module and return exports
|
|
94
|
+
/******/ return __webpack_require__(__webpack_require__.s = 1);
|
|
95
|
+
/******/ })
|
|
96
|
+
/************************************************************************/
|
|
97
|
+
/******/ ([
|
|
98
|
+
/* 0 */
|
|
99
|
+
/***/ (function(module, exports) {
|
|
100
|
+
|
|
101
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__0__;
|
|
102
|
+
|
|
103
|
+
/***/ }),
|
|
104
|
+
/* 1 */
|
|
105
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
106
|
+
|
|
107
|
+
"use strict";
|
|
108
|
+
__webpack_require__.r(__webpack_exports__);
|
|
109
|
+
|
|
110
|
+
// EXTERNAL MODULE: external "katex"
|
|
111
|
+
var external_katex_ = __webpack_require__(0);
|
|
112
|
+
var external_katex_default = /*#__PURE__*/__webpack_require__.n(external_katex_);
|
|
113
|
+
|
|
114
|
+
// CONCATENATED MODULE: ./contrib/auto-render/splitAtDelimiters.js
|
|
115
|
+
/* eslint no-constant-condition:0 */
|
|
116
|
+
var findEndOfMath = function findEndOfMath(delimiter, text, startIndex) {
|
|
117
|
+
// Adapted from
|
|
118
|
+
// https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx
|
|
119
|
+
var index = startIndex;
|
|
120
|
+
var braceLevel = 0;
|
|
121
|
+
var delimLength = delimiter.length;
|
|
122
|
+
|
|
123
|
+
while (index < text.length) {
|
|
124
|
+
var character = text[index];
|
|
125
|
+
|
|
126
|
+
if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) {
|
|
127
|
+
return index;
|
|
128
|
+
} else if (character === "\\") {
|
|
129
|
+
index++;
|
|
130
|
+
} else if (character === "{") {
|
|
131
|
+
braceLevel++;
|
|
132
|
+
} else if (character === "}") {
|
|
133
|
+
braceLevel--;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
index++;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return -1;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
var splitAtDelimiters = function splitAtDelimiters(startData, leftDelim, rightDelim, display) {
|
|
143
|
+
var finalData = [];
|
|
144
|
+
|
|
145
|
+
for (var i = 0; i < startData.length; i++) {
|
|
146
|
+
if (startData[i].type === "text") {
|
|
147
|
+
var text = startData[i].data;
|
|
148
|
+
var lookingForLeft = true;
|
|
149
|
+
var currIndex = 0;
|
|
150
|
+
var nextIndex = void 0;
|
|
151
|
+
nextIndex = text.indexOf(leftDelim);
|
|
152
|
+
|
|
153
|
+
if (nextIndex !== -1) {
|
|
154
|
+
currIndex = nextIndex;
|
|
155
|
+
finalData.push({
|
|
156
|
+
type: "text",
|
|
157
|
+
data: text.slice(0, currIndex)
|
|
158
|
+
});
|
|
159
|
+
lookingForLeft = false;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
while (true) {
|
|
163
|
+
if (lookingForLeft) {
|
|
164
|
+
nextIndex = text.indexOf(leftDelim, currIndex);
|
|
165
|
+
|
|
166
|
+
if (nextIndex === -1) {
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
finalData.push({
|
|
171
|
+
type: "text",
|
|
172
|
+
data: text.slice(currIndex, nextIndex)
|
|
173
|
+
});
|
|
174
|
+
currIndex = nextIndex;
|
|
175
|
+
} else {
|
|
176
|
+
nextIndex = findEndOfMath(rightDelim, text, currIndex + leftDelim.length);
|
|
177
|
+
|
|
178
|
+
if (nextIndex === -1) {
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
finalData.push({
|
|
183
|
+
type: "math",
|
|
184
|
+
data: text.slice(currIndex + leftDelim.length, nextIndex),
|
|
185
|
+
rawData: text.slice(currIndex, nextIndex + rightDelim.length),
|
|
186
|
+
display: display
|
|
187
|
+
});
|
|
188
|
+
currIndex = nextIndex + rightDelim.length;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
lookingForLeft = !lookingForLeft;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
finalData.push({
|
|
195
|
+
type: "text",
|
|
196
|
+
data: text.slice(currIndex)
|
|
197
|
+
});
|
|
198
|
+
} else {
|
|
199
|
+
finalData.push(startData[i]);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return finalData;
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
/* harmony default export */ var auto_render_splitAtDelimiters = (splitAtDelimiters);
|
|
207
|
+
// CONCATENATED MODULE: ./contrib/auto-render/auto-render.js
|
|
208
|
+
/* eslint no-console:0 */
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
var auto_render_splitWithDelimiters = function splitWithDelimiters(text, delimiters) {
|
|
213
|
+
var data = [{
|
|
214
|
+
type: "text",
|
|
215
|
+
data: text
|
|
216
|
+
}];
|
|
217
|
+
|
|
218
|
+
for (var i = 0; i < delimiters.length; i++) {
|
|
219
|
+
var delimiter = delimiters[i];
|
|
220
|
+
data = auto_render_splitAtDelimiters(data, delimiter.left, delimiter.right, delimiter.display || false);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return data;
|
|
224
|
+
};
|
|
225
|
+
/* Note: optionsCopy is mutated by this method. If it is ever exposed in the
|
|
226
|
+
* API, we should copy it before mutating.
|
|
227
|
+
*/
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
var auto_render_renderMathInText = function renderMathInText(text, optionsCopy) {
|
|
231
|
+
var data = auto_render_splitWithDelimiters(text, optionsCopy.delimiters);
|
|
232
|
+
var fragment = document.createDocumentFragment();
|
|
233
|
+
|
|
234
|
+
for (var i = 0; i < data.length; i++) {
|
|
235
|
+
if (data[i].type === "text") {
|
|
236
|
+
fragment.appendChild(document.createTextNode(data[i].data));
|
|
237
|
+
} else {
|
|
238
|
+
var span = document.createElement("span");
|
|
239
|
+
var math = data[i].data; // Override any display mode defined in the settings with that
|
|
240
|
+
// defined by the text itself
|
|
241
|
+
|
|
242
|
+
optionsCopy.displayMode = data[i].display;
|
|
243
|
+
|
|
244
|
+
try {
|
|
245
|
+
if (optionsCopy.preProcess) {
|
|
246
|
+
math = optionsCopy.preProcess(math);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
external_katex_default.a.render(math, span, optionsCopy);
|
|
250
|
+
} catch (e) {
|
|
251
|
+
if (!(e instanceof external_katex_default.a.ParseError)) {
|
|
252
|
+
throw e;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e);
|
|
256
|
+
fragment.appendChild(document.createTextNode(data[i].rawData));
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
fragment.appendChild(span);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
return fragment;
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
var renderElem = function renderElem(elem, optionsCopy) {
|
|
268
|
+
for (var i = 0; i < elem.childNodes.length; i++) {
|
|
269
|
+
var childNode = elem.childNodes[i];
|
|
270
|
+
|
|
271
|
+
if (childNode.nodeType === 3) {
|
|
272
|
+
// Text node
|
|
273
|
+
var frag = auto_render_renderMathInText(childNode.textContent, optionsCopy);
|
|
274
|
+
i += frag.childNodes.length - 1;
|
|
275
|
+
elem.replaceChild(frag, childNode);
|
|
276
|
+
} else if (childNode.nodeType === 1) {
|
|
277
|
+
(function () {
|
|
278
|
+
// Element node
|
|
279
|
+
var className = ' ' + childNode.className + ' ';
|
|
280
|
+
var shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(function (x) {
|
|
281
|
+
return className.indexOf(' ' + x + ' ') === -1;
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
if (shouldRender) {
|
|
285
|
+
renderElem(childNode, optionsCopy);
|
|
286
|
+
}
|
|
287
|
+
})();
|
|
288
|
+
} // Otherwise, it's something else, and ignore it.
|
|
289
|
+
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
var renderMathInElement = function renderMathInElement(elem, options) {
|
|
294
|
+
if (!elem) {
|
|
295
|
+
throw new Error("No element provided to render");
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
var optionsCopy = {}; // Object.assign(optionsCopy, option)
|
|
299
|
+
|
|
300
|
+
for (var option in options) {
|
|
301
|
+
if (options.hasOwnProperty(option)) {
|
|
302
|
+
optionsCopy[option] = options[option];
|
|
303
|
+
}
|
|
304
|
+
} // default options
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
optionsCopy.delimiters = optionsCopy.delimiters || [{
|
|
308
|
+
left: "$$",
|
|
309
|
+
right: "$$",
|
|
310
|
+
display: true
|
|
311
|
+
}, {
|
|
312
|
+
left: "\\(",
|
|
313
|
+
right: "\\)",
|
|
314
|
+
display: false
|
|
315
|
+
}, // LaTeX uses $…$, but it ruins the display of normal `$` in text:
|
|
316
|
+
// {left: "$", right: "$", display: false},
|
|
317
|
+
// \[…\] must come last in this array. Otherwise, renderMathInElement
|
|
318
|
+
// will search for \[ before it searches for $$ or \(
|
|
319
|
+
// That makes it susceptible to finding a \\[0.3em] row delimiter and
|
|
320
|
+
// treating it as if it were the start of a KaTeX math zone.
|
|
321
|
+
{
|
|
322
|
+
left: "\\[",
|
|
323
|
+
right: "\\]",
|
|
324
|
+
display: true
|
|
325
|
+
}];
|
|
326
|
+
optionsCopy.ignoredTags = optionsCopy.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code"];
|
|
327
|
+
optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || [];
|
|
328
|
+
optionsCopy.errorCallback = optionsCopy.errorCallback || console.error; // Enable sharing of global macros defined via `\gdef` between different
|
|
329
|
+
// math elements within a single call to `renderMathInElement`.
|
|
330
|
+
|
|
331
|
+
optionsCopy.macros = optionsCopy.macros || {};
|
|
332
|
+
renderElem(elem, optionsCopy);
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
/* harmony default export */ var auto_render = __webpack_exports__["default"] = (renderMathInElement);
|
|
336
|
+
|
|
337
|
+
/***/ })
|
|
338
|
+
/******/ ])["default"];
|
|
339
|
+
});
|
|
@@ -0,0 +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(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;
|