Getting started
annealer has three entry points that share the same Rust core:
anyl: the command-line tool.annealer(npm): a JavaScript API backed by WebAssembly.annealer(Rust crate): the pureformat()function.
CLI
Build the CLI from the repository (the npm package and crate are not published yet):
Then format files:
Supported inputs: .html, .htm, .vue, .css, .scss, .sass, .less. The language is detected from the extension, and each language uses its matching built-in profile unless --profile is given. See CLI for all options.
JavaScript
format() is synchronous. The WebAssembly binary is embedded in the package, so no loader or bundler setup is needed. See JavaScript API.
Example
Input:
Output with the html profile:
idandclasscome first, then supplementary (placeholder), semantic (type), key-value (name) and state (required) attributes, then ARIA.- The multiline tag gets one attribute per line, and the closing bracket goes on its own line.
- The void element
<input>becomes<input />.
Profiles
Two profiles are built in:
To customize, start from a built-in profile (builtinProfile('vue') in JavaScript, or crates/annealer/profiles/*.yaml) and pass your YAML with --profile or the profile option. See Profile reference.