mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-04 18:58:39 +00:00
Add version to katex object (#1279)
* Add version to katex object Address khan/KaTeX#1190 * Update package.json before building
This commit is contained in:
committed by
Erik Demaine
parent
5535d720dc
commit
2554f68297
6
katex.js
6
katex.js
@@ -20,6 +20,8 @@ import type ParseNode from "./src/ParseNode";
|
||||
|
||||
import { defineSymbol } from './src/symbols';
|
||||
|
||||
import { version } from "./package.json";
|
||||
|
||||
/**
|
||||
* Parse and build an expression, and place that expression in the DOM node
|
||||
* given.
|
||||
@@ -97,6 +99,10 @@ const renderToHTMLTree = function(
|
||||
};
|
||||
|
||||
export default {
|
||||
/**
|
||||
* Current KaTeX version
|
||||
*/
|
||||
version,
|
||||
/**
|
||||
* Renders the given LaTeX into an HTML+MathML combination, and adds
|
||||
* it as a child to the specified DOM node.
|
||||
|
12
release.sh
12
release.sh
@@ -102,6 +102,12 @@ git checkout "$BRANCH"
|
||||
git pull
|
||||
git checkout --detach
|
||||
|
||||
# Edit package.json and bower.json to the right version (see
|
||||
# http://stackoverflow.com/a/22084103 for why we need the .bak file to make
|
||||
# this mac & linux compatible)
|
||||
sed -i.bak -E 's|"version": "[^"]+",|"version": "'$VERSION'",|' package.json
|
||||
rm -f package.json.bak
|
||||
|
||||
# Build generated files and add them to the repository (for bower)
|
||||
git clean -fdx build dist
|
||||
npm run dist
|
||||
@@ -109,12 +115,6 @@ sed -i.bak -E '/^\/dist\/$/d' .gitignore
|
||||
rm -f .gitignore.bak
|
||||
git add .gitignore dist/
|
||||
|
||||
# Edit package.json and bower.json to the right version (see
|
||||
# http://stackoverflow.com/a/22084103 for why we need the .bak file to make
|
||||
# this mac & linux compatible)
|
||||
sed -i.bak -E 's|"version": "[^"]+",|"version": "'$VERSION'",|' package.json
|
||||
rm -f package.json.bak
|
||||
|
||||
# Update the version number in CDN URLs included in the README files,
|
||||
# and regenerate the Subresource Integrity hash for these files.
|
||||
node update-sri.js "${VERSION}" README.md contrib/*/README.md dist/README.md
|
||||
|
Reference in New Issue
Block a user