diff --git a/IPython/core/display.py b/IPython/core/display.py index 2920b84..ff59576 100644 --- a/IPython/core/display.py +++ b/IPython/core/display.py @@ -567,7 +567,7 @@ class JSON(DisplayObject): Path to a local file to load the data from. expanded : boolean Metadata to control whether a JSON display component is expanded. - metadata: dict + metadata : dict Specify extra metadata to attach to the json display object. root : str The name of the root element of the JSON tree @@ -651,12 +651,11 @@ class GeoJSON(JSON): A URL to download the data from. filename : unicode Path to a local file to load the data from. - metadata: dict + metadata : dict Specify extra metadata to attach to the json display object. Examples -------- - The following will display an interactive map of Mars with a point of interest on frontend that do support GeoJSON display. @@ -723,7 +722,7 @@ class Javascript(TextDisplayObject): running the source code. The full URLs of the libraries should be given. A single Javascript library URL can also be given as a string. - css: : list or str + css : list or str A sequence of css files to load before running the source code. The full URLs of the css files should be given. A single css URL can also be given as a string. @@ -844,25 +843,33 @@ class Image(DisplayObject): from image data. For non-embedded images, you can just set the desired display width and height directly. - unconfined: bool + unconfined : bool Set unconfined=True to disable max-width confinement of the image. - metadata: dict + metadata : dict Specify extra metadata to attach to the image. Examples -------- - # embedded image data, works in qtconsole and notebook - # when passed positionally, the first arg can be any of raw image data, - # a URL, or a filename from which to load image data. - # The result is always embedding image data for inline images. - Image('http://www.google.fr/images/srpr/logo3w.png') - Image('/path/to/image.jpg') - Image(b'RAW_PNG_DATA...') - - # Specifying Image(url=...) does not embed the image data, - # it only generates `` tag with a link to the source. - # This will not work in the qtconsole or offline. - Image(url='http://www.google.fr/images/srpr/logo3w.png') + embedded image data, works in qtconsole and notebook + when passed positionally, the first arg can be any of raw image data, + a URL, or a filename from which to load image data. + The result is always embedding image data for inline images. + + >>> Image('http://www.google.fr/images/srpr/logo3w.png') + + + >>> Image('/path/to/image.jpg') + + + >>> Image(b'RAW_PNG_DATA...') + + + Specifying Image(url=...) does not embed the image data, + it only generates ```` tag with a link to the source. + This will not work in the qtconsole or offline. + + >>> Image(url='http://www.google.fr/images/srpr/logo3w.png') + """ if isinstance(data, (Path, PurePath)): @@ -1053,8 +1060,7 @@ class Video(DisplayObject): Local files can be displayed with URLs without embedding the content, via:: Video('./video.mp4') - - mimetype: unicode + mimetype : unicode Specify the mimetype for embedded videos. Default will be guessed from file extension, if available. width : int @@ -1071,7 +1077,6 @@ class Video(DisplayObject): Examples -------- - :: Video('https://archive.org/download/Sita_Sings_the_Blues/Sita_Sings_the_Blues_small.mp4') @@ -1165,7 +1170,7 @@ def set_matplotlib_formats(*formats, **kwargs): ---------- *formats : strs One or more figure formats to enable: 'png', 'retina', 'jpeg', 'svg', 'pdf'. - **kwargs : + **kwargs Keyword args will be relayed to ``figure.canvas.print_figure``. """ from IPython.core.interactiveshell import InteractiveShell diff --git a/IPython/lib/display.py b/IPython/lib/display.py index 09268ad..e8b8a44 100644 --- a/IPython/lib/display.py +++ b/IPython/lib/display.py @@ -70,13 +70,13 @@ class Audio(DisplayObject): ... framerate = 44100 ... t = np.linspace(0,5,framerate*5) ... data = np.sin(2*np.pi*220*t) + np.sin(2*np.pi*224*t) - ... Audio(data,rate=framerate) + ... Audio(data, rate=framerate) Can also do stereo or more channels >>> dataleft = np.sin(2*np.pi*220*t) ... dataright = np.sin(2*np.pi*224*t) - ... Audio([dataleft, dataright],rate=framerate) + ... Audio([dataleft, dataright], rate=framerate) From URL: