Clarity.Components.CodeHighlighter (Clarity v0.5.1)

Copy Markdown View Source

Provides lexer selection for syntax highlighting using Makeup.

Summary

Functions

Gets the appropriate Makeup lexer for a given language string.

Functions

get_lexer(arg1)

@spec get_lexer(language :: String.t() | nil) :: module() | nil

Gets the appropriate Makeup lexer for a given language string.

Returns the lexer module or nil if the language is not supported.

Examples

iex> CodeHighlighter.get_lexer("elixir")
Makeup.Lexers.ElixirLexer

iex> CodeHighlighter.get_lexer("python")
nil