diff --git a/katex.js b/katex.js index 232d9dd1..7b9700e8 100644 --- a/katex.js +++ b/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. diff --git a/release.sh b/release.sh index 21fa2b27..b26f3c36 100755 --- a/release.sh +++ b/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