overleaf/libraries/latex-log-parser
Brian Gough e0cb3c1107 Merge pull request #5228 from overleaf/bg-add-missing-test-file
[latex-log-parser] add missing test file

GitOrigin-RevId: a3b5acc92182da1826ba20be1c8d52c7e54b676f
2021-09-27 08:03:17 +00:00
..
src/js Merge pull request #4937 from overleaf/bg-accept-spaces-in-log-filenames 2021-09-24 08:02:51 +00:00
tests Merge pull request #5228 from overleaf/bg-add-missing-test-file 2021-09-27 08:03:17 +00:00
.eslintrc Merge pull request #4940 from overleaf/bg-add-prettier-and-eslint-to-latex-log-parser 2021-09-07 08:02:51 +00:00
.gitignore Merge pull request #4703 from overleaf/jpa-import-latex-log-parser 2021-08-13 12:58:28 +00:00
.nvmrc Merge pull request #4703 from overleaf/jpa-import-latex-log-parser 2021-08-13 12:58:28 +00:00
.prettierrc Merge pull request #4940 from overleaf/bg-add-prettier-and-eslint-to-latex-log-parser 2021-09-07 08:02:51 +00:00
buildscript.txt Merge pull request #4703 from overleaf/jpa-import-latex-log-parser 2021-08-13 12:58:28 +00:00
package-lock.json Merge pull request #4940 from overleaf/bg-add-prettier-and-eslint-to-latex-log-parser 2021-09-07 08:02:51 +00:00
package.json Merge pull request #4937 from overleaf/bg-accept-spaces-in-log-filenames 2021-09-24 08:02:51 +00:00
README.md Merge pull request #4703 from overleaf/jpa-import-latex-log-parser 2021-08-13 12:58:28 +00:00

latex-log-parser

A set of parsers for Latex logs.

Usage

Each parser is provided by a requirejs module, found in the dist directory. Each parser exposes a parse method which takes a text string (representing the log to be parsed) and an options object.

Example:

define([
	'path/to/latex-log-parser'
], function(LatexLogParser) {
	var logText = "...";
	var logEntries = LatexLogParser.parse(logText, {ignoreDuplicates: true});
});

Build

First install dependencies:

$ npm install

Then run the compile npm task: npm run-script compile

Then the compiled modules will appear in the dist directory

Testing

The test are in tests/tests.js, to run them launch a http-server of some kind from the root directory of this project, then visit /tests in a web browser. Example:

$ npm install -g http-server
$ http-server
$ # now visit http://localhost:8080/tests in a browser