Const
Paints an AST node with colors and formatting using HTML span tags Convenience wrapper around paint() that uses the html_policy
The AST node to paint
Optional configuration. Defaults will be used for any missing values.
The painted string representation of the node with HTML span tags and inline CSS
const ast = parse_string('{"name": "John"}');const painted = paint_html(ast); // Uses HTML policy with defaultsdocument.body.innerHTML = painted; Copy
const ast = parse_string('{"name": "John"}');const painted = paint_html(ast); // Uses HTML policy with defaultsdocument.body.innerHTML = painted;
const ast = parse_string('{"name": "John"}');const options = { palette: forestPalette };const painted = paint_html(ast, options);document.body.innerHTML = '<pre>' + painted + '</pre>'; Copy
const ast = parse_string('{"name": "John"}');const options = { palette: forestPalette };const painted = paint_html(ast, options);document.body.innerHTML = '<pre>' + painted + '</pre>';
Paints an AST node with colors and formatting using HTML span tags Convenience wrapper around paint() that uses the html_policy