README.md in onebox-1.8.19 vs README.md in onebox-1.8.20
- old
+ new
@@ -1,14 +1,13 @@
onebox
-----------
+======
- - [![Gem Version](https://badge.fury.io/rb/onebox.png)](https://rubygems.org/gems/onebox)
- - [![Code Climate](https://codeclimate.com/github/dysania/onebox.png)](https://codeclimate.com/github/dysania/onebox)
- - [![Build Status](https://travis-ci.org/discourse/onebox.png)](https://travis-ci.org/discourse/onebox)
- - [![Dependency Status](https://gemnasium.com/discourse/onebox.png)](https://gemnasium.com/discourse/onebox)
+[![Gem Version](https://badge.fury.io/rb/onebox.png)](https://rubygems.org/gems/onebox)
+[![Code Climate](https://codeclimate.com/github/dysania/onebox.png)](https://codeclimate.com/github/dysania/onebox)
+[![Build Status](https://travis-ci.org/discourse/onebox.png)](https://travis-ci.org/discourse/onebox)
+[![Dependency Status](https://gemnasium.com/discourse/onebox.png)](https://gemnasium.com/discourse/onebox)
-
Onebox is a library for turning media URLs into simple HTML previews of the resource.
Onebox currently has support for page, image, and video URLs for many popular sites.
It's great if you want users to input URLs and have your application convert them into
@@ -17,11 +16,11 @@
It was originally created for [Discourse](http://discourse.org) but has since been
extracted into this convenient gem for all to use!
Usage
-=====
+-----
Using onebox is fairly simple!
First, make sure the library is required:
``` ruby
@@ -71,22 +70,22 @@
preview = Onebox.preview(url)
"#{preview}" == preview.to_s #=> true
```
Development Preview Interface
-=============================
+-----------------------------
The onebox gem comes with a development server for previewing the results
of your changes. You can run it by running `bundle exec rake server` after checking
out the project. You can then try out URLs.
The server doesn't reload code changes automatically (PRs accepted!) so
make sure to hit CTRL-C and restart the server to try a code change out.
Adding Support for a new URL
-============================
+----------------------------
1. Check if the site supports [oEmbed](http://oembed.com/) or [Open Graph](https://developers.facebook.com/docs/opengraph/).
If it does, you can probably get away with just whitelisting the URL in `Onebox::Engine::WhitelistedGenericOnebox` (see: [Whitelisted Generic Onebox caveats](#user-content-whitelisted-generic-onebox-caveats)).
If the site does not support open standards, you can create a new engine.
@@ -175,21 +174,21 @@
require_relative "engine/name_onebox"
```
Whitelisted Generic Onebox caveats
-==================================
+----------------------------------
The Whitedlisted Generic Onebox has some caveats for it's use, beyond simply whitelisting the domain.
1. The domain must be whitelisted
2. The URL you're oneboxing cannot be a root url (e.g. `http://example.com` won't work, but `http://example.com/page` will)
3. If the oneboxed URL responds with oEmbed and has a `rich` type: the `html` content must contain an `<iframe>`. Responses without an iframe will not be oneboxed.
Installing
-==========
+----------
Add this line to your application's Gemfile:
gem "onebox"
@@ -201,16 +200,16 @@
$ gem install onebox
Issues / Discussion
-===================
+-------------------
Discussion of the Onebox gem, its development and features should be done on
[Discourse Meta](https://meta.discourse.org).
Contributing
-============
+------------
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)