Last active
December 19, 2015 08:29
-
-
Save pfctdayelise/5926494 to your computer and use it in GitHub Desktop.
Iframes appear to break the nbviewer, although they work fine in the ipython notebook itself.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "testing iframes" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "a = \"\"\"<html>\n<body>\n<div style='border:1px solid blue'>Hello!</div>\n</body>\n</html>\"\"\"\ne = \"<b>Ohayo!</b>\"\n\nfrom IPython.display import HTML\niframeSelfClosing = '<iframe src=\"data:text/html;base64,{}\" />'\niframeSeparateClosing = '<iframe src=\"data:text/html;base64,{}\"></iframe>'", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 11 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "HTML(e)", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"html": "<b>Ohayo!</b>", | |
"output_type": "pyout", | |
"prompt_number": 12, | |
"text": "<IPython.core.display.HTML at 0xa81a54c>" | |
} | |
], | |
"prompt_number": 12 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "HTML(a)", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"html": "<html>\n<body>\n<div style='border:1px solid blue'>Hello!</div>\n</body>\n</html>", | |
"output_type": "pyout", | |
"prompt_number": 13, | |
"text": "<IPython.core.display.HTML at 0xa81a68c>" | |
} | |
], | |
"prompt_number": 13 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "HTML(iframeSeparateClosing.format(e.encode('base64')))", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"html": "<iframe src=\"data:text/html;base64,PGI+T2hheW8hPC9iPg==\n\"></iframe>", | |
"output_type": "pyout", | |
"prompt_number": 14, | |
"text": "<IPython.core.display.HTML at 0xa81a72c>" | |
} | |
], | |
"prompt_number": 14 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "HTML(iframeSeparateClosing.format(a.encode('base64')))", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"html": "<iframe src=\"data:text/html;base64,PGh0bWw+Cjxib2R5Pgo8ZGl2IHN0eWxlPSdib3JkZXI6MXB4IHNvbGlkIGJsdWUnPkhlbGxvITwv\nZGl2Pgo8L2JvZHk+CjwvaHRtbD4=\n\"></iframe>", | |
"output_type": "pyout", | |
"prompt_number": 15, | |
"text": "<IPython.core.display.HTML at 0xa81a76c>" | |
} | |
], | |
"prompt_number": 15 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "HTML(iframeSelfClosing.format(e.encode('base64')))", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"html": "<iframe src=\"data:text/html;base64,PGI+T2hheW8hPC9iPg==\n\" />", | |
"output_type": "pyout", | |
"prompt_number": 16, | |
"text": "<IPython.core.display.HTML at 0xa81a7cc>" | |
} | |
], | |
"prompt_number": 16 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "HTML(iframeSelfClosing.format(a.encode('base64')))", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"html": "<iframe src=\"data:text/html;base64,PGh0bWw+Cjxib2R5Pgo8ZGl2IHN0eWxlPSdib3JkZXI6MXB4IHNvbGlkIGJsdWUnPkhlbGxvITwv\nZGl2Pgo8L2JvZHk+CjwvaHRtbD4=\n\" />", | |
"output_type": "pyout", | |
"prompt_number": 17, | |
"text": "<IPython.core.display.HTML at 0xa81a82c>" | |
} | |
], | |
"prompt_number": 17 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 17 | |
} | |
], | |
"metadata": {} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment