kyrie
    Preparing search index...

    Function html_from_value

    • Converts a JavaScript value to HTML with inline CSS color styling Convenience function that parses the value and paints it as HTML

      Parameters

      • value: unknown

        The value to convert to HTML

      • Optionaloptions: Options

        Optional configuration for highlighting

      Returns string

      HTML string with span tags and inline CSS styles

      const data = { name: "Alice", age: 30 };
      const html = html_from_value(data);
      document.body.innerHTML = html;
      const arr = [1, 2, 3, "hello", true];
      const html = html_from_value(arr, { palette: palettes.bold.dark });
      console.log(html); // Outputs HTML with inline styles