Added files of the theme

This commit is contained in:
N07070
2021-01-03 14:33:26 +01:00
parent 9c6bbe51e9
commit 274b1c55ef
181 changed files with 3899 additions and 3 deletions

349
assets/css/normalize.css vendored Normal file
View File

@@ -0,0 +1,349 @@
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}

6
assets/css/override.css Normal file
View File

@@ -0,0 +1,6 @@
/*
* To override CSS, you should create
* project_root/assets/css/override.css
* and place all your CSS inside it.
* You should not modify this file.
*/

551
assets/css/style.css Normal file
View File

@@ -0,0 +1,551 @@
.color-primary-0 { color: #6B6B6B } /* Main Primary color */
.color-primary-1 { color: #C9C8C8 }
.color-primary-2 { color: #999999 }
.color-primary-3 { color: #343434 }
.color-primary-4 { color: #040303 }
.bg-color-0 { background-color: #6B6B6B } /* Main Primary color */
.bg-color-1 { background-color: #C9C8C8 }
.bg-color-2 { background-color: #999999 }
.bg-color-3 { background-color: #343434 }
.bg-color-4 { background-color: #040303 }
/* Generated by Paletton.com © 2002-2014 */
/* http://paletton.com */
body {
font-family: Avenir, HelveticaNeue-Light, "Helvetica Neue Light",
"Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
color: #454545;
font-size: 1.1em;
/* background: linear-gradient(90deg, #000 21px, transparent 1%) center, linear-gradient(#000 21px, transparent 1%) center, white; */
background-size: 22px 22px;
margin: 0;
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
box-sizing: border-box;
word-break: break-word;
}
}
p {
margin: 1.5em 0;
}
.home-header {
min-height: 26rem;
max-width: 50rem;
margin: 0 -1.2rem -5rem -1.2rem;
padding: 1.2rem;
display: flex;
flex-direction: column;
z-index: -1;
color: white;
background-position: center;
background-size: cover;
}
.home-faceshot-card {
align-self: center;
padding: 0.5rem;
margin-bottom: 3rem;
max-width: 17rem;
width: 100%;
background-color: white;
border-radius: 1.2rem;
box-shadow: 0 0.7rem 2.3rem 0 rgba(0,0,0,0.1);
}
.home-faceshot {
margin: 0;
border-radius: 0.8rem;
}
.home-blob-text-container {
margin: 2em 0;
max-width: 30rem;
line-height: 1.5;
}
.home-blob-title{
font-size: 1.5em;
font-weight: normal;
margin: 0;
}
.home-blob-text{
margin: 0.5em 0 0 0;
font-size: 1.1em;
}
.nav-bar {
max-width: 60rem;
/* width: 100%; */
padding: 0.4em 0;
/* display: flex; */
justify-content: space-between;
align-items: center;
}
.nav-header {
margin: 0;
padding: 0.4em;
font-size: 1.4em;
}
.nav-text {
font-weight: normal;
text-decoration: none;
z-index: 105;
color: black;
font-weight: bolder;
font-size: 3rem;
}
/* Navigation menu */
.menu-container {
align-content: space-between;
}
#menu {
list-style: none;
}
#menu li{
list-style: none;
font-weight: bold;
display: inline;
padding: 0 1em 1em 0;
margin-top: 0.4em;
display: inline-grid;
}
/* #menu ul , li a{
color: black;
padding: 0 1em;
word-break: keep-all;
align-content: stretch;
text-decoration: none;
font-weight: bolder;
} */
.post {
margin: 0 0 1em 0;
line-height: 1.9;
}
.post-header {
margin: 0 0 1.5em 0;
}
.post-title {
font-size: 1.8em;
font-weight: 500;
line-height: 1.2;
margin: 0 0 0.4em 0;
font-family: serif;
}
.post-date {
display: block;
color: #7a7b7c;
font-size: 0.7em;
margin: 0;
}
.post-figure {
margin: 1.5em 0;
}
.dropcase > p:first-of-type::first-letter {
float: left;
font-size: 3em;
line-height: 1;
margin: 0.08em 0.15em -0.4em 0;
/* initial-letter: 2; Maybe someday*/
}
.content {
background-color: white;
padding: 2em 0;
margin-bottom: 3rem;
margin-top: 1em;
width: 100%;
max-width: 50rem;
/* border-radius: 1.2rem; */
z-index: 2;
transition: transform 0.2s cubic-bezier(0.25,0.8,0.25,1), box-shadow 0.2s cubic-bezier(0.25,0.8,0.25,1);
box-shadow: 0 0.7rem 2.3rem 0 rgba(0,0,0,0.1);
}
.list-header {
margin: 1em;
text-align: center;
}
.list-header-title {
margin: 0.1em 0 0.1em 0;
font-size: 2em;
text-transform: uppercase;
}
.list-header-subtext {
font-weight: normal;
font-size: 1.5em;
line-height: 1.6;
margin: 0;
}
.list-header-content {
margin: 5em 0;
line-height: 1.6em;
}
.card-container {
max-width: 48rem;
}
/* .card-container > a:first-of-type {
margin-top: 5em;
} */
.card {
display: block;
margin: 3rem 0;
box-sizing: border-box;
background-color: white;
text-decoration: none;
/* border-radius: 1.2rem; */
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
transition: transform 0.2s cubic-bezier(0.25,0.8,0.25,1), box-shadow 0.2s cubic-bezier(0.25,0.8,0.25,1);
box-shadow: 0 0.7rem 2.3rem 0 rgba(0,0,0,0.1);
}
.home-card {
padding: 0.8em;
font-size: 2em;
font-weight: bold;
text-align: center;
color: white;
background-position: center center;
object-fit: cover;
}
.blog-card {
display: flex;
flex-direction: column;
align-items: stretch;
border-style: solid;
}
.bc-next {
margin-top: 0;
}
.card-img-container {
position: relative;
margin: 0.5rem;
background-color: grey;
}
.card-img {
/* border-radius: 0.8rem; */
margin: 0 0 -0.7em 0;
max-height: 10em;
object-fit: cover;
}
.card-img-overlay {
/* border-radius: 0.8rem 0.8rem 0 0; */
position: absolute;
top: 0;
font-size: 1.27em;
text-align: center;
padding: 0.77em 0;
width: 100%;
box-sizing: border-box;
margin: 0;
color: white;
background-color: rgba(0, 0, 0, 0.4);
z-index: 5;
}
.card-body {
margin: 1.3em 1.5em;
line-height: 1.6;
}
.card-title {
margin: 0;
color: black;
font-size: 1.3em;
font-weight: 500;
font-family: serif;
}
.card-text {
margin: 1em 0;
}
.card-subtext {
display: flex;
flex-direction: row;
justify-content: flex-start;
font-size: 0.8em;
}
.card-subtext > p {
margin: 0;
}
.card-subtext > p + p {
margin-left: 1em;
padding-left: 1em;
word-spacing: 0.5em;
border-left: thin solid #7a7b7c;
}
.end-nav {
width: 100%;
max-width: 48rem;
z-index: 2;
}
.pagination-nav {
margin: 2em 0;
width: 100%;
max-width: 47rem;
}
/* .pagination-text {
font-family: 'LatoLatinWebMedium';
} */
.pagination-newer {
float:left;
}
.pagination-older {
float: right;
}
.button {
padding: 0.5em 0.6em;
background-color: #FFF;
text-decoration: none;
border-radius: 0.3rem;
transition: transform 0.1s cubic-bezier(0.25,0.8,0.25,1), box-shadow 0.1s cubic-bezier(0.25,0.8,0.25,1);
box-shadow: 0 0.7rem 2.3rem 0 rgba(0,0,0,0.1);
}
.button:hover {
box-shadow: 0 0.05rem 0.15rem rgba(0,0,0,0.12), 0 0.05rem 0.1rem rgba(0,0,0,0.24);
transform: scale(0.97);
}
.button:active {
transform: scale(1);
}
.side-gutter {
margin-left: 1.2rem !important;
margin-right: 1.2rem !important;
}
.side-padding {
padding-left: 1.2rem !important;
padding-right: 1.2rem !important;
box-sizing: border-box !important;
}
.side-text-padding {
padding-left: 1.2rem !important;
padding-right: 1.2rem !important;
box-sizing: border-box !important;
}
.small-pic {
display: block;
margin-top: 1.5em;
}
.small-img {
width: unset;
max-width: 100%;
margin: 0 auto 1.5em auto;
}
.muted-text {
color: #8E8E8E;
}
.katex-display {
margin: 1.5em 0;
overflow-x: auto;
overflow-y: hidden;
}
#disqus_thread {
margin-top: 5em;
}
.no-scroll {
overflow: hidden;
position: fixed;
}
.clear {
clear: both;
}
h1, h2, h3, h4, h5, h6 {
margin: 1.5em 0 -0.5em 0;
clear: both;
}
img {
display: block;
width: 100%;
height: auto;
margin: 1.5em 0;
}
blockquote {
border-left: 0.3em solid #D1D1D1;
margin: 1.5em 0.8em;
padding: .5em 0.5em;
font-style: italic;
}
blockquote p {
display: inline;
}
ul,
ol {
padding-left: 1.6em;
}
li ul, li ol {
padding-left: 1em;
}
li > p {
margin: 0;
}
code {
font-size: 1.1rem;
font-family: monospace;
padding: .2em .5em;
line-height: 1.5;
border-radius: 0.3rem;
background-color: #f5f6f7;
}
pre > code {
margin: 1.5em 0;
display: block;
padding: 0.5em;
word-break: normal;
overflow-x: auto;
color: black;
}
.highlight > pre {
background-color: unset !important;
}
hr {
border: 0;
border-bottom: thin solid #D1D1D1;
margin: 3em 0;
clear: both;
}
a {
color: #454545;
}
table {
color: #141823;
border-collapse: collapse;
border-spacing: 0;
margin: 1.5em 0;
}
td,
th {
padding: 0.5em 1em;
border: thin solid #D1D1D1
}
/* th {
font-family: 'LatoLatinWebHeavy';
font-weight: normal;
} */
tr:nth-child(even) td {
background: #f5f6f7;
}
footer {
height: 17rem;
max-width: 50rem;
width: 100%;
margin-top: -10rem;
display: flex;
flex-flow: row wrap;
justify-content: space-evenly;
align-items: flex-end;
color: white;
background-position: 40% 0%;
background-size: 50rem;
}
.footer-link {
margin: 1rem 0;
}
.footer-icon {
max-width: 3.2rem;
margin: 0;
}
/* Medium devices (tablets, ~641px and up) */
@media only screen and (min-width: 40.063em) {
body {
font-size: 1.15rem;
}
.home-header {
flex-direction: row;
align-items: flex-start;
}
.home-blob-text-container {
margin: 4rem 2rem 4rem 6rem;
flex-shrink: 10;
}
.home-faceshot-card {
align-self: unset;
}
.nav-bar {
padding: 0.8em 0;
background-color: white;
z-index: auto;
}
.nav-header {
margin: 0;
font-size: 1.4em;
background-color: white;
}
.nav-text {
font-weight: normal;
text-decoration: none;
z-index: 105;
color: black;
font-weight: bolder;
font-size: 3rem;
background-color: white;
}
/* #menu ul , li{
padding: 0.4em 1em;
list-style: none;
font-weight: bold;
padding-left: 4em;
} */
.list-header-title {
font-weight: normal;
font-size: 4.2em;
}
.blog-card {
flex-direction: row;
align-items: stretch;
}
.card-img {
margin: 0;
max-height: unset;
height: 100%;
width: 16em;
}
.card-img-overlay {
border-radius: 0.8rem 0.8rem 0 0;
}
.card-body {
margin: 1.3em 1.7em;
}
.card-title {
font-size: 1.3em;
}
.card-text {
font-size: 0.9em;
margin: 0.8em 0 1.2em 0;
}
.card-subtext {
font-size: 0.7em;
margin-bottom: 0.7em;
}
.content {
/* border-radius: 1.2rem; */
}
.post {
margin: 1em 1.8em 2em 1.8em;
}
.post-title {
font-size: 2em;
}
.button {
border-radius: 0.2rem;
}
.smartfloat-right {
float: right;
margin: 0 0 1.5em 1.5em;
}
.smartfloat-left {
float: left;
margin: 0 1.5em 1.5em 0;
}
code {
border-radius: 0.2rem;
}
}

350
assets/js/auto-render.js Normal file
View File

@@ -0,0 +1,350 @@
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("katex"));
else if(typeof define === 'function' && define.amd)
define(["katex"], factory);
else if(typeof exports === 'object')
exports["renderMathInElement"] = factory(require("katex"));
else
root["renderMathInElement"] = factory(root["katex"]);
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__0__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 1);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE__0__;
/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: external "katex"
var external_katex_ = __webpack_require__(0);
var external_katex_default = /*#__PURE__*/__webpack_require__.n(external_katex_);
// CONCATENATED MODULE: ./contrib/auto-render/splitAtDelimiters.js
/* eslint no-constant-condition:0 */
var findEndOfMath = function findEndOfMath(delimiter, text, startIndex) {
// Adapted from
// https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx
var index = startIndex;
var braceLevel = 0;
var delimLength = delimiter.length;
while (index < text.length) {
var character = text[index];
if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) {
return index;
} else if (character === "\\") {
index++;
} else if (character === "{") {
braceLevel++;
} else if (character === "}") {
braceLevel--;
}
index++;
}
return -1;
};
var splitAtDelimiters = function splitAtDelimiters(startData, leftDelim, rightDelim, display) {
var finalData = [];
for (var i = 0; i < startData.length; i++) {
if (startData[i].type === "text") {
var text = startData[i].data;
var lookingForLeft = true;
var currIndex = 0;
var nextIndex = void 0;
nextIndex = text.indexOf(leftDelim);
if (nextIndex !== -1) {
currIndex = nextIndex;
finalData.push({
type: "text",
data: text.slice(0, currIndex)
});
lookingForLeft = false;
}
while (true) {
if (lookingForLeft) {
nextIndex = text.indexOf(leftDelim, currIndex);
if (nextIndex === -1) {
break;
}
finalData.push({
type: "text",
data: text.slice(currIndex, nextIndex)
});
currIndex = nextIndex;
} else {
nextIndex = findEndOfMath(rightDelim, text, currIndex + leftDelim.length);
if (nextIndex === -1) {
break;
}
finalData.push({
type: "math",
data: text.slice(currIndex + leftDelim.length, nextIndex),
rawData: text.slice(currIndex, nextIndex + rightDelim.length),
display: display
});
currIndex = nextIndex + rightDelim.length;
}
lookingForLeft = !lookingForLeft;
}
finalData.push({
type: "text",
data: text.slice(currIndex)
});
} else {
finalData.push(startData[i]);
}
}
return finalData;
};
/* harmony default export */ var auto_render_splitAtDelimiters = (splitAtDelimiters);
// CONCATENATED MODULE: ./contrib/auto-render/auto-render.js
/* eslint no-console:0 */
var auto_render_splitWithDelimiters = function splitWithDelimiters(text, delimiters) {
var data = [{
type: "text",
data: text
}];
for (var i = 0; i < delimiters.length; i++) {
var delimiter = delimiters[i];
data = auto_render_splitAtDelimiters(data, delimiter.left, delimiter.right, delimiter.display || false);
}
return data;
};
/* Note: optionsCopy is mutated by this method. If it is ever exposed in the
* API, we should copy it before mutating.
*/
var auto_render_renderMathInText = function renderMathInText(text, optionsCopy) {
var data = auto_render_splitWithDelimiters(text, optionsCopy.delimiters);
if (data.length === 1 && data[0].type === 'text') {
// There is no formula in the text.
// Let's return null which means there is no need to replace
// the current text node with a new one.
return null;
}
var fragment = document.createDocumentFragment();
for (var i = 0; i < data.length; i++) {
if (data[i].type === "text") {
fragment.appendChild(document.createTextNode(data[i].data));
} else {
var span = document.createElement("span");
var math = data[i].data; // Override any display mode defined in the settings with that
// defined by the text itself
optionsCopy.displayMode = data[i].display;
try {
if (optionsCopy.preProcess) {
math = optionsCopy.preProcess(math);
}
external_katex_default.a.render(math, span, optionsCopy);
} catch (e) {
if (!(e instanceof external_katex_default.a.ParseError)) {
throw e;
}
optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e);
fragment.appendChild(document.createTextNode(data[i].rawData));
continue;
}
fragment.appendChild(span);
}
}
return fragment;
};
var renderElem = function renderElem(elem, optionsCopy) {
for (var i = 0; i < elem.childNodes.length; i++) {
var childNode = elem.childNodes[i];
if (childNode.nodeType === 3) {
// Text node
var frag = auto_render_renderMathInText(childNode.textContent, optionsCopy);
if (frag) {
i += frag.childNodes.length - 1;
elem.replaceChild(frag, childNode);
}
} else if (childNode.nodeType === 1) {
(function () {
// Element node
var className = ' ' + childNode.className + ' ';
var shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(function (x) {
return className.indexOf(' ' + x + ' ') === -1;
});
if (shouldRender) {
renderElem(childNode, optionsCopy);
}
})();
} // Otherwise, it's something else, and ignore it.
}
};
var renderMathInElement = function renderMathInElement(elem, options) {
if (!elem) {
throw new Error("No element provided to render");
}
var optionsCopy = {}; // Object.assign(optionsCopy, option)
for (var option in options) {
if (options.hasOwnProperty(option)) {
optionsCopy[option] = options[option];
}
} // default options
optionsCopy.delimiters = optionsCopy.delimiters || [{
left: "$$",
right: "$$",
display: true
}, {
left: "\\(",
right: "\\)",
display: false
}, // LaTeX uses $…$, but it ruins the display of normal `$` in text:
// {left: "$", right: "$", display: false},
// \[…\] must come last in this array. Otherwise, renderMathInElement
// will search for \[ before it searches for $$ or \(
// That makes it susceptible to finding a \\[0.3em] row delimiter and
// treating it as if it were the start of a KaTeX math zone.
{
left: "\\[",
right: "\\]",
display: true
}];
optionsCopy.ignoredTags = optionsCopy.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"];
optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || [];
optionsCopy.errorCallback = optionsCopy.errorCallback || console.error; // Enable sharing of global macros defined via `\gdef` between different
// math elements within a single call to `renderMathInElement`.
optionsCopy.macros = optionsCopy.macros || {};
renderElem(elem, optionsCopy);
};
/* harmony default export */ var auto_render = __webpack_exports__["default"] = (renderMathInElement);
/***/ })
/******/ ])["default"];
});

0
assets/js/core.js Normal file
View File