https://github.com/holman/rapinoe
Parse Keynote files in Ruby.
https://github.com/holman/rapinoe
Last synced: over 1 year ago
JSON representation
Parse Keynote files in Ruby.
- Host: GitHub
- URL: https://github.com/holman/rapinoe
- Owner: holman
- License: mit
- Created: 2016-01-16T04:09:37.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-19T05:18:57.000Z (over 10 years ago)
- Last Synced: 2024-04-24T00:44:37.200Z (about 2 years ago)
- Language: Ruby
- Size: 275 KB
- Stars: 47
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README

# Rapinoe
Rapinoe helps you parse Apple Keynote files.
Primarily it's designed to help you access the simple metadata of a Keynote file: return how many slides there are, extract the slide previews baked into the file, tell you various details about the file itself on disk, and so on.
## Install
First you'll need ImageMagick. If you use Homebrew, you'll be fine with a quick:
```sh
brew install imagemagick
```
Then install the gem:
```sh
gem install rapinoe
```
## Usage
```ruby
rapinoe = Rapinoe.new('talks/Literal Best Player Ever.key')
# =>
rapinoe.write_preview_to_file("my_dope_talk.jpg")
# => Writes the higher quality 1024px-width preview of your entire deck to a file
rapinoe.slides
# => [, , , ]
rapinoe.slides.first.write_preview_to_file("/tmp/slide-preview.jpg")
# => writes the Keynote-generated slide preview to a file
rapinoe.widescreen?
# => true
rapinoe.colors
# Returns the dominant colors in the first title slide by percentage order. Keys
# are in RGB format.
#
# => {[108, 190, 212]=>0.9550793650793651, [117, 124, 143]=>0.012619047619047618, [125, 83, 100]=>0.010158730158730159, [143, 23, 33]=>0.009603174603174603, [151, 10, 16]=>0.007301587301587302, [133, 49, 62]=>0.005238095238095238}
```