Converts a JavaScript value to HTML with inline CSS color styling Convenience function that parses the value and paints it as HTML
The value to convert to HTML
Optional
Optional configuration for highlighting
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; Copy
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 Copy
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
Converts a JavaScript value to HTML with inline CSS color styling Convenience function that parses the value and paints it as HTML