45 releases
0.0.44 | Oct 23, 2023 |
---|---|
0.0.43 | Oct 22, 2023 |
#16 in Accessibility
284 downloads per month
555KB
9K
SLoC
accessibility-rs
The Rust web accessibility engine.
// pass in html and css rules prior. If css rules are not passed in internal extraction is performed.
let audit = accessibility_rs::audit(&html, &css_rules);
Features
- Accurate web accessibility audits without a headless browser.
- Re-creating layout trees to get element positions.
- Ideal shapes for audits that scale.
- Amazingly Fast audits.
About
This crate is actively being developed. Some of the initial code is set as stubs until the feature is complete.
We have two params for the initial audit html
and css
. The reason we have css set is if coming from a browser
you can get all the stylesheets from the dom of external sheets at once. This saves time in re-gathering links later.
Notes
Right now the Layout leaf parsing takes a good chunk of time. Until the parsing is done correctly this will be a crutch in performance and main bottleneck. Removing the Clip handling will drastically shave off time from the runs.
lib.rs
:
Audit html to see how it complies with WCAG standards.
Accessibility-RS is a web accessibility engine that can replicate websites without a browser to get complex accessibility reports.
How to use Accessibility-RS
There are a couple of ways to use Accessibility-RS:
- Audit perform an audit against an html page.
audit
is used to audit a web page for issues.
Examples
A basic WCAG audit for a website:
use accessibility_rs::{audit, AuditConfig};
fn main() {
let config = AuditConfig::basic(r###"<html><body><h1>My Title</h1><input type="text" placeholder="Type me"></input><img src="tabby_cat.png"></img></body></html>"###);
let audit = audit(config);
println!("{:?}", audit);
}
Dependencies
~12–23MB
~320K SLoC