@@ -3151,7 +3151,7 @@ def add_meta_tag(self, http_equiv=None, content=None):
3151
3151
3152
3152
############
3153
3153
3154
- def create_presentation (self , name = None , theme = "default" , show_notes = True ):
3154
+ def create_presentation (self , name = None , theme = "default" ):
3155
3155
""" Creates a Reveal-JS presentation that you can add slides to.
3156
3156
@Params
3157
3157
name - If creating multiple presentations at the same time,
@@ -3160,8 +3160,6 @@ def create_presentation(self, name=None, theme="default", show_notes=True):
3160
3160
Valid themes: "serif" (default), "sky", "white", "black",
3161
3161
"simple", "league", "moon", "night",
3162
3162
"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.
3165
3163
"""
3166
3164
if not name :
3167
3165
name = "default"
@@ -3242,7 +3240,7 @@ def add_slide(self, content=None, image=None, code=None, iframe=None,
3242
3240
name = "default"
3243
3241
if name not in self ._presentation_slides :
3244
3242
# Create a presentation if it doesn't already exist
3245
- self .create_presentation (name = name , show_notes = True )
3243
+ self .create_presentation (name = name )
3246
3244
if not content :
3247
3245
content = ""
3248
3246
if not content2 :
@@ -3273,13 +3271,16 @@ def add_slide(self, content=None, image=None, code=None, iframe=None,
3273
3271
3274
3272
self ._presentation_slides [name ].append (html )
3275
3273
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 ):
3277
3276
""" Saves a Reveal-JS Presentation to a file for later use.
3278
3277
@Params
3279
3278
name - If creating multiple presentations at the same time,
3280
3279
use this to select the one you wish to add slides to.
3281
3280
filename - The name of the HTML file that you wish to
3282
3281
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.
3283
3284
interval - The delay time between autoplaying slides. (in seconds)
3284
3285
If set to 0 (default), autoplay is disabled.
3285
3286
"""
@@ -3300,6 +3301,10 @@ def save_presentation(self, name=None, filename=None, interval=0):
3300
3301
raise Exception ('The "interval" cannot be a negative number!' )
3301
3302
interval_ms = float (interval ) * 1000.0
3302
3303
3304
+ show_notes_str = "false"
3305
+ if show_notes :
3306
+ show_notes_str = "true"
3307
+
3303
3308
the_html = ""
3304
3309
for slide in self ._presentation_slides [name ]:
3305
3310
the_html += slide
@@ -3310,13 +3315,14 @@ def save_presentation(self, name=None, filename=None, interval=0):
3310
3315
'<script src="%s"></script>\n '
3311
3316
'<script src="%s"></script>\n '
3312
3317
'<script>Reveal.initialize('
3313
- '{showNotes: true , slideNumber: true, '
3318
+ '{showNotes: %s , slideNumber: true, '
3314
3319
'autoSlide: %s,});'
3315
3320
'</script>\n '
3316
3321
'</body>\n '
3317
3322
'</html>\n '
3318
3323
'' % (constants .Reveal .MIN_JS ,
3319
3324
constants .PrettifyJS .RUN_PRETTIFY_JS ,
3325
+ show_notes_str ,
3320
3326
interval_ms ))
3321
3327
3322
3328
saved_presentations_folder = constants .Presentations .SAVED_FOLDER
@@ -3334,13 +3340,16 @@ def save_presentation(self, name=None, filename=None, interval=0):
3334
3340
print ('\n >>> [%s] was saved!\n ' % file_path )
3335
3341
return file_path
3336
3342
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 ):
3338
3345
""" Begin a Reveal-JS Presentation in the web browser.
3339
3346
@Params
3340
3347
name - If creating multiple presentations at the same time,
3341
3348
use this to select the one you wish to add slides to.
3342
3349
filename - The name of the HTML file that you wish to
3343
3350
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.
3344
3353
interval - The delay time between autoplaying slides. (in seconds)
3345
3354
If set to 0 (default), autoplay is disabled.
3346
3355
"""
@@ -3366,7 +3375,8 @@ def begin_presentation(self, name=None, filename=None, interval=0):
3366
3375
'<p class="End_Presentation_Now"> </p>\n </section>\n ' )
3367
3376
self ._presentation_slides [name ].append (end_slide )
3368
3377
file_path = self .save_presentation (
3369
- name = name , filename = filename , interval = interval )
3378
+ name = name , filename = filename ,
3379
+ show_notes = show_notes , interval = interval )
3370
3380
self ._presentation_slides [name ].pop ()
3371
3381
3372
3382
self .open_html_file (file_path )
0 commit comments