Makeup v0.7.0 Makeup.Registry View Source

A registry that allows users to dynamically register new makeup lexers.

Lexers should register themselves on application start. That way, you can add support for new programming languages by depending on the relevant lexers. This is useful for projects such as ExDoc, which might contain code in a number of different programming languages.

Link to this section Summary

Functions

Fetches a lexer from Makeup’s registry

Fetches a lexer from Makeup’s registry

Adds a new lexer to Makeup’s registry under the given name

Link to this section Functions

Link to this function fetch_lexer_by_name!(name) View Source

Fetches a lexer from Makeup’s registry.

Returns either {lexer, options} or raises an KeyError. This behaviour is based on Map.fetch!/2.

Link to this function fetch_lexer_by_name(name) View Source

Fetches a lexer from Makeup’s registry.

Returns either {:ok, {lexer, options}} or :error. This behaviour is based on Map.fetch/2.

Link to this function register_lexer_with_name(name, arg) View Source

Adds a new lexer to Makeup’s registry under the given name.

This function expects a lexer