sul-dlss/mirador_rails

Name: mirador_rails

Owner: Stanford University Digital Library

Description: A gem for including Mirador in Rails applications

Created: 2017-02-23 22:23:02.0

Updated: 2018-05-07 17:37:00.0

Pushed: 2018-05-07 17:37:10.0

Homepage:

Size: 2474

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

MiradorRails

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file lib/mirador_rails. To experiment with that code, run bin/console for an interactive prompt.

TODO: Delete this and the text above, and describe your gem

Installation

Add this line to your application's Gemfile:

'mirador_rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mirador_rails
Mount the Engine

In your routes.rb file mount the MiradorRails::Engine

t MiradorRails::Engine, at: MiradorRails::Engine.locales_mount_path
Usage

You can require the mirador js by requiring the following:

require mirador

And the css


require mirador

You may not want to do this in your application.js, as the JavaScript by itself may add over 1.8MB to your application.js payload.

Initialize mirador in a view
mirador_tag() %>

The mirador_tag method takes several arguments which allow for customization of the mirador view.

aram [String] id
aram [String] height
aram [String] width
aram [String] position
aram [String] display
aram [Hash] options Mirador settings
Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Upgrading

From a new Mirador release build, run the rake task with the tag:

ndle exec rake update[v2.1.4]

Delete FontAwesome and MaterialIcons from mirador-combined.css. We include this in dependent gems instead.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/sul-dlss/mirador_rails.

License

The gem is available as open source under the terms of the Apache 2.0.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.