7 Commits

Author SHA1 Message Date
hugh-obrien
bfe31098cb send html 2018-07-09 14:37:54 +01:00
hugh-obrien
a1f9305047 hard coded a word doc 2018-07-09 14:02:39 +01:00
hugh-obrien
c66d76af2d make it do pdf 2018-07-09 13:52:18 +01:00
hugh-obrien
b8c82620e5 main file hack 2018-07-09 13:45:57 +01:00
hugh-obrien
3b905353d0 main file fix nonsence 2018-07-09 11:40:40 +01:00
hugh-obrien
af6a402a87 fix array nonsense 2018-07-09 11:37:57 +01:00
hugh-obrien
3c639959f4 hack in the command and image 2018-07-09 11:35:19 +01:00
2 changed files with 10 additions and 2 deletions

View File

@@ -39,6 +39,8 @@ module.exports = CompileController =
for file in outputFiles for file in outputFiles
if file.path?.match(/output\.pdf$/) if file.path?.match(/output\.pdf$/)
status = "success" status = "success"
if file.path?.match(/output\.html$/)
status = "success"
# log an error if any core files are found # log an error if any core files are found
for file in outputFiles for file in outputFiles
if file.path is "core" if file.path is "core"
@@ -48,7 +50,7 @@ module.exports = CompileController =
res.status(code or 200).send { res.status(code or 200).send {
compile: compile:
status: status status: status
error: error?.message or error error: error?.message or error
outputFiles: outputFiles.map (file) -> outputFiles: outputFiles.map (file) ->
url: url:
"#{Settings.apis.clsi.url}/project/#{request.project_id}" + "#{Settings.apis.clsi.url}/project/#{request.project_id}" +

View File

@@ -16,7 +16,7 @@ module.exports = LatexRunner =
# We want to run latexmk on the tex file which we will automatically # We want to run latexmk on the tex file which we will automatically
# generate from the Rtex/Rmd/md file. # generate from the Rtex/Rmd/md file.
mainFile = mainFile.replace(/\.(Rtex|md|Rmd)$/, ".tex") mainFile = mainFile.replace(/\.(Rtex|md|Rmd)$/, ".md")
if compiler == "pdflatex" if compiler == "pdflatex"
command = LatexRunner._pdflatexCommand mainFile command = LatexRunner._pdflatexCommand mainFile
@@ -32,6 +32,12 @@ module.exports = LatexRunner =
if Settings.clsi?.strace if Settings.clsi?.strace
command = ["strace", "-o", "strace", "-ff"].concat(command) command = ["strace", "-o", "strace", "-ff"].concat(command)
# ignore the above and make a pandoc command
console.log(mainFile)
console.log(image)
image = "ivotron/pandoc"
command = ["-o", "$COMPILE_DIR/output.html", "/compile/" + mainFile]
id = "#{project_id}" # record running project under this id id = "#{project_id}" # record running project under this id
ProcessTable[id] = CommandRunner.run project_id, command, directory, image, timeout, environment, (error, output) -> ProcessTable[id] = CommandRunner.run project_id, command, directory, image, timeout, environment, (error, output) ->