Add client-side latex rendering (#61)
* feat: client-side katex.js * docs: add katex attribution
This commit is contained in:
parent
3424b363d4
commit
7cf3839f41
@ -35,7 +35,6 @@ This project is super lightweight by design. The UI is simple and the frontend i
|
|||||||
| [a.opnxng.com](a.opnxng.com) | Singapore | Operated by [opnxng.com](https://about.opnxng.com) |
|
| [a.opnxng.com](a.opnxng.com) | Singapore | Operated by [opnxng.com](https://about.opnxng.com) |
|
||||||
| [overflow.sudovanilla.com](https://overflow.sudovanilla.com) | United States | Operated by [SudoVanilla](https://sudovanilla.com) |
|
| [overflow.sudovanilla.com](https://overflow.sudovanilla.com) | United States | Operated by [SudoVanilla](https://sudovanilla.com) |
|
||||||
|
|
||||||
|
|
||||||
## Other Instances
|
## Other Instances
|
||||||
|
|
||||||
| Instance URL | Region | Notes |
|
| Instance URL | Region | Notes |
|
||||||
@ -121,3 +120,4 @@ Read the [wiki page](https://github.com/httpjamesm/AnonymousOverflow/wiki/Deploy
|
|||||||
- [goquery](https://github.com/PuerkitoBio/goquery) under the [BSD 3-Clause License](https://github.com/PuerkitoBio/goquery/blob/master/LICENSE)
|
- [goquery](https://github.com/PuerkitoBio/goquery) under the [BSD 3-Clause License](https://github.com/PuerkitoBio/goquery/blob/master/LICENSE)
|
||||||
- [resty](https://github.com/go-resty/resty) under the [MIT License](https://github.com/go-resty/resty/blob/master/LICENSE)
|
- [resty](https://github.com/go-resty/resty) under the [MIT License](https://github.com/go-resty/resty/blob/master/LICENSE)
|
||||||
- [Chroma](https://github.com/alecthomas/chroma) under the [MIT License](https://github.com/alecthomas/chroma/blob/master/COPYING)
|
- [Chroma](https://github.com/alecthomas/chroma) under the [MIT License](https://github.com/alecthomas/chroma/blob/master/COPYING)
|
||||||
|
- [KaTeX](https://github.com/KaTeX/KaTeX) under the [MIT License](https://github.com/KaTeX/KaTeX/blob/main/LICENSE)
|
||||||
|
125
public/katex/README.md
Normal file
125
public/katex/README.md
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
<h1><a href="https://katex.org/">
|
||||||
|
<picture>
|
||||||
|
<source media="(prefers-color-scheme: dark)" srcset="https://katex.org/img/katex-logo.svg">
|
||||||
|
<img alt="KaTeX" width=130 src="https://katex.org/img/katex-logo-black.svg">
|
||||||
|
</picture>
|
||||||
|
</a></h1>
|
||||||
|
|
||||||
|
[![npm](https://img.shields.io/npm/v/katex.svg)](https://www.npmjs.com/package/katex)
|
||||||
|
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
|
||||||
|
[![CI](https://github.com/KaTeX/KaTeX/workflows/CI/badge.svg?branch=main&event=push)](https://github.com/KaTeX/KaTeX/actions?query=workflow%3ACI)
|
||||||
|
[![codecov](https://codecov.io/gh/KaTeX/KaTeX/branch/main/graph/badge.svg)](https://codecov.io/gh/KaTeX/KaTeX)
|
||||||
|
[![Discussions](https://img.shields.io/badge/Discussions-join-brightgreen)](https://github.com/KaTeX/KaTeX/discussions)
|
||||||
|
[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/katex/badge?style=rounded)](https://www.jsdelivr.com/package/npm/katex)
|
||||||
|
![katex.min.js size](https://img.badgesize.io/https://unpkg.com/katex/dist/katex.min.js?compression=gzip)
|
||||||
|
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/KaTeX/KaTeX)
|
||||||
|
[![Financial Contributors on Open Collective](https://opencollective.com/katex/all/badge.svg?label=financial+contributors)](https://opencollective.com/katex)
|
||||||
|
|
||||||
|
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.
|
||||||
|
|
||||||
|
* **Fast:** KaTeX renders its math synchronously and doesn't need to reflow the page. See how it compares to a competitor in [this speed test](https://www.intmath.com/cg5/katex-mathjax-comparison.php).
|
||||||
|
* **Print quality:** KaTeX's layout is based on Donald Knuth's TeX, the gold standard for math typesetting.
|
||||||
|
* **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources.
|
||||||
|
* **Server side rendering:** KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML.
|
||||||
|
|
||||||
|
KaTeX is compatible with all major browsers, including Chrome, Safari, Firefox, Opera, Edge, and IE 11.
|
||||||
|
|
||||||
|
KaTeX supports much (but not all) of LaTeX and many LaTeX packages. See the [list of supported functions](https://katex.org/docs/supported.html).
|
||||||
|
|
||||||
|
Try out KaTeX [on the demo page](https://katex.org/#demo)!
|
||||||
|
|
||||||
|
## Getting started
|
||||||
|
|
||||||
|
### Starter template
|
||||||
|
|
||||||
|
```html
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css" integrity="sha384-GvrOXuhMATgEsSwCs4smul74iXGOixntILdUW9XmUC6+HX0sLNAK3q71HotJqlAn" crossorigin="anonymous">
|
||||||
|
|
||||||
|
<!-- The loading of KaTeX is deferred to speed up page rendering -->
|
||||||
|
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.js" integrity="sha384-cpW21h6RZv/phavutF+AuVYrr+dA8xD9zs6FwLpaCct6O9ctzYFfFr4dgmgccOTx" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
|
<!-- To automatically render math in text elements, include the auto-render extension: -->
|
||||||
|
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"
|
||||||
|
onload="renderMathInElement(document.body);"></script>
|
||||||
|
</head>
|
||||||
|
...
|
||||||
|
</html>
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also [download KaTeX](https://github.com/KaTeX/KaTeX/releases) and host it yourself.
|
||||||
|
|
||||||
|
For details on how to configure auto-render extension, refer to [the documentation](https://katex.org/docs/autorender.html).
|
||||||
|
|
||||||
|
### API
|
||||||
|
|
||||||
|
Call `katex.render` to render a TeX expression directly into a DOM element.
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```js
|
||||||
|
katex.render("c = \\pm\\sqrt{a^2 + b^2}", element, {
|
||||||
|
throwOnError: false
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
Call `katex.renderToString` to generate an HTML string of the rendered math,
|
||||||
|
e.g., for server-side rendering. For example:
|
||||||
|
|
||||||
|
```js
|
||||||
|
var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}", {
|
||||||
|
throwOnError: false
|
||||||
|
});
|
||||||
|
// '<span class="katex">...</span>'
|
||||||
|
```
|
||||||
|
|
||||||
|
Make sure to include the CSS and font files in both cases.
|
||||||
|
If you are doing all rendering on the server, there is no need to include the
|
||||||
|
JavaScript on the client.
|
||||||
|
|
||||||
|
The examples above use the `throwOnError: false` option, which renders invalid
|
||||||
|
inputs as the TeX source code in red (by default), with the error message as
|
||||||
|
hover text. For other available options, see the
|
||||||
|
[API documentation](https://katex.org/docs/api.html),
|
||||||
|
[options documentation](https://katex.org/docs/options.html), and
|
||||||
|
[handling errors documentation](https://katex.org/docs/error.html).
|
||||||
|
|
||||||
|
## Demo and Documentation
|
||||||
|
|
||||||
|
Learn more about using KaTeX [on the website](https://katex.org)!
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
### Code Contributors
|
||||||
|
|
||||||
|
This project exists thanks to all the people who contribute code. If you'd like to help, see [our guide to contributing code](CONTRIBUTING.md).
|
||||||
|
<a href="https://github.com/KaTeX/KaTeX/graphs/contributors"><img src="https://contributors-svg.opencollective.com/katex/contributors.svg?width=890&button=false" alt="Code contributors" /></a>
|
||||||
|
|
||||||
|
### Financial Contributors
|
||||||
|
|
||||||
|
Become a financial contributor and help us sustain our community.
|
||||||
|
|
||||||
|
#### Individuals
|
||||||
|
|
||||||
|
<a href="https://opencollective.com/katex"><img src="https://opencollective.com/katex/individuals.svg?width=890" alt="Contribute on Open Collective"></a>
|
||||||
|
|
||||||
|
#### Organizations
|
||||||
|
|
||||||
|
Support this project with your organization. Your logo will show up here with a link to your website.
|
||||||
|
|
||||||
|
<a href="https://opencollective.com/katex/organization/0/website"><img src="https://opencollective.com/katex/organization/0/avatar.svg" alt="Organization 1"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/1/website"><img src="https://opencollective.com/katex/organization/1/avatar.svg" alt="Organization 2"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/2/website"><img src="https://opencollective.com/katex/organization/2/avatar.svg" alt="Organization 3"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/3/website"><img src="https://opencollective.com/katex/organization/3/avatar.svg" alt="Organization 4"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/4/website"><img src="https://opencollective.com/katex/organization/4/avatar.svg" alt="Organization 5"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/5/website"><img src="https://opencollective.com/katex/organization/5/avatar.svg" alt="Organization 6"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/6/website"><img src="https://opencollective.com/katex/organization/6/avatar.svg" alt="Organization 7"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/7/website"><img src="https://opencollective.com/katex/organization/7/avatar.svg" alt="Organization 8"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/8/website"><img src="https://opencollective.com/katex/organization/8/avatar.svg" alt="Organization 9"></a>
|
||||||
|
<a href="https://opencollective.com/katex/organization/9/website"><img src="https://opencollective.com/katex/organization/9/avatar.svg" alt="Organization 10"></a>
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
KaTeX is licensed under the [MIT License](https://opensource.org/licenses/MIT).
|
1
public/katex/contrib/auto-render.min.js
vendored
Normal file
1
public/katex/contrib/auto-render.min.js
vendored
Normal file
@ -0,0 +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(){"use strict";var t={771:function(t){t.exports=e}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var i={};return function(){n.d(i,{default:function(){return s}});var e=n(771),t=n.n(e),r=function(e,t,r){for(var n=r,i=0,a=e.length;n<t.length;){var o=t[n];if(i<=0&&t.slice(n,n+a)===e)return n;"\\"===o?n++:"{"===o?i++:"}"===o&&i--,n++}return-1},a=/^\\begin{/,o=function(e,t){for(var n,i=[],o=new RegExp("("+t.map((function(e){return e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")})).join("|")+")");-1!==(n=e.search(o));){n>0&&(i.push({type:"text",data:e.slice(0,n)}),e=e.slice(n));var l=t.findIndex((function(t){return e.startsWith(t.left)}));if(-1===(n=r(t[l].right,e,t[l].left.length)))break;var d=e.slice(0,n+t[l].right.length),s=a.test(d)?d:e.slice(t[l].left.length,n);i.push({type:"math",data:s,rawData:d,display:t[l].display}),e=e.slice(n+t[l].right.length)}return""!==e&&i.push({type:"text",data:e}),i},l=function(e,r){var n=o(e,r.delimiters);if(1===n.length&&"text"===n[0].type)return null;for(var i=document.createDocumentFragment(),a=0;a<n.length;a++)if("text"===n[a].type)i.appendChild(document.createTextNode(n[a].data));else{var l=document.createElement("span"),d=n[a].data;r.displayMode=n[a].display;try{r.preProcess&&(d=r.preProcess(d)),t().render(d,l,r)}catch(e){if(!(e instanceof t().ParseError))throw e;r.errorCallback("KaTeX auto-render: Failed to parse `"+n[a].data+"` with ",e),i.appendChild(document.createTextNode(n[a].rawData));continue}i.appendChild(l)}return i},d=function e(t,r){for(var n=0;n<t.childNodes.length;n++){var i=t.childNodes[n];if(3===i.nodeType){for(var a=i.textContent,o=i.nextSibling,d=0;o&&o.nodeType===Node.TEXT_NODE;)a+=o.textContent,o=o.nextSibling,d++;var s=l(a,r);if(s){for(var f=0;f<d;f++)i.nextSibling.remove();n+=s.childNodes.length-1,t.replaceChild(s,i)}else n+=d}else 1===i.nodeType&&function(){var t=" "+i.className+" ";-1===r.ignoredTags.indexOf(i.nodeName.toLowerCase())&&r.ignoredClasses.every((function(e){return-1===t.indexOf(" "+e+" ")}))&&e(i,r)}()}},s=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:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],r.ignoredTags=r.ignoredTags||["script","noscript","style","textarea","pre","code","option"],r.ignoredClasses=r.ignoredClasses||[],r.errorCallback=r.errorCallback||console.error,r.macros=r.macros||{},d(e,r)}}(),i=i.default}()}));
|
BIN
public/katex/fonts/KaTeX_AMS-Regular.ttf
Normal file
BIN
public/katex/fonts/KaTeX_AMS-Regular.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_AMS-Regular.woff
Normal file
BIN
public/katex/fonts/KaTeX_AMS-Regular.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_AMS-Regular.woff2
Normal file
BIN
public/katex/fonts/KaTeX_AMS-Regular.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Caligraphic-Bold.ttf
Normal file
BIN
public/katex/fonts/KaTeX_Caligraphic-Bold.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Caligraphic-Bold.woff
Normal file
BIN
public/katex/fonts/KaTeX_Caligraphic-Bold.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Caligraphic-Bold.woff2
Normal file
BIN
public/katex/fonts/KaTeX_Caligraphic-Bold.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Caligraphic-Regular.ttf
Normal file
BIN
public/katex/fonts/KaTeX_Caligraphic-Regular.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Caligraphic-Regular.woff
Normal file
BIN
public/katex/fonts/KaTeX_Caligraphic-Regular.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Caligraphic-Regular.woff2
Normal file
BIN
public/katex/fonts/KaTeX_Caligraphic-Regular.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Fraktur-Bold.ttf
Normal file
BIN
public/katex/fonts/KaTeX_Fraktur-Bold.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Fraktur-Bold.woff
Normal file
BIN
public/katex/fonts/KaTeX_Fraktur-Bold.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Fraktur-Bold.woff2
Normal file
BIN
public/katex/fonts/KaTeX_Fraktur-Bold.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Fraktur-Regular.ttf
Normal file
BIN
public/katex/fonts/KaTeX_Fraktur-Regular.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Fraktur-Regular.woff
Normal file
BIN
public/katex/fonts/KaTeX_Fraktur-Regular.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Fraktur-Regular.woff2
Normal file
BIN
public/katex/fonts/KaTeX_Fraktur-Regular.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Main-Bold.ttf
Normal file
BIN
public/katex/fonts/KaTeX_Main-Bold.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Main-Bold.woff
Normal file
BIN
public/katex/fonts/KaTeX_Main-Bold.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Main-Bold.woff2
Normal file
BIN
public/katex/fonts/KaTeX_Main-Bold.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Main-BoldItalic.ttf
Normal file
BIN
public/katex/fonts/KaTeX_Main-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Main-BoldItalic.woff
Normal file
BIN
public/katex/fonts/KaTeX_Main-BoldItalic.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Main-BoldItalic.woff2
Normal file
BIN
public/katex/fonts/KaTeX_Main-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Main-Italic.ttf
Normal file
BIN
public/katex/fonts/KaTeX_Main-Italic.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Main-Italic.woff
Normal file
BIN
public/katex/fonts/KaTeX_Main-Italic.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Main-Italic.woff2
Normal file
BIN
public/katex/fonts/KaTeX_Main-Italic.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Main-Regular.ttf
Normal file
BIN
public/katex/fonts/KaTeX_Main-Regular.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Main-Regular.woff
Normal file
BIN
public/katex/fonts/KaTeX_Main-Regular.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Main-Regular.woff2
Normal file
BIN
public/katex/fonts/KaTeX_Main-Regular.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Math-BoldItalic.ttf
Normal file
BIN
public/katex/fonts/KaTeX_Math-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Math-BoldItalic.woff
Normal file
BIN
public/katex/fonts/KaTeX_Math-BoldItalic.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Math-BoldItalic.woff2
Normal file
BIN
public/katex/fonts/KaTeX_Math-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Math-Italic.ttf
Normal file
BIN
public/katex/fonts/KaTeX_Math-Italic.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Math-Italic.woff
Normal file
BIN
public/katex/fonts/KaTeX_Math-Italic.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Math-Italic.woff2
Normal file
BIN
public/katex/fonts/KaTeX_Math-Italic.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_SansSerif-Bold.ttf
Normal file
BIN
public/katex/fonts/KaTeX_SansSerif-Bold.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_SansSerif-Bold.woff
Normal file
BIN
public/katex/fonts/KaTeX_SansSerif-Bold.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_SansSerif-Bold.woff2
Normal file
BIN
public/katex/fonts/KaTeX_SansSerif-Bold.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_SansSerif-Italic.ttf
Normal file
BIN
public/katex/fonts/KaTeX_SansSerif-Italic.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_SansSerif-Italic.woff
Normal file
BIN
public/katex/fonts/KaTeX_SansSerif-Italic.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_SansSerif-Italic.woff2
Normal file
BIN
public/katex/fonts/KaTeX_SansSerif-Italic.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_SansSerif-Regular.ttf
Normal file
BIN
public/katex/fonts/KaTeX_SansSerif-Regular.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_SansSerif-Regular.woff
Normal file
BIN
public/katex/fonts/KaTeX_SansSerif-Regular.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_SansSerif-Regular.woff2
Normal file
BIN
public/katex/fonts/KaTeX_SansSerif-Regular.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Script-Regular.ttf
Normal file
BIN
public/katex/fonts/KaTeX_Script-Regular.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Script-Regular.woff
Normal file
BIN
public/katex/fonts/KaTeX_Script-Regular.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Script-Regular.woff2
Normal file
BIN
public/katex/fonts/KaTeX_Script-Regular.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Size1-Regular.ttf
Normal file
BIN
public/katex/fonts/KaTeX_Size1-Regular.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Size1-Regular.woff
Normal file
BIN
public/katex/fonts/KaTeX_Size1-Regular.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Size1-Regular.woff2
Normal file
BIN
public/katex/fonts/KaTeX_Size1-Regular.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Size2-Regular.ttf
Normal file
BIN
public/katex/fonts/KaTeX_Size2-Regular.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Size2-Regular.woff
Normal file
BIN
public/katex/fonts/KaTeX_Size2-Regular.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Size2-Regular.woff2
Normal file
BIN
public/katex/fonts/KaTeX_Size2-Regular.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Size3-Regular.ttf
Normal file
BIN
public/katex/fonts/KaTeX_Size3-Regular.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Size3-Regular.woff
Normal file
BIN
public/katex/fonts/KaTeX_Size3-Regular.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Size3-Regular.woff2
Normal file
BIN
public/katex/fonts/KaTeX_Size3-Regular.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Size4-Regular.ttf
Normal file
BIN
public/katex/fonts/KaTeX_Size4-Regular.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Size4-Regular.woff
Normal file
BIN
public/katex/fonts/KaTeX_Size4-Regular.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Size4-Regular.woff2
Normal file
BIN
public/katex/fonts/KaTeX_Size4-Regular.woff2
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Typewriter-Regular.ttf
Normal file
BIN
public/katex/fonts/KaTeX_Typewriter-Regular.ttf
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Typewriter-Regular.woff
Normal file
BIN
public/katex/fonts/KaTeX_Typewriter-Regular.woff
Normal file
Binary file not shown.
BIN
public/katex/fonts/KaTeX_Typewriter-Regular.woff2
Normal file
BIN
public/katex/fonts/KaTeX_Typewriter-Regular.woff2
Normal file
Binary file not shown.
1
public/katex/katex.min.css
vendored
Normal file
1
public/katex/katex.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/katex/katex.min.js
vendored
Normal file
1
public/katex/katex.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
12
public/question.js
Normal file
12
public/question.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
const doRender = () => {
|
||||||
|
renderMathInElement(document.body, {
|
||||||
|
delimiters: [
|
||||||
|
{ left: '$$', right: '$$', display: true },
|
||||||
|
{ left: '\\[', right: '\\]', display: true },
|
||||||
|
{ left: '$', right: '$', display: false },
|
||||||
|
{ left: '\\(', right: '\\)', display: false },
|
||||||
|
],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
doRender();
|
@ -7,10 +7,18 @@
|
|||||||
<link rel="stylesheet" href="/static/comments.css" />
|
<link rel="stylesheet" href="/static/comments.css" />
|
||||||
<meta
|
<meta
|
||||||
http-equiv="Content-Security-Policy"
|
http-equiv="Content-Security-Policy"
|
||||||
content="default-src 'none'; style-src 'self'; script-src 'none'; img-src {{ .imagePolicy }};"
|
content="default-src 'none'; style-src 'self'; script-src 'self'; img-src {{ .imagePolicy }};"
|
||||||
/>
|
/>
|
||||||
<meta name="description" content="{{ .question.ShortenedBody }}..." />
|
<meta name="description" content="{{ .question.ShortenedBody }}..." />
|
||||||
{{ template "sharedHead.html" }}
|
{{ template "sharedHead.html" }}
|
||||||
|
<link rel="stylesheet" href="/static/katex/katex.min.css">
|
||||||
|
|
||||||
|
<!-- The loading of KaTeX is deferred to speed up page rendering -->
|
||||||
|
<script defer src="/static/katex/katex.min.js"></script>
|
||||||
|
|
||||||
|
<!-- To automatically render math in text elements, include the auto-render extension: -->
|
||||||
|
<script defer src="/static/katex/contrib/auto-render.min.js"></script>
|
||||||
|
<script defer src="/static/question.js" type="text/javascript"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="parent">
|
<div class="parent">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user