Gem to rag-adjust text content based on Mark Boulton's 24ways article: http://24ways.org/2013/run-ragged/ and Nathan Ford's JS implementation: https://github.com/nathanford/ragadjust
Add this line to your application's Gemfile:
gem 'ragadjust'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ragadjust
Ragadjust::Adjust.ragadjust_content(text_to_adjust, selector, method, orphans)
selector
takes a CSS selector and defaults to:
'p, li, dd, figcaption'
method
options:
'all' - default: apply adjustment to all the below
'prepositions' - only rag-adjust prepositions
'small-words' - only adjust 1-/2-letter words
'dashes' - only adjust space after dashes
'emphasis' - only adjust within emphasis tags (em, strong, i, b)
orphans
defaults to true and will add a non-breaking space before the last word in an h1-h6 tag
- Fork it ( https://github.com/aperfect/ragadjust/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Questions or suggestions, please email [email protected]