pablohirafuji/elm-syntax-highlight/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

SyntaxHighlight

Syntax highlighting in Elm.

toBlockHtml : Maybe Int -> List Line -> Html msg

Transform a list of lines into a Html block. The Maybe Int argument is for showing or not line count and, if so, starting from what number.

toInlineHtml : List Line -> Html msg

Transform a list of lines into inline Html.

Languages

elm : String -> Result Error (List Line)

Parse Elm syntax.

xml : String -> Result Error (List Line)

Parse XML syntax.

javascript : String -> Result Error (List Line)

Parse Javascript syntax.

Themes

type Theme

A theme defines the background and syntax colors.

useTheme : Theme -> Html msg

Transform a theme into Html. Any highlighted code will be themed according to the chosen Theme. If you prefer to use CSS external stylesheet, you do not need this, just copy the theme CSS into your stylesheet. All themes can be found here.

monokai : Theme

Monokai inspired theme.

github : Theme

GitHub inspired theme.