import { tokenize } from "https://deno.land/x/frugal@0.5.0/docs/dep/prism.ts";
This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input and the language definitions to use, and returns an array with the tokenized code.
When the language definition includes nested tokens, the function is called recursively on each of these tokens.
This method could be useful in other contexts as well, as a very crude parser.
Parameters
grammar: Grammar
An object containing the tokens to use.
Usually a language definition like Prism.languages.markup
.