0.0
No commit activity in last 3 years
No release in over 3 years
OO simple html tagging of text, similar to JS calls
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

HtmlTagger

Installation

Add this line to your application's Gemfile:

gem 'html_tagger'

And then execute:

$ bundle

Or install it yourself as:

$ gem install html_tagger

Usage

Wrapper methods that will wrap a string in a span tag with the appropriate attributes:

  • bold
  • italics
  • underline, underscore
  • strikeout
  • oblique
  • color(text_color)
  • subscript
  • superscript
  • add_class(class_to_set)
  • tag_id(id_to_set)

These methods are proxied to the method:

  • styles(*list_of_sytles) The list_of_styles is a list of strings, which are mentioned above. The will all go on the same span tag.

The #styles method can take an optional first argument of a symbol which will determine the block type:

  • styles(:block_type, *list_of_styles) -- :block_type can be :p, :div or :span. :span is the same as no first argument.

A link can be created with

  • link(linked_to_url), or an element in the
  • styles('link:linked_to_url', *other_style_elements)

Exceptions

  • When an attempt to add more than one ID element to the same tag
  • When a block type other than SPAN, DIV, or P is specified
  • When an unknown trait is specified to #styles

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

endorse