Specify file to open in output-pane in custom runner

runner

#1

With custom runners one get always a preview pane listening to https://workspace-username.c9users.io/. I have no problem to run a simple webserver to serve my file, but I want the preview to point to a file say: https://workspace-username.c9users.io/output.pdf.

Background: I use c9 to compile ConTeXt-documents (a TeX macro language). My output is a pdf-document. Would be nice, if I could use the builtin runners to display the resulting document.

A solution would be to specify the file to display in the preview pane in the custom runner script (say https://workspace-username.c9users.io/output.pdf or relative /output.pdf). It would be even better, when no webserver would be needed.

I have tried to redirect https://workspace-username.c9users.io/ to https://workspace-username.c9users.io/output.pdf but no success (the pdf-document is loaded but probably because of sandboxing not displayed). The document is only displayed, when the preview pane shows the correct url: https://workspace-username.c9users.io/output.pdf. Even a html-link doesn’t change the url in the preview pane (so again no display of the pdf-document, but it’s loaded like before). Opening in external window works in both cases.


#2

There is no way to change the url opened by preview button, but you can print a clickable url in output like this:

echo -e "See output at \\033[01;34m https://$C9_HOSTNAME/output.pdf \\033[00m"

#3

Many thanks harutyun. That solves a good part of the problem.

Now I have a following question. Is it possible to stop the runner to open a preview tab (which I don’t need now with your solution), when I just click the button “run” and not “preview”? Also the builder opens a preview window. I won’t expect a builder to preview anything.