mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 03:08:40 +00:00
chore(release): 0.14.0 [ci skip]
# [0.14.0](https://github.com/KaTeX/KaTeX/compare/v0.13.24...v0.14.0) (2021-10-30) ### Features * conditionally export ECMAScript modules ([#3377](https://github.com/KaTeX/KaTeX/issues/3377)) ([15ee9b4
](15ee9b4a5a
)) ### BREAKING CHANGES * With module loaders that support conditional exports and ECMAScript modules, `import katex from 'katex';` will import the ECMAScript module. You can now use: |Before |After | |------------------------------------------|----------------------------------| |`require('katex/dist/contrib/[name].js')` | `require('katex/contrib/[name]')`| |`import katex from 'katex/dist/katex.mjs'`| `import katex from 'katex'` | |`import 'katex/dist/contrib/[name].mjs'` | `import 'katex/contrib/[name]'` |
This commit is contained in:
@@ -11,13 +11,13 @@ title: Browser
|
||||
<!-- 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.13.24/dist/katex.min.css" integrity="sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.14.0/dist/katex.min.css" integrity="sha384-3XGqzlo+LecQmisZRaN2PyqKjEqiUrqliTjdV44NMwknt6bwCB86kqxXVKJn1Vy8" crossorigin="anonymous">
|
||||
|
||||
<!-- The loading of KaTeX is deferred to speed up page rendering -->
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.js" integrity="sha384-y3g41vuZ3g2863mUshHxmagM9cH+0OMx0GV9fP/LMVwSVIeIVxvIfMaMReNn0jO+" crossorigin="anonymous"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.14.0/dist/katex.min.js" integrity="sha384-uo6U/HIvh6QTbZVnCC/GMFnQHrNArO2ZBframC7vU/vju5N3Em3sTJg4TldoSiS7" 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.13.24/dist/contrib/auto-render.min.js" integrity="sha384-+XBljXPPiv+OzfbB3cVmLHf4hdUFHlWNZN5spNQ7rmHTXpd7WvJum6fIACpNNfIR" crossorigin="anonymous"
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.14.0/dist/contrib/auto-render.min.js" integrity="sha384-+XBljXPPiv+OzfbB3cVmLHf4hdUFHlWNZN5spNQ7rmHTXpd7WvJum6fIACpNNfIR" crossorigin="anonymous"
|
||||
onload="renderMathInElement(document.body);"></script>
|
||||
</head>
|
||||
...
|
||||
@@ -29,15 +29,15 @@ If you include the `katex.js` directly, the `katex` object will be available as
|
||||
a global variable.
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.css" integrity="sha384-hhCT+HvwBCedN5CIwSZjd/67b50aMb1KNTp96Zck6HNqj2BAaD2V7dAjtnisgKRh" crossorigin="anonymous">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.js" integrity="sha384-BkQmKuI4/YPJhko4Xxoonc6+DFWzZEsO/LJNSGLpaxIWSykY/ufYR8mdGCbOf8Ld" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.14.0/dist/katex.css" integrity="sha384-R5whUx/BYVxc4UxgGzPTGudyXPObFTwLnwck1mJ0AbfEaDi34wINrJU3ZoocVPYc" crossorigin="anonymous">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.14.0/dist/katex.js" integrity="sha384-tC9Z1uBOYiqT0iTFuRNcO1esuXp5FVRf6nFgU/2z8DfVarpW+k0r6rZXoAUoISmm" crossorigin="anonymous"></script>
|
||||
```
|
||||
|
||||
KaTeX also provides minified versions:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css" integrity="sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM" crossorigin="anonymous">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.js" integrity="sha384-y3g41vuZ3g2863mUshHxmagM9cH+0OMx0GV9fP/LMVwSVIeIVxvIfMaMReNn0jO+" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.14.0/dist/katex.min.css" integrity="sha384-3XGqzlo+LecQmisZRaN2PyqKjEqiUrqliTjdV44NMwknt6bwCB86kqxXVKJn1Vy8" crossorigin="anonymous">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.14.0/dist/katex.min.js" integrity="sha384-uo6U/HIvh6QTbZVnCC/GMFnQHrNArO2ZBframC7vU/vju5N3Em3sTJg4TldoSiS7" crossorigin="anonymous"></script>
|
||||
```
|
||||
|
||||
The examples above load the script [deferred using the `defer` attribute](https://developer.mozilla.org/en/HTML/Element/script#Attributes)
|
||||
@@ -81,22 +81,22 @@ for more detail.
|
||||
```html
|
||||
<script type="text/javascript">
|
||||
require([
|
||||
"https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.js",
|
||||
"https://cdn.jsdelivr.net/npm/katex@0.14.0/dist/katex.js",
|
||||
], katex => {
|
||||
...
|
||||
});
|
||||
</script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.css" integrity="sha384-hhCT+HvwBCedN5CIwSZjd/67b50aMb1KNTp96Zck6HNqj2BAaD2V7dAjtnisgKRh" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.14.0/dist/katex.css" integrity="sha384-R5whUx/BYVxc4UxgGzPTGudyXPObFTwLnwck1mJ0AbfEaDi34wINrJU3ZoocVPYc" crossorigin="anonymous">
|
||||
```
|
||||
|
||||
### ECMAScript module
|
||||
```html
|
||||
<script type="module" type="text/javascript">
|
||||
import katex from 'https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.mjs';
|
||||
import katex from 'https://cdn.jsdelivr.net/npm/katex@0.14.0/dist/katex.mjs';
|
||||
...
|
||||
</script>
|
||||
<script nomodule defer src="https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.js" integrity="sha384-BkQmKuI4/YPJhko4Xxoonc6+DFWzZEsO/LJNSGLpaxIWSykY/ufYR8mdGCbOf8Ld" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.css" integrity="sha384-hhCT+HvwBCedN5CIwSZjd/67b50aMb1KNTp96Zck6HNqj2BAaD2V7dAjtnisgKRh" crossorigin="anonymous">
|
||||
<script nomodule defer src="https://cdn.jsdelivr.net/npm/katex@0.14.0/dist/katex.js" integrity="sha384-tC9Z1uBOYiqT0iTFuRNcO1esuXp5FVRf6nFgU/2z8DfVarpW+k0r6rZXoAUoISmm" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.14.0/dist/katex.css" integrity="sha384-R5whUx/BYVxc4UxgGzPTGudyXPObFTwLnwck1mJ0AbfEaDi34wINrJU3ZoocVPYc" crossorigin="anonymous">
|
||||
```
|
||||
|
||||
> Use [`nomodule` attribute](https://developer.mozilla.org/en/HTML/Element/script#Attributes)
|
||||
|
Reference in New Issue
Block a user