From ba56740aaec481b6f6c4583ee1f75ebc5d37a6d4 Mon Sep 17 00:00:00 2001 From: Arnavion Date: Sun, 25 Aug 2013 18:14:32 -0700 Subject: [PATCH] Removed the example code from index.js that builds the PEG.js parser in the browser. The parser should now be built on the server. Since is what a user should do in production anyway, having code that builds the parser in the browser was unnecessary and confusing. This does add an additional build dependency of PEG.js. The minified script should include the parser in the same file, i.e., libjass.js and ass.pegjs.js should be minifed together into libjass.min.js. The instructions for minification have been updated to reflect this. Tests have been updated likewise, and now have prettier output. --- .gitignore | 4 + BUILD.md | 17 +- LICENSE | 7 - README.md | 11 +- dialogue.ts | 2 +- index.js | 40 +- index.xhtml | 7 +- parser.ts | 11 +- peg-0.7.0.js | 4528 ---------------------------------------------- peg-0.7.0.min.js | 9 - test/index.js | 133 +- test/index.xhtml | 16 +- 12 files changed, 103 insertions(+), 4682 deletions(-) delete mode 100644 peg-0.7.0.js delete mode 100644 peg-0.7.0.min.js diff --git a/.gitignore b/.gitignore index 87f0313..7938528 100644 --- a/.gitignore +++ b/.gitignore @@ -4,10 +4,14 @@ libjass.js parser.js tags.js utility.js + +ass.pegjs.js + dialogue.min.js iterators.min.js libjass.min.js parser.min.js tags.min.js utility.min.js + *.map diff --git a/BUILD.md b/BUILD.md index 628a3b9..bcf2357 100644 --- a/BUILD.md +++ b/BUILD.md @@ -2,10 +2,20 @@ 1. node.js http://nodejs.org/ (or via your package manager) 1. TypeScript http://www.typescriptlang.org/#Download + npm install typescript + + 1. PEG.js http://pegjs.majda.cz/ + + npm install pegjs + 1. Generate libjass.js tsc libjass.ts --out libjass.js --sourcemap --noImplicitAny --target ES5 +1. Generate ass.pegjs.js + + pegjs --export-var "libjass.parser" ass.pegjs ass.pegjs.js + 1. Set the URLs of the video and the ASS file in index.xhtml