DevactionUI.Highlight (devaction_ui v0.1.0)

Copy Markdown View Source

Splits HEEx source into tokens a code block can colour: {kind, text} pairs whose texts, joined, are the source again. It reads the shapes of a template (tags, components, slots, attributes, strings, {} and <% %> expressions, comments), not the Elixir inside them, so it is cheap and never fails: what it does not know is plain :text.

Kinds: :punct, :html, :component, :slot, :attr, :string, :expr, :comment, :text.

Summary

Functions

The tokens of a HEEx source.

Types

kind()

@type kind() ::
  :punct
  | :html
  | :component
  | :slot
  | :attr
  | :string
  | :expr
  | :comment
  | :text

Functions

heex(source)

@spec heex(String.t()) :: [{kind(), String.t()}]

The tokens of a HEEx source.