mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-08 04:28:41 +00:00
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:
@@ -35,6 +35,12 @@ If you want to build your own custom copy handler based on this one,
|
||||
copy the `copy-tex.js` into your codebase and replace the `require`
|
||||
statement with `require('katex/contrib/copy-tex/katex2tex.js')`.
|
||||
|
||||
<!-- TODO: uncomment when releasing a new version
|
||||
ECMAScript module is also available:
|
||||
```html
|
||||
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.10.0-beta/dist/contrib/copy-tex.mjs" integrity="sha384-jLtlhlpasgCe2I4eVNEStxiWP4slZdWUk3E3FgbblMBxLs6YlA/rMNSeiGTRfAQ/" crossorigin="anonymous"></script>
|
||||
```` -->
|
||||
|
||||
### Known Issues
|
||||
|
||||
This extension has been tested on Chrome, Firefox, Edge, and Safari.
|
||||
|
@@ -1,4 +1,3 @@
|
||||
import './copy-tex.css';
|
||||
import katexReplaceWithTex from './katex2tex';
|
||||
|
||||
// Global copy handler to modify behavior on .katex elements.
|
||||
|
6
contrib/copy-tex/copy-tex.webpack.js
Normal file
6
contrib/copy-tex/copy-tex.webpack.js
Normal file
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* This is the webpack entry point for KaTeX. As ECMAScript doesn't support
|
||||
* CSS modules natively, a separate entry point is used.
|
||||
*/
|
||||
import './copy-tex.css';
|
||||
import './copy-tex.js';
|
@@ -14,8 +14,6 @@ This extension should be loaded *after* all `script type=math/tex` blocks that y
|
||||
```html
|
||||
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/contrib/mathtex-script-type.min.js" integrity="sha384-zWYbd0NBwgTsgIdFKVprSfTh1mbMPe5Hz1X3yY4Sd1h/K1cQoUe36OGwAGz/PcDy"></script>
|
||||
```
|
||||
Note that if the URL above contains `...` in-place of a version string, then this script has not yet
|
||||
been deployed to the CDN.
|
||||
You can download the script and use it locally, or from a local KaTeX installation instead.
|
||||
|
||||
For example, in the following simple page, we first load KaTeX as usual.
|
||||
@@ -34,3 +32,9 @@ After we're done writing `math/tex` scripts, we load this extension.
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
<!-- TODO: uncomment when releasing a new version
|
||||
ECMAScript module is also available:
|
||||
```html
|
||||
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.10.0-beta/dist/contrib/mathtex-script-type.mjs" integrity="sha384-En8cse3uW4xErwYkF3uTpWEw4BdLEWrWT2u1BttQuilGrJjAKcpGeC2ihwJ/wRD4" crossorigin="anonymous"></script>
|
||||
```` -->
|
||||
|
Reference in New Issue
Block a user