Generate ECMAScript module for contrib (#1624)

* Create separate entry point of copy-tex for webpack

* Update katex.webpack.js comment

* Generate ECMAScript for contrib

* Update dependencies

* Comment out documentations
This commit is contained in:
ylemkimon
2018-10-31 11:37:54 +09:00
committed by GitHub
parent 1d79483291
commit f628ca142b
10 changed files with 54 additions and 10 deletions

View File

@@ -43,6 +43,19 @@ For example:
</script>
```
<!-- TODO: uncomment when releasing a new version
ECMAScript module is also available:
```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.0-beta/dist/katex.min.css" integrity="sha384-9tPv11A+glH/on/wEu99NVwDPwkMQESOocs/ZGXPoIiLE8MU/qkqUcZ3zzL+6DuH" crossorigin="anonymous">
<script type="module">
import renderMathInElement from "https://cdn.jsdelivr.net/npm/katex@0.10.0-beta/dist/contrib/auto-render.mjs";
renderMathInElement(document.body);
</script>
```
> You can use [`nomodule` attribute](https://developer.mozilla.org/en/HTML/Element/script#Attributes)
to provide a fallback for older browsers that do not support ES modules. -->
## API
This extension exposes a single function, `window.renderMathInElement`, with
the following API: