use of com.twosigma.beakerx.kernel.magic.command.outcome.MagicCommandResult in project beakerx by twosigma.
the class HtmlMagicCommand method execute.
@Override
public MagicCommandOutcomeItem execute(MagicCommandExecutionParam param) {
String commandCodeBlock = param.getCommandCodeBlock();
if (commandCodeBlock == null) {
return new MagicCommandOutput(MagicCommandOutput.Status.ERROR, String.format(USAGE_ERROR_MSG, HTML));
}
MIMEContainer html = HTML("<html>" + commandCodeBlock + "</html>");
return new MagicCommandResult(MagicCommandOutcomeItem.Status.OK, html);
}
use of com.twosigma.beakerx.kernel.magic.command.outcome.MagicCommandResult in project beakerx by twosigma.
the class JavaScriptMagicCommand method execute.
@Override
public MagicCommandOutcomeItem execute(MagicCommandExecutionParam param) {
String commandCodeBlock = param.getCommandCodeBlock();
MIMEContainer result = JavaScript(commandCodeBlock);
return new MagicCommandResult(MagicCommandOutcomeItem.Status.OK, result);
}
Aggregations