A terminal-based presentation tool that turns Markdown files into beautiful interactive slides with code execution capabilities.
- ✨ Beautiful terminal-based presentation slides
- 🖼️ Renders Markdown with rich formatting
- ⌨️ Simple keyboard navigation (arrow keys or keyboard shortcuts)
- 🔄 Automatic slide detection using "---" separator
- 💻 Execute Python and Bash code blocks directly within the presentation
- 📋 Copy code blocks to clipboard with a single command
- 🌐 Open URLs directly from the presentation
- 🎨 Elegant color scheme and formatting
pip install slidslid your_presentation.mdslid your_presentation.md --author "Your Name"- → or n: Next slide
- ← or p: Previous slide
- ↑/↓: Also navigate slides
- Number keys: Jump to specific slide
- r: Run code block (followed by block number) or open URL (followed by "url")
- c: Copy code to clipboard (followed by block number)
- q: Quit presentation
Code blocks are automatically detected and numbered for each slide. When on a slide with code:
- Python and Bash/Shell code blocks are automatically detected
- Press r followed by the block number to execute (e.g., r 1)
- Output is displayed in real-time
- Press any key to return to the presentation
You can open URLs directly from the presentation:
- Press r followed by "url" (e.g., r url)
- The default web browser will open with the URL from the slide
- The presentation continues to display while the browser opens
To copy code to your clipboard:
- Press c followed by the block number (e.g., c 1)
- A confirmation will display that the code was copied
- Press any key to return to the presentation
Apache License 2.0
Contributions are welcome! Feel free to open issues or submit pull requests.
Hi Assistant follow the next instructions to create the python script. Only output a stand alone python file, as a Markdown block.
Prompt for Creating Terminal Markdown Slide Viewer with Rich
## Project Description
Create a Python tool called slid.py that displays markdown presentations in the terminal. The tool should take a markdown file as input, split it into slides at "---" delimiters, and render each slide with beautiful formatting using the Rich library.
## Core Features
1. Parse markdown files and split at proper "---" slide separators (ignoring those in code blocks)
2. Display slides with beautiful formatting using the Rich library
3. Show the presentation name in the header
4. Display author name (with 🙂 icon) and slide counter (with 📄 icon) in the footer
5. Support keyboard navigation (arrow keys, number keys, etc.)
6. Detect and execute code blocks (Python and Bash) using the "r" command
7. Detect URLs and open them in the browser using the "r" command
8. Copy code blocks or URLs to clipboard using the "c" command
9. All commands should be slide-specific (e.g., "r 1" runs the first code block on the current slide)
## Technical Requirements
* Use Rich library for terminal formatting and rendering
* Use readchar for keyboard input handling
* Use pyperclip for clipboard functionality
* Handle code block execution with proper error handling
* Provide subtle notifications for clipboard operations
## Navigation Commands
* Arrow keys (←, →, ↑, ↓) for navigating between slides
* Enter/Space/n for next slide
* p for previous slide
* Number keys to jump to specific slides
* q to quit the presentation
* r + number to run a code block or open a URL
* c + number to copy a code block or URL to clipboard
## Code Block Execution
* Automatically detect and number Python and Bash code blocks in each slide
* Allow execution with "r + number" (e.g., "r 1")
* Stream the execution output in real-time
* Return to the presentation with any key press
## URL Handling
* Detect URLs in slides with regex
* Number URLs for each slide
* Allow opening with "r + number" (e.g., "r 1")
* Allow copying with "c + number" (e.g., "c 1")
* Show brief success notifications that automatically disappear
## Visual Elements
* Show presentation name in header
* Show author (🙂 icon) and slide count (📄 icon) in footer
* Use appropriate colors and formatting for different elements
* Highlight code blocks and URLs with proper syntax coloring
* be sure that all the slides appear in full screen
* be sure that you tried to get the user name from the bash command
Please implement this tool using Python with the Rich, readchar, and pyperclip libraries. The final result should be a single Python file that can be run from the command line. The command need to work as "python slid.py README.md".
