Module | Nanoc::Helpers::Text |
In: |
lib/nanoc/helpers/text.rb
|
Contains several useful text-related helper functions.
Returns an excerpt for the given string. HTML tags are ignored, so if you don‘t want them to turn up, they should be stripped from the string before passing it to the excerpt function.
@param [String] string The string for which to build an excerpt
@option params [Number] length (25) The maximum number of characters
this excerpt can contain, including the omission.
@option params [String] omission ("…") The string to append to the
excerpt when the excerpt is shorter than the original string
@return [String] The excerpt of the given string