commit 781eb5290ceed0a222624b3a781025b1bc1ccba0
parent 416aa5108962ea9691ba1564d97d2051bc88aadd
Author: Asher Morgan <59518073+ashermorgan@users.noreply.github.com>
Date: Tue, 26 Mar 2024 15:40:44 -0700
Improve pptx format and upate output type options
Diffstat:
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/songs2slides/core.py b/songs2slides/core.py
@@ -183,13 +183,17 @@ def create_pptx(slide_contents: list[str], filepath: str):
# Create presentation
prs = pptx.Presentation()
+ # Set slide aspect ratio to 16:9
+ prs.slide_width = Inches(11)
+ prs.slide_height = Inches(6.1875)
+
# Get blank slide template
blank_slide_layout = prs.slide_layouts[6]
# Get textbox size parameters
- margin = Inches(1)
- width = prs.slide_width - Inches(2)
- height = prs.slide_height - Inches(2)
+ margin = Inches(0.5)
+ width = prs.slide_width - 2 * margin
+ height = prs.slide_height - 2 * margin
for slide_content in slide_contents:
# Create and format slide
@@ -205,7 +209,7 @@ def create_pptx(slide_contents: list[str], filepath: str):
# Format paragraph
paragraph = textbox.text_frame.paragraphs[0]
paragraph.font.color.rgb = RGBColor.from_string('ffffff')
- paragraph.font.size = Pt(48)
+ paragraph.font.size = Pt(36)
paragraph.alignment = PP_ALIGN.CENTER
# Add slide content
diff --git a/songs2slides/templates/create.html b/songs2slides/templates/create.html
@@ -169,12 +169,12 @@
<fieldset>
<legend>Output type:</legend>
<label>
- <input type="radio" name="output-type" value="pptx" checked/>
- PowerPoint Download
+ <input type="radio" name="output-type" value="html" checked/>
+ Web View
</label>
<label>
- <input type="radio" name="output-type" value="html"/>
- Online View
+ <input type="radio" name="output-type" value="pptx"/>
+ PowerPoint download
</label>
</fieldset>
</div>
diff --git a/songs2slides/templates/slides.html b/songs2slides/templates/slides.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <title>Online View - SongsSlides</title>
+ <title>Web View - SongsSlides</title>
<link rel="stylesheet" href="https://unpkg.com/reveal.js@^4//dist/reveal.css">
<link rel="stylesheet" href="https://unpkg.com/reveal.js@^4//dist/theme/black.css">