##// END OF EJS Templates
IFrame + ScribdDocument
Eugene Van den Bulke -
Show More
@@ -6,9 +6,9 b' from os.path import exists, isfile, splitext, abspath, join, isdir'
6 from os import walk, sep
6 from os import walk, sep
7
7
8
8
9 class VideoIFrame(object):
9 class IFrame(object):
10 """
10 """
11 Generic class to embed videos in a iframe
11 Generic class to embed an iframe in an IPython notebook
12 """
12 """
13
13
14 def __init__(self, id, width=400, height=300, **kwargs):
14 def __init__(self, id, width=400, height=300, **kwargs):
@@ -29,7 +29,7 b' class VideoIFrame(object):'
29 id=self.id,
29 id=self.id,
30 params=params)
30 params=params)
31
31
32 class YouTubeVideo(VideoIFrame):
32 class YouTubeVideo(IFrame):
33 """Class for embedding a YouTube Video in an IPython session, based on its video id.
33 """Class for embedding a YouTube Video in an IPython session, based on its video id.
34
34
35 e.g. to embed the video on this page:
35 e.g. to embed the video on this page:
@@ -80,6 +80,28 b' class VimeoVideo(VideoIFrame):'
80 ></iframe>
80 ></iframe>
81 """
81 """
82
82
83 class ScribdDocument(IFrame):
84 """
85 Class for embedding a Scribd document in an IPython session
86
87 Use the start_page params to specify a starting point in the document
88 Use the view_mode params to specify display type one off scroll | slideshow | book
89
90 e.g to Display Wes' foundational paper about PANDAS in book mode from page 3
91
92 ScribdDocument(71048089, width=800, height=400, start_page=3, view_mode="book")
93 """
94
95 iframe = """
96 <iframe
97 width = "{width}"
98 height = "{height}"
99 src="http://www.scribd.com/embeds/{id}/content{params}"
100 data-auto-height="false"
101 scrolling="no"
102 frameborder="0">
103 </iframe>
104 """
83
105
84 class FileLink(object):
106 class FileLink(object):
85 """Class for embedding a local file link in an IPython session, based on path
107 """Class for embedding a local file link in an IPython session, based on path
General Comments 0
You need to be logged in to leave comments. Login now