Project

rdeck

0.0
No release in over 3 years
A CLI tool that applies Markdown-written presentations to Google Slides, enabling continuous deck creation with content and design separation.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

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 install

Or install it yourself as:

$ gem install rdeck

Prerequisites

Google Cloud Setup

  1. Create a project in Google Cloud Console
  2. Enable the Google Slides API and Google Drive API
  3. Create OAuth2 credentials or a Service Account
  4. Download the credentials file

System Dependencies

  • Ruby 3.1.0 or higher
  • libvips (for image processing)

On macOS:

brew install vips

On Ubuntu/Debian:

sudo apt-get install libvips-dev

Usage

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 -w

Other 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 doctor

Markdown 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

![alt text](path/to/image.png)

---

# 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: section

Authentication

OAuth2 (Default)

  1. Download OAuth2 credentials from Google Cloud Console
  2. Save to ~/.local/share/rdeck/credentials.json
  3. Run any rdeck command - you'll be prompted to authorize

Service Account

export RDECK_SERVICE_ACCOUNT_KEY='{ "type": "service_account", ... }'
rdeck apply deck.md

Application Default Credentials

export RDECK_ENABLE_ADC=1
rdeck apply deck.md

Access Token

export RDECK_ACCESS_TOKEN="ya29...."
rdeck apply deck.md

Profiles

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.json

Development

After checking out the repo, run:

bundle install
bundle exec rake spec  # Run tests
bundle exec rdeck      # Run CLI

Contributing

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.