homeoliveOliveHighlighters
search
search
OliveHighlighters

highlighting

Highlighting with OliveHighlighters is based around the TextStyleModifier, a type of TextModifier and a Modifier. The TextStyleModifier is also aliased as Highlighter. The first step is building a highlighter. The constructor, optionally, takes a String.

using OliveHighlighters

my_hl 
= Highlighter("sample")

After a Highlighter is built, we add style classes using style! and we mark it using marking functions

using OliveHighlighters

my_hl 
= Highlighter("s a m p l e s")

style!(my_hl, :s"color" => "red", :s)

OliveHighlighters.mark_all!(my_hl, "s")

To get the result, we call string on our Highlighter.

display("text/html"string(my_hl))

prebuilt highlighters

Alongside the highlighting system, OliveHighlighters offers a few built-in highlighters through styling and marking functions.

marking functions

chifidocs is currently offline; you are viewing a cached version of the site. Some functionality might be missing. Click this message to try for a live version of chifidocs again.