MakeupSyntect (makeup_syntect v0.1.0)

View Source

MakeupSyntect is an adapter for Makeup, providing syntax highlighting using the syntect Rust library.

More syntax definitions are included using two-face.

For a list of supported langugages, see: MakeupSyntect.Syntaxes.

Summary

Functions

Initializes a syntax set from the given folders. Returns a reference that can be used in tokenize calls to avoid rebuilding the syntax set each time.

Tokenizes the given text using syntect.

Functions

initialize_syntaxes_from_folders(folders)

Initializes a syntax set from the given folders. Returns a reference that can be used in tokenize calls to avoid rebuilding the syntax set each time.

tokenize(text, opts \\ [])

Tokenizes the given text using syntect.

Parameters

  • text: The source code text to tokenize
  • opts: Optional keyword list of options
    • language: Optional language identifier (e.g. "rust", "html", "javascript")
    • syntax_set: Optional syntax set resource (created via initialize_syntaxes_from_folders)