##// END OF EJS Templates
Updates to the display system....
Updates to the display system. * New publish_* functions created in IPython.core.displaypub. * A raw=True argument has been added to the display_* functions in IPython.core.display. * Display object classes such as Html, Png, etc. have been added to IPython.core.display to make it easier to diplay raw data from the internet.

File last commit:

r4511:a85c3e74
r4526:b84d8954
Show More
nbexamples.py
83 lines | 1.5 KiB | text/x-python | PythonLexer
Brian E. Granger
Full versioning added to nbformat.
r4406 from ..nbbase import (
Brian E. Granger
Initial draft of more formal notebook format....
r4401 NotebookNode,
Brian E. Granger
Markdown cells are now saved and restored in notebooks.
r4511 new_code_cell, new_text_cell, new_worksheet, new_notebook, new_output
Brian E. Granger
Initial draft of more formal notebook format....
r4401 )
ws = new_worksheet(name='worksheet1')
Brian E. Granger
Markdown cells are now saved and restored in notebooks.
r4511 ws.cells.append(new_text_cell(
u'html',
source='Some NumPy Examples',
rendered='Some NumPy Examples'
Brian E. Granger
Initial draft of more formal notebook format....
r4401 ))
ws.cells.append(new_code_cell(
Brian E. Granger
Updates to basic notebook format....
r4402 input='import numpy',
prompt_number=1
Brian E. Granger
Initial draft of more formal notebook format....
r4401 ))
Brian E. Granger
Markdown cells are now saved and restored in notebooks.
r4511 ws.cells.append(new_text_cell(
u'markdown',
source='Some NumPy Examples',
rendered='Some NumPy Examples'
))
Brian E. Granger
Initial draft of more formal notebook format....
r4401 ws.cells.append(new_code_cell(
Brian E. Granger
Updates to basic notebook format....
r4402 input='a = numpy.random.rand(100)',
prompt_number=2
Brian E. Granger
Initial draft of more formal notebook format....
r4401 ))
ws.cells.append(new_code_cell(
input='print a',
Brian E. Granger
Updates to basic notebook format....
r4402 prompt_number=3,
outputs=[new_output(
output_type=u'pyout',
output_text=u'<array a>',
output_html=u'The HTML rep',
output_latex=u'$a$',
output_png=b'data',
output_svg=u'<svg>',
output_json=u'json data',
Brian E. Granger
Starting to rename text cell to html cell.
r4498 output_javascript=u'var i=0;',
prompt_number=3
Brian E. Granger
Updates to basic notebook format....
r4402 ),new_output(
output_type=u'display_data',
output_text=u'<array a>',
output_html=u'The HTML rep',
output_latex=u'$a$',
output_png=b'data',
output_svg=u'<svg>',
output_json=u'json data',
Brian E. Granger
Starting to rename text cell to html cell.
r4498 output_javascript=u'var i=0;',
prompt_number=4
Brian E. Granger
Updates to basic notebook format....
r4402 )]
Brian E. Granger
Initial draft of more formal notebook format....
r4401 ))
nb0 = new_notebook(
name='nb0',
worksheets=[ws, new_worksheet(name='worksheet2')]
)
Brian E. Granger
Full versioning added to nbformat.
r4406 nb0_py = """# <nbformat>2</nbformat>
# <codecell>
Brian E. Granger
Initial draft of more formal notebook format....
r4401
import numpy
Brian E. Granger
Full versioning added to nbformat.
r4406 # </codecell>
Brian E. Granger
Initial draft of more formal notebook format....
r4401 # <codecell>
a = numpy.random.rand(100)
Brian E. Granger
Full versioning added to nbformat.
r4406 # </codecell>
Brian E. Granger
Initial draft of more formal notebook format....
r4401 # <codecell>
print a
Brian E. Granger
Full versioning added to nbformat.
r4406
# </codecell>
Brian E. Granger
Initial draft of more formal notebook format....
r4401 """