Skip to content

Text2Slide is a Python (CLI or GUI) tool that converts a simple text file with slide titles and content into an animated video presentation using Manim.

Notifications You must be signed in to change notification settings

bosioF/text2slide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text2Slide - Animated Slideshow Generator with Manim

Text2Slide is a Python (CLI or GUI) tool that converts a simple text file with slide titles and content into an animated video presentation using Manim.
For now, the generated slides are basic, and there is no major customization other than text color, but it will come.


Features

  • Parses a plain text file structured with slide titles and content.
  • Automatically generates a Manim scene from the slides.
  • Supports rendering videos at multiple quality levels:
    • -ql: Low (480p, 15 FPS)
    • -qm: Medium (720p, 30 FPS)
    • -qh: High (1080p, 60 FPS)
    • -qp: 2K (1440p, 60 FPS)
    • -qk: 4K (2160p, 60 FPS)
  • Supports various text colors (see --help).
  • Optionally, add an MP3 audio track as background music.
  • Outputs the final video in a dedicated output/ folder.
  • Cleans up temporary files after rendering.

Usage

# For CLI:
python src/main.py input.txt <quality> <output_filename> [audio.mp3]
# or
python src/main.py --help
# For GUI:
python src/gui.py

Arguments

  • input.txt: Path to the input text file with slide data.
  • <quality>: Render quality flag. Choose one of -ql, -qm, -qh, -qp, or -qk.
  • <output_filename>: Desired name for the output video file (without extension).
  • [audio.mp3] (optional): Path to an MP3 file to use as background music.
  • --help: Show usage and supported options.

Examples

Without audio:

python src/main.py input.txt -qm my_presentation

With audio:

python src/main.py input.txt -qm my_presentation assets/music.mp3

Input File Format

Please see the provided input_example.txt file for a sample input and syntax details.

The input text file should follow this structure:

Slide 1: Title of Slide One
Content line 1
Content line 2

Slide 2: Title of Slide Two
More content here
  • Each slide starts with a line beginning with Slide X: (where X is any number).
  • Following lines until the next slide, header is treated as content.

Installation

  1. Clone the repository.

  2. Install dependencies:

pip install -r requirements.txt

Project Structure

manim_files/ (created after generating the first video)
output/ (created after generating the first video)
src/audio.py
src/backend.py
src/gui.py
src/help.py
src/main.py
.gitignore
input_example.txt
README.md
requirements.txt

Notes

  • Now supports a GUI
  • The script validates quality flags, file names, and color options.
  • The rendered video is saved as output/<output_filename>.mp4.
  • If an MP3 is provided, it is added as background audio using MoviePy.
  • Temporary files created during rendering are automatically cleaned up.
  • manim_files/ contains Manim's intermediate rendering files and is ignored in version control.

Feel free to open issues or contribute!

About

Text2Slide is a Python (CLI or GUI) tool that converts a simple text file with slide titles and content into an animated video presentation using Manim.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages