Module: Doing::StringHighlight
- Included in:
- String
- Defined in:
- lib/doing/string/highlight.rb
Overview
Tag and search highlighting
Instance Method Summary collapse
- #highlight_search(search, distance: nil, negate: false, case_type: nil) ⇒ Object
- #highlight_search!(search, distance: nil, negate: false, case_type: nil) ⇒ Object
-
#highlight_tags(color = 'yellow', last_color: nil) ⇒ String
Colorize @tags with ANSI escapes.
- #highlight_tags!(color = 'yellow', last_color: nil) ⇒ Object
-
#last_color ⇒ String
Returns the last escape sequence from a string.
-
#uncolor ⇒ Object
Remove color escape codes.
- #uncolor! ⇒ Object
Instance Method Details
#highlight_search(search, distance: nil, negate: false, case_type: nil) ⇒ Object
#highlight_search!(search, distance: nil, negate: false, case_type: nil) ⇒ Object
#highlight_tags(color = 'yellow', last_color: nil) ⇒ String
Colorize @tags with ANSI escapes
#highlight_tags!(color = 'yellow', last_color: nil) ⇒ Object
#last_color ⇒ String
Returns the last escape sequence from a string.
Actually returns all escape codes, with the assumption that the result of inserting them will generate the same color as was set at the end of the string. Because you can send modifiers like dark and bold separate from color codes, only using the last code may not render the same style.
#uncolor ⇒ Object
Remove color escape codes