Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

allow stdout/stderr to have distinct css

make stderr output darkred
  • Loading branch information...
commit fd4dbc9a3ffb061c8e80fdf9a6463230c93f4d13 1 parent ce4076d
@minrk authored
View
3  IPython/frontend/html/notebook/static/css/notebook.css
@@ -232,6 +232,9 @@ div.output_stream {
color: black;
font-family: monospace;
}
+div.output_stderr {
+ color: darkred;
+}
div.output_latex {
text-align: left;
View
12 IPython/frontend/html/notebook/static/js/codecell.js
@@ -256,20 +256,21 @@ var IPython = (function (IPython) {
if (json.stream == undefined){
json.stream = 'stdout';
}
+ var subclass = "output_"+json.stream;
if (this.outputs.length > 0){
// have at least one output to consider
var last = this.outputs[this.outputs.length-1];
if (last.output_type == 'stream' && json.stream == last.stream){
// latest output was in the same stream,
// so append directly into its pre tag
- this.element.find('div.output_stream').last().find('pre').append(json.text);
+ this.element.find('div.'+subclass).last().find('pre').append(json.text);
return;
}
}
// If we got here, attach a new div
var toinsert = this.create_output_area();
- this.append_text(json.text, toinsert);
+ this.append_text(json.text, toinsert, subclass);
this.element.find('div.output').append(toinsert);
};
@@ -309,8 +310,11 @@ var IPython = (function (IPython) {
}
- CodeCell.prototype.append_text = function (data, element) {
+ CodeCell.prototype.append_text = function (data, element, extra_class) {
var toinsert = $("<div/>").addClass("box_flex1 output_subarea output_stream");
+ if (extra_class){
+ toinsert.addClass(extra_class);
+ }
toinsert.append($("<pre/>").html(data));
element.append(toinsert);
};
@@ -419,7 +423,7 @@ var IPython = (function (IPython) {
CodeCell.prototype.fromJSON = function (data) {
- // console.log('Import from JSON:', data);
+ console.log('Import from JSON:', data);
if (data.cell_type === 'code') {
if (data.input !== undefined) {
this.set_code(data.input);
Please sign in to comment.
Something went wrong with that request. Please try again.