(*--------------------------------------------------------------------------- Copyright (c) 2025 Anil Madhavapeddy . All rights reserved. SPDX-License-Identifier: MIT ---------------------------------------------------------------------------*) (** Entry point for the standalone JavaScript build. This module is compiled to [htmlrw.js] and automatically registers the validation API on [window.html5rw] when loaded. {2 Browser Usage} {v v} {2 Module Bundler Usage} If using a bundler that supports CommonJS or ES modules, you can import the module instead: {v import { validateElement, showPanel } from './htmlrw.js'; const result = validateElement(document.body); if (result.hasErrors) { showPanel(result); } v} The module exports are set up to work with both import styles. {2 API Reference} See {!Htmlrw_js} for the full API documentation. The JavaScript API mirrors the OCaml API with camelCase naming: - [html5rw.validateString(html)] - Validate an HTML string - [html5rw.validateElement(el)] - Validate a DOM element - [html5rw.validateAndAnnotate(el, config?)] - Validate and annotate - [html5rw.showPanel(result, config?)] - Show the warning panel - [html5rw.hidePanel()] - Hide the warning panel - [html5rw.clearAnnotations(el)] - Clear annotations from an element *) (* This module has no values; its side effect is registering the API *)