Allows the user to add slides to a presentation. @Params content - The HTML content to display on the presentation slide. image - Attach an image (from a URL link) to the slide. code - Attach code of any programming language to the slide. Language-detec
(
self,
content=None,
image=None,
code=None,
iframe=None,
content2=None,
notes=None,
transition=None,
name=None,
)
| 12414 | self._presentation_transition[name] = transition |
| 12415 | |
| 12416 | def add_slide( |
| 12417 | self, |
| 12418 | content=None, |
| 12419 | image=None, |
| 12420 | code=None, |
| 12421 | iframe=None, |
| 12422 | content2=None, |
| 12423 | notes=None, |
| 12424 | transition=None, |
| 12425 | name=None, |
| 12426 | ): |
| 12427 | """Allows the user to add slides to a presentation. |
| 12428 | @Params |
| 12429 | content - The HTML content to display on the presentation slide. |
| 12430 | image - Attach an image (from a URL link) to the slide. |
| 12431 | code - Attach code of any programming language to the slide. |
| 12432 | Language-detection will be used to add syntax formatting. |
| 12433 | iframe - Attach an iframe (from a URL link) to the slide. |
| 12434 | content2 - HTML content to display after adding an image or code. |
| 12435 | notes - Additional notes to include with the slide. |
| 12436 | ONLY SEEN if show_notes is set for the presentation. |
| 12437 | transition - Set a transition between slides. (overrides previous) |
| 12438 | Valid transitions: "none" (default), "slide", "fade", |
| 12439 | "zoom", "convex", and "concave". |
| 12440 | name - If creating multiple presentations at the same time, |
| 12441 | use this to select the presentation to add slides to.""" |
| 12442 | if not name: |
| 12443 | name = "default" |
| 12444 | if name not in self._presentation_slides: |
| 12445 | # Create a presentation if it doesn't already exist |
| 12446 | self.create_presentation(name=name) |
| 12447 | if not content: |
| 12448 | content = "" |
| 12449 | if not content2: |
| 12450 | content2 = "" |
| 12451 | if not notes: |
| 12452 | notes = "" |
| 12453 | if not transition: |
| 12454 | transition = self._presentation_transition[name] |
| 12455 | elif transition == "default": |
| 12456 | transition = "none" |
| 12457 | valid_transitions = [ |
| 12458 | "none", |
| 12459 | "slide", |
| 12460 | "fade", |
| 12461 | "zoom", |
| 12462 | "convex", |
| 12463 | "concave", |
| 12464 | ] |
| 12465 | transition = transition.lower() |
| 12466 | if transition not in valid_transitions: |
| 12467 | raise Exception( |
| 12468 | "Transition {%s} not found! Valid transitions: %s" |
| 12469 | "" % (transition, valid_transitions) |
| 12470 | ) |
| 12471 | add_line = "" |
| 12472 | if content.startswith("<"): |
| 12473 | add_line = "\n" |