Rdeck
Rdeck is a Ruby CLI tool that converts Markdown presentations to Google Slides, enabling continuous deck creation with content and design separation.
This is a Ruby implementation of the deck tool originally written in Go.
Features
- Convert Markdown files to Google Slides presentations
- Support for CommonMark and GitHub Flavored Markdown (GFM)
- Automatic slide layout detection
- Support for images, tables, and block quotes
- Code blocks with syntax highlighting (via external command)
- Incremental updates - only modify changed slides
- File watching mode for live updates
- Custom style support
- Multiple authentication methods (OAuth2, Service Account, ADC)
- Profile support for multiple Google accounts
Installation
Add this line to your application's Gemfile:
gem 'rdeck'And then execute:
$ bundle installOr install it yourself as:
$ gem install rdeckPrerequisites
Google Cloud Setup
- Create a project in Google Cloud Console
- Enable the Google Slides API and Google Drive API
- Create OAuth2 credentials or a Service Account
- Download the credentials file
System Dependencies
- Ruby 3.1.0 or higher
- libvips (for image processing)
On macOS:
brew install vipsOn Ubuntu/Debian:
sudo apt-get install libvips-devUsage
Create a New Presentation
# Create a blank presentation
$ rdeck new
# Create with a title and save ID to markdown file
$ rdeck new deck.md -t "My Presentation"
# Create from a base template
$ rdeck new deck.md -t "My Presentation" -b <base-presentation-id>Apply Markdown to Slides
# Apply markdown to presentation
$ rdeck apply deck.md
# Specify presentation ID via command line
$ rdeck apply deck.md -i <presentation-id>
# Apply specific pages
$ rdeck apply deck.md -p 1,3-5
# Watch mode - automatically apply on file changes
$ rdeck apply deck.md -wOther Commands
# List your presentations
$ rdeck ls
# List available layouts
$ rdeck ls-layouts deck.md
# Open presentation in browser
$ rdeck open deck.md
# Export to PDF
$ rdeck export deck.md -o presentation.pdf
# Check environment and configuration
$ rdeck doctorMarkdown Format
Basic Structure
---
presentationID: your-presentation-id
title: My Presentation
---
# First Slide Title
This is the content of the first slide.
---
## Second Slide
- Bullet point 1
- Bullet point 2
- Nested bullet
---
# Slide with Image

---
# Slide with Table
| Header 1 | Header 2 |
|----------|----------|
| Cell 1 | Cell 2 |
| Cell 3 | Cell 4 |Frontmatter Options
---
presentationID: your-presentation-id # Required for apply
title: My Presentation
breaks: true # Treat single line breaks as <br>
codeBlockToImageCommand: "command to convert code"
defaults:
- if: page == 1
layout: title
- if: titles.size() == 0
layout: blank
---Page Configuration
Use HTML comments with JSON to configure individual pages:
<!-- {"layout": "title-and-body"} -->
<!-- {"freeze": true} -->
<!-- {"skip": true} -->
# Slide Title
Content here
<!-- This is a speaker note -->Supported Markdown Features
- Headers (H1-H6): Mapped to title, subtitle, or body based on hierarchy
- Bold and italic text
- Links
Inline code- Bullet lists (ordered and unordered)
- Nested lists
-
Block quotes
- Tables
- Images
Strikethrough- Horizontal rules (for page breaks:
---)
Configuration
Configuration files are located at:
~/.config/rdeck/config.yml-
~/.config/rdeck/config-{profile}.yml(for profiles)
Example configuration:
# Base presentation to copy from
basePresentationID: "abc123..."
# Default folder for new presentations
folderID: "xyz789..."
# Default line break behavior
breaks: true
# Command to convert code blocks to images
codeBlockToImageCommand: "code2img"
# Default conditions for layout selection
defaults:
- if: page == 1
layout: title
- if: titles.size() == 1 && headings[2].size() == 1
layout: sectionAuthentication
OAuth2 (Default)
- Download OAuth2 credentials from Google Cloud Console
- Save to
~/.local/share/rdeck/credentials.json - Run any rdeck command - you'll be prompted to authorize
Service Account
export RDECK_SERVICE_ACCOUNT_KEY='{ "type": "service_account", ... }'
rdeck apply deck.mdApplication Default Credentials
export RDECK_ENABLE_ADC=1
rdeck apply deck.mdAccess Token
export RDECK_ACCESS_TOKEN="ya29...."
rdeck apply deck.mdProfiles
Use profiles to manage multiple Google accounts:
# Use a specific profile
rdeck apply deck.md --profile work
# Profile files
~/.config/rdeck/config-work.yml
~/.local/share/rdeck/credentials-work.json
~/.local/state/rdeck/token-work.jsonDevelopment
After checking out the repo, run:
bundle install
bundle exec rake spec # Run tests
bundle exec rdeck # Run CLIContributing
Bug reports and pull requests are welcome on GitHub at https://github.com/ydah/rdeck.
License
The gem is available as open source under the terms of the MIT License.
Acknowledgments
This project is a Ruby port of deck by k1LoW. The original Go implementation provided the specification and inspiration for this Ruby version.