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:
Ethan Luis McDonough
2018-05-02 16:45:49 -05:00
committed by Erik Demaine
parent 5535d720dc
commit 2554f68297
2 changed files with 12 additions and 6 deletions

View File

@@ -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.

View File

@@ -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