Atx-style headers
Setext-style headers
Bold, italic, or *both* using asterisks
Bold, italic, or ___both___ using underscores
Strikethrough text
Pipe tables
Right | Left | Default | Center |
---|---|---|---|
12 | 12 | 12 | 12 |
123 | 123 | 123 | 123 |
1 | 1 | 1 | 1 |
List using asterisks
List using dashes
Ordered list
Mixed list
Automatic hyperlink http://google.com/
Explicit hyperlink Google
Inline verbatim
Verbatim block
This is verbatim
GFM code block
Python
print('hello world')
Javascript
console.log('hello world');
Carroted quote
I heard Bob say
Hello world!
Local images
Web images (not supported for non-html templates)
Embeded, scrubbed HMTL (not supported for non-html templates)
Inline latex math $m = \frac{F}{a}$
Latex math block $$m = \frac{F}{a}$$
Stdout
# Python code block
import sys
sys.stdout.write('Stdout')
sys.stdout.flush()
Stdout
Exception
raise Exception('Error')
--------------------------------------------------------------------------- Exception Traceback (most recent call last) <ipython-input-2-24314b2fb2fb> in <module>() ----> 1 raise Exception('Error') Exception: Error
Stderr
sys.stderr.write('Stderr')
sys.stderr.flush()
Stderr
Python repr
a = "Repr"
a
'Repr'
Language magic
%%javascript
console.log('Hello JS console.');
Rich output
from IPython.display import display, HTML, Image, Latex, SVG
display(HTML('<div style="background: blue; color: white; padding: 1em;">This should be blue.</div>'))
Embeded images
Remote
display(Image(data='http://ipython.org/_static/IPy_header.png'))
Local
display(Image(data='./images/IPython_logo.png'))
Referenced images
Remote (not supported for non-html templates)
display(Image(url='http://ipython.org/_static/IPy_header.png'))
Local
display(Image(url='./images/IPython_logo.png'))
display(Latex(data='Latex math: $m=\\frac{F}{a}$'))
SVG images
display(SVG(data='./images/python_logo.svg'))
Multiple repr support
class ManyRepr(object):
def _repr_latex_(self):
return "$L*\\frac{at}{ex}=Math$"
def _repr_html_(self):
return "<div style='background: blue; color: white;'>This is blue. HTML</div>"
def _repr_svg_(self):
return SVG(data='./images/python_logo.svg').data
def _repr_png_(self):
return Image(data='./images/IPython_logo.png').data
def __repr__(self):
return 'Text'
ManyRepr()
Link to another notebook here.
Link to an image here.