Skip to content

Commit a9a1fc3

Browse files
committed
Fix Presenter "show_notes" and move arg to different area
1 parent d2d7875 commit a9a1fc3

File tree

3 files changed

+30
-22
lines changed

3 files changed

+30
-22
lines changed

examples/presenter/ReadMe.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ self.create_presentation(name=None, theme="serif", show_notes=True)
3030
Valid themes: "serif" (default), "sky", "white", "black",
3131
"simple", "league", "moon", "night",
3232
"beige", "blood", and "solarized".
33-
show_notes - When set to True, the Notes feature becomes enabled,
34-
which allows presenters to see notes next to slides.
3533
"""
3634
```
3735

@@ -47,16 +45,14 @@ self.add_slide(content=None, image=None, code=None, iframe=None,
4745
content2=None, notes=None, name=None)
4846
""" Allows the user to add slides to a presentation.
4947
@Params
50-
content - The HTML content to display on the presentation slide.
51-
image - Attach an image (from a URL link) to the slide.
52-
code - Attach code of any programming language to the slide.
53-
Language-detection will be used to add syntax formatting.
54-
iframe - Attach an iFrame (from a URL link) to the slide.
55-
content2 - HTML content to display after adding an image or code.
56-
notes - Additional notes to include with the slide.
57-
ONLY SEEN if show_notes is set for the presentation.
5848
name - If creating multiple presentations at the same time,
59-
use this to select the presentation to add slides to.
49+
use this to select the one you wish to add slides to.
50+
filename - The name of the HTML file that you wish to
51+
save the presentation to. (filename must end in ".html")
52+
show_notes - When set to True, the Notes feature becomes enabled,
53+
which allows presenters to see notes next to slides.
54+
interval - The delay time between autoplaying slides. (in seconds)
55+
If set to 0 (default), autoplay is disabled.
6056
"""
6157
```
6258

@@ -71,6 +67,8 @@ self.begin_presentation(filename="my_presentation.html", interval=0)
7167
use this to select the one you wish to add slides to.
7268
filename - The name of the HTML file that you wish to
7369
save the presentation to. (filename must end in ".html")
70+
show_notes - When set to True, the Notes feature becomes enabled,
71+
which allows presenters to see notes next to slides.
7472
interval - The delay time between autoplaying slides. (in seconds)
7573
If set to 0 (default), autoplay is disabled.
7674
"""

help_docs/method_summary.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,14 @@ self.add_meta_tag(http_equiv=None, content=None)
356356

357357
############
358358

359-
self.create_presentation(name=None, theme="default", show_notes=True)
359+
self.create_presentation(name=None, theme="default")
360360

361361
self.add_slide(content=None, image=None, code=None, iframe=None,
362362
content2=None, notes=None, name=None)
363363

364-
self.save_presentation(name=None, filename=None, interval=0)
364+
self.save_presentation(name=None, filename=None, show_notes=True, interval=0)
365365

366-
self.begin_presentation(name=None, filename=None, interval=0)
366+
self.begin_presentation(name=None, filename=None, show_notes=True, interval=0)
367367

368368
############
369369

seleniumbase/fixtures/base_case.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3151,7 +3151,7 @@ def add_meta_tag(self, http_equiv=None, content=None):
31513151

31523152
############
31533153

3154-
def create_presentation(self, name=None, theme="default", show_notes=True):
3154+
def create_presentation(self, name=None, theme="default"):
31553155
""" Creates a Reveal-JS presentation that you can add slides to.
31563156
@Params
31573157
name - If creating multiple presentations at the same time,
@@ -3160,8 +3160,6 @@ def create_presentation(self, name=None, theme="default", show_notes=True):
31603160
Valid themes: "serif" (default), "sky", "white", "black",
31613161
"simple", "league", "moon", "night",
31623162
"beige", "blood", and "solarized".
3163-
show_notes - When set to True, the Notes feature becomes enabled,
3164-
which allows presenters to see notes next to slides.
31653163
"""
31663164
if not name:
31673165
name = "default"
@@ -3242,7 +3240,7 @@ def add_slide(self, content=None, image=None, code=None, iframe=None,
32423240
name = "default"
32433241
if name not in self._presentation_slides:
32443242
# Create a presentation if it doesn't already exist
3245-
self.create_presentation(name=name, show_notes=True)
3243+
self.create_presentation(name=name)
32463244
if not content:
32473245
content = ""
32483246
if not content2:
@@ -3273,13 +3271,16 @@ def add_slide(self, content=None, image=None, code=None, iframe=None,
32733271

32743272
self._presentation_slides[name].append(html)
32753273

3276-
def save_presentation(self, name=None, filename=None, interval=0):
3274+
def save_presentation(
3275+
self, name=None, filename=None, show_notes=True, interval=0):
32773276
""" Saves a Reveal-JS Presentation to a file for later use.
32783277
@Params
32793278
name - If creating multiple presentations at the same time,
32803279
use this to select the one you wish to add slides to.
32813280
filename - The name of the HTML file that you wish to
32823281
save the presentation to. (filename must end in ".html")
3282+
show_notes - When set to True, the Notes feature becomes enabled,
3283+
which allows presenters to see notes next to slides.
32833284
interval - The delay time between autoplaying slides. (in seconds)
32843285
If set to 0 (default), autoplay is disabled.
32853286
"""
@@ -3300,6 +3301,10 @@ def save_presentation(self, name=None, filename=None, interval=0):
33003301
raise Exception('The "interval" cannot be a negative number!')
33013302
interval_ms = float(interval) * 1000.0
33023303

3304+
show_notes_str = "false"
3305+
if show_notes:
3306+
show_notes_str = "true"
3307+
33033308
the_html = ""
33043309
for slide in self._presentation_slides[name]:
33053310
the_html += slide
@@ -3310,13 +3315,14 @@ def save_presentation(self, name=None, filename=None, interval=0):
33103315
'<script src="%s"></script>\n'
33113316
'<script src="%s"></script>\n'
33123317
'<script>Reveal.initialize('
3313-
'{showNotes: true, slideNumber: true, '
3318+
'{showNotes: %s, slideNumber: true, '
33143319
'autoSlide: %s,});'
33153320
'</script>\n'
33163321
'</body>\n'
33173322
'</html>\n'
33183323
'' % (constants.Reveal.MIN_JS,
33193324
constants.PrettifyJS.RUN_PRETTIFY_JS,
3325+
show_notes_str,
33203326
interval_ms))
33213327

33223328
saved_presentations_folder = constants.Presentations.SAVED_FOLDER
@@ -3334,13 +3340,16 @@ def save_presentation(self, name=None, filename=None, interval=0):
33343340
print('\n>>> [%s] was saved!\n' % file_path)
33353341
return file_path
33363342

3337-
def begin_presentation(self, name=None, filename=None, interval=0):
3343+
def begin_presentation(
3344+
self, name=None, filename=None, show_notes=True, interval=0):
33383345
""" Begin a Reveal-JS Presentation in the web browser.
33393346
@Params
33403347
name - If creating multiple presentations at the same time,
33413348
use this to select the one you wish to add slides to.
33423349
filename - The name of the HTML file that you wish to
33433350
save the presentation to. (filename must end in ".html")
3351+
show_notes - When set to True, the Notes feature becomes enabled,
3352+
which allows presenters to see notes next to slides.
33443353
interval - The delay time between autoplaying slides. (in seconds)
33453354
If set to 0 (default), autoplay is disabled.
33463355
"""
@@ -3366,7 +3375,8 @@ def begin_presentation(self, name=None, filename=None, interval=0):
33663375
'<p class="End_Presentation_Now"> </p>\n</section>\n')
33673376
self._presentation_slides[name].append(end_slide)
33683377
file_path = self.save_presentation(
3369-
name=name, filename=filename, interval=interval)
3378+
name=name, filename=filename,
3379+
show_notes=show_notes, interval=interval)
33703380
self._presentation_slides[name].pop()
33713381

33723382
self.open_html_file(file_path)

0 commit comments

Comments
 (0)