Add the sbase mkpres FILE.py
console script for making HTML presentations.
mkpres
-
Usage:
sbase mkpres [FILE.py] [LANGUAGE OPTIONS]
-
Example:
sbase mkpres new_presentation.py
-
Language Options:
--en
/--English
|--zh
/--Chinese
--nl
/--Dutch
|--fr
/--French
--it
/--Italian
|--ja
/--Japanese
--ko
/--Korean
|--pt
/--Portuguese
--ru
/--Russian
|--es
/--Spanish
-
Output:
Creates a new presentation with 3 example slides.
If the file already exists, an error is raised.
By default, the slides are written in English.
Slides use "serif" theme & "fade" transition.
This code can be used as a base boilerplate.
💠 Here's an example of a presentation that was created by that:
from seleniumbase import BaseCase
class MyTestClass(BaseCase):
def test_presentation(self):
self.create_presentation(theme="serif", transition="fade")
self.add_slide(
'<h1>Hello</h1><br />'
'<img src="https://seleniumbase.io/cdn/img/sb6.png">')
self.add_slide("<h2><b>*</b> Update Text <b>*</b></h2>")
self.add_slide("<h2>Goodbye</h2><p>Use SeleniumBase!</p>")
self.begin_presentation(filename="my_presentation_1.html")
💠 When run with pytest
, the above Python code translates to the following HTML:
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html, charset=utf-8;">
<meta name="viewport" content="shrink-to-fit=no">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.8.0/css/reveal.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.8.0/css/theme/serif.min.css">
<style>
pre{background-color:#fbe8d4;border-radius:8px;}
div[flex_div]{height:68vh;margin:0;align-items:center;justify-content:center;}
img[rounded]{border-radius:16px;max-width:64%;}
</style>
</head>
<body>
<!-- Generated by SeleniumBase - https://seleniumbase.io -->
<div class="reveal">
<div class="slides">
<section data-transition="fade">
<h1>Hello</h1><br /><img src="https://seleniumbase.io/cdn/img/sb6.png">
<aside class="notes"></aside>
</section>
<section data-transition="fade">
<h2><b>*</b> Update Text <b>*</b></h2>
<aside class="notes"></aside>
</section>
<section data-transition="fade">
<h2>Goodbye</h2><p>Use SeleniumBase!</p>
<aside class="notes"></aside>
</section>
<section data-transition="none">
<p class="End_Presentation_Now"> </p>
</section>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.8.0/js/reveal.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
<script>Reveal.initialize({showNotes: false, slideNumber: true, hash: false, autoSlide: 0.0,});</script>
</body>
</html>
- Also refresh Python dependencies:
--rich==9.10.0;python_version>="3.6"