2
2
3
3
# 📰 Presenter 📰
4
4
5
- SeleniumBase Presenter allows you to create an HTML presentation with only a few lines of Python.
5
+ SeleniumBase Presenter allows you to create HTML presentations with Python.
6
6
The Reveal-JS library is used for running the presentations.
7
7
8
8
** Here's a sample presentation:**
9
9
10
- <img width =" 500 " src =" https://seleniumbase.io/other/presenter.gif " title =" Screenshot " ><br >
10
+ <a href = " https://seleniumbase.io/other/presenter.html " >< img width =" 500 " src =" https://seleniumbase.io/other/presenter.gif " title =" Screenshot " ></ a ><br >
11
11
12
12
Slides can include HTML, code, images, and iframes.
13
13
@@ -142,7 +142,7 @@ class MyPresenterClass(BaseCase):
142
142
' self.assert_text("free to copy and reuse")\n '
143
143
' self.go_back()\n '
144
144
' self.click_link_text("About")\n '
145
- ' self.assert_exact_text("xkcd.com", "h2")\n ' ))
145
+ ' self.assert_exact_text("xkcd.com", "h2")' ))
146
146
self .add_slide(
147
147
" <h3>Highlight <b>code</b> in slides:</h3>" ,
148
148
code = (
@@ -151,22 +151,51 @@ class MyPresenterClass(BaseCase):
151
151
' def test_basic(self):\n '
152
152
' self.open("https://store.xkcd.com/search")\n '
153
153
' self.type(\' input[name="q"]\' , "xkcd book\\ n")\n '
154
- ' self.assert_text("xkcd: volume 0", "h3")\n ' ))
154
+ ' self.assert_text("xkcd: volume 0", "h3")' ))
155
155
self .add_slide(
156
156
' <h3>Add <b>iFrames</b> to slides:</h3>' ,
157
157
iframe = " https://seleniumbase.io/demo_page" )
158
+ self .add_slide(
159
+ ' <h3>Getting started is <b>easy</b>:</h3>' ,
160
+ code = (
161
+ ' from seleniumbase import BaseCase\n\n '
162
+ ' class MyPresenterClass(BaseCase):\n\n '
163
+ ' def test_presenter(self):\n '
164
+ ' self.create_presentation()\n '
165
+ ' self.add_slide("Welcome to Presenter!")\n '
166
+ ' self.add_slide(\n '
167
+ ' "Add code to slides:",\n '
168
+ ' code=(\n '
169
+ ' "from seleniumbase import BaseCase\\ n\\ n"\n '
170
+ ' "class MyPresenterClass(BaseCase):\\ n\\ n"\n '
171
+ ' " def test_presenter(self):\\ n"\n '
172
+ ' " self.create_presentation()\\ n"))\n '
173
+ ' self.begin_presentation(filename="demo.html")' ))
158
174
self .add_slide(
159
175
' <h3>Include <b>notes</b> with slides:</h3><br />' ,
160
176
code = (' self.add_slide("[Your HTML goes here]",\n '
161
177
' code="[Your software code goes here]",\n '
162
178
' content2="[Additional HTML goes here]",\n '
163
- ' notes="[Attached speaker notes go here]")' ),
164
- content2 = ' <h4>(Example Presenter Usage)</h4>' ,
165
- notes = ' <h2><ul><li>Note A!<li>Note B!<li>Note C!<li>Note D!</h2>' )
179
+ ' notes="[Attached speaker notes go here]"\n '
180
+ ' "[Note A! -- Note B! -- Note C! ]")' ),
181
+ notes = ' <h2><ul><li>Note A!<li>Note B!<li>Note C!<li>Note D!</h2>' ,
182
+ content2 = " <h4>(Notes can include HTML tags)</h4>" )
183
+ self .add_slide(
184
+ ' <h3>Multiple <b>themes</b> available:</h3>' ,
185
+ code = (
186
+ ' self.create_presentation(theme="serif")\n\n '
187
+ ' self.create_presentation(theme="sky")\n\n '
188
+ ' self.create_presentation(theme="simple")\n\n '
189
+ ' self.create_presentation(theme="white")\n\n '
190
+ ' self.create_presentation(theme="moon")\n\n '
191
+ ' self.create_presentation(theme="black")\n\n '
192
+ ' self.create_presentation(theme="night")\n\n '
193
+ ' self.create_presentation(theme="beige")\n\n '
194
+ ' self.create_presentation(theme="league")' ))
166
195
self .add_slide(
167
196
' <h2><b>The End</b></h2>' ,
168
197
image = " https://seleniumbase.io/img/sb_logo_10.png" )
169
- self .begin_presentation(filename = " my_presentation .html" , interval = 0 )
198
+ self .begin_presentation(filename = " presenter .html" , interval = 0 )
170
199
```
171
200
172
201
#### This example is from [ my_presentation.py] ( https://github.com/seleniumbase/SeleniumBase/blob/master/examples/presenter/my_presentation.py ) , which you can run from the `` examples/presenter `` folder with the following command:
0 commit comments