Pi.Syntax (pi_bridge v0.8.4)

Copy Markdown View Source

Syntax highlighting metadata for pi renderers.

Summary

Functions

Returns renderer-neutral Lumis scope spans for source, or nil when unavailable.

Types

highlight()

@type highlight() :: %{engine: String.t(), language: String.t(), lines: [[span()]]}

span()

@type span() :: %{text: String.t(), scopes: [String.t()]}

Functions

highlight(source, opts \\ [])

@spec highlight(
  String.t(),
  keyword()
) :: {:ok, highlight()} | :error

metadata(source, opts \\ [])

@spec metadata(
  String.t(),
  keyword()
) :: map()

Returns renderer-neutral Lumis scope spans for source, or nil when unavailable.