##// END OF EJS Templates
Merge pull request #3751 from wolever/link-if-possible...
Merge pull request #3751 from wolever/link-if-possible Use link(2) when possible in nbconvert

File last commit:

r9190:20a102a5
r11727:07bbd498 merge
Show More
display.py
27 lines | 668 B | text/x-python | PythonLexer
Brian Granger
Renaming the special methods of the formatters....
r3878 """Code that shows off the IPython display logic.
"""
Brian Granger
Misc updates the display system....
r3880 from IPython.lib.latextools import latex_to_png
Brian Granger
Renaming the special methods of the formatters....
r3878 from IPython.core.display import (
display, display_pretty, display_html,
Brian Granger
Misc updates the display system....
r3880 display_svg, display_json, display_png
Brian Granger
Renaming the special methods of the formatters....
r3878 )
class Circle(object):
def __init__(self, radius):
self.radius = radius
def _repr_pretty_(self, p, cycle):
p.text(u"\u25CB")
def _repr_html_(self):
return "<h1>Cirle: radius=%s</h1>" % self.radius
def _repr_svg_(self):
return """<svg>
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red"/>
</svg>"""
Brian Granger
Misc updates the display system....
r3880 def _repr_png_(self):
return latex_to_png('$\circle$')