Skip to content

Commit

Permalink
Merge pull request jupyter#245 from parente/fix-markdown-display
Browse files Browse the repository at this point in the history
Render markdown from code execution
  • Loading branch information
jhpedemonte committed May 23, 2016
2 parents 9a592a8 + c2ca6b1 commit 15cf5e5
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 10 deletions.
1 change: 1 addition & 0 deletions client/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ if (Element && !Element.prototype.matches) {
var rm = new RenderMime.RenderMime();
var transformers = [
new renderers.JavascriptRenderer(),
new renderers.MarkdownRenderer(),
// new renderers.HTMLRenderer(),
// NOTE: The HTMLRenderer doesn't work with current Safari versions -- inline JS scripts
// don't load. This simple implementation works around it by using jQuery to add the
Expand Down
56 changes: 47 additions & 9 deletions etc/notebooks/test/test_markdown.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"urth": {
"dashboard": {
"layout": {
"col": 9,
"col": 5,
"height": 4,
"row": 0,
"width": 2
"row": 4,
"width": 4
}
}
},
Expand All @@ -48,10 +48,10 @@
"urth": {
"dashboard": {
"layout": {
"col": 7,
"col": 0,
"height": 4,
"row": 0,
"width": 2
"row": 4,
"width": 5
}
}
},
Expand All @@ -74,7 +74,7 @@
"col": 5,
"height": 4,
"row": 0,
"width": 2
"width": 4
}
}
},
Expand All @@ -87,6 +87,44 @@
"%%html\n",
"<small>I am a code %%html cell with &lt;small&gt; wrapping my <strong>content</strong> which includes <a href=\"http://ibm.com\">a link in HTML</a></small>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"urth": {
"dashboard": {
"hidden": true,
"layout": {}
}
}
},
"outputs": [],
"source": [
"from IPython.display import Markdown, display"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"urth": {
"dashboard": {
"layout": {
"col": 0,
"height": 4,
"row": 8,
"width": 5
}
}
}
},
"outputs": [],
"source": [
"display(Markdown('I am markdown from a `display(Markdown())` call wrapping my **content** which includes [a link in markdown](http://ibm.com)'))"
]
}
],
"metadata": {
Expand All @@ -106,13 +144,13 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.3"
"version": "3.5.1"
},
"urth": {
"dashboard": {
"layout": "grid",
"cellMargin": 10,
"defaultCellHeight": 20,
"layout": "grid",
"maxColumns": 12
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/integration/default/dashboard-widget-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var bundleBody;
var nightmare;

describe('dashboard with widgets', function() {
this.timeout(10000);
this.timeout(30000);
before(function(done) {
util.upload(uploadUrl, bundleFile, function(err, res) {
if (err) {
Expand Down

0 comments on commit 15cf5e5

Please sign in to comment.