use validate as keyword for syntax checks

This commit is contained in:
Brian Gough 2016-07-27 16:53:22 +01:00
parent 14a0499b56
commit 5da1b90418
2 changed files with 10 additions and 3 deletions

View file

@ -30,7 +30,7 @@ module.exports = CompileController =
if req.body?.draft if req.body?.draft
options.draft = req.body.draft options.draft = req.body.draft
if req.body?.check if req.body?.check
options.check = if req.body.check is "error" then "error" else "warn" options.check = if req.body.check is "validate" then "validate" else undefined
logger.log {options:options, project_id:project_id, user_id:user_id}, "got compile request" logger.log {options:options, project_id:project_id, user_id:user_id}, "got compile request"
CompileManager.compile project_id, user_id, options, (error, status, outputFiles, clsiServerId, limits, validationProblems) -> CompileManager.compile project_id, user_id, options, (error, status, outputFiles, clsiServerId, limits, validationProblems) ->
return next(error) if error? return next(error) if error?

View file

@ -86,7 +86,7 @@ define [
return $http.post url, { return $http.post url, {
rootDoc_id: options.rootDocOverride_id or null rootDoc_id: options.rootDocOverride_id or null
draft: $scope.draft draft: $scope.draft
check: if options.check then "error" else "warn" check: if options.check then "validate" else null
_csrf: window.csrfToken _csrf: window.csrfToken
}, {params: params} }, {params: params}
@ -129,6 +129,12 @@ define [
$scope.pdf.view = 'errors' $scope.pdf.view = 'errors'
$scope.pdf.compileTerminated = true $scope.pdf.compileTerminated = true
fetchLogs(fileByPath) fetchLogs(fileByPath)
else if response.status in ["validation-fail", "validation-pass"]
$scope.pdf.view = 'pdf'
$scope.pdf.compileExited = true
$scope.pdf.url = last_pdf_url
$scope.shouldShowLogs = true
fetchLogs(fileByPath)
else if response.status == "exited" else if response.status == "exited"
$scope.pdf.view = 'pdf' $scope.pdf.view = 'pdf'
$scope.pdf.compileExited = true $scope.pdf.compileExited = true
@ -249,7 +255,8 @@ define [
else else
warnings.push result warnings.push result
all = [].concat errors, warnings all = [].concat errors, warnings
accumulateResults {type: "ChkTeX", all, errors, warnings} logHints = HumanReadableLogs.parse {type: "Validation", all, errors, warnings}
accumulateResults logHints
processBiber = (log) -> processBiber = (log) ->
{errors, warnings} = BibLogParser.parse(log, {}) {errors, warnings} = BibLogParser.parse(log, {})