diff --git a/Cargo.lock b/Cargo.lock index 61ea736..d674670 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "accessibility-rs" -version = "0.0.26" +version = "0.0.28" dependencies = [ "accessibility-scraper", "accessibility-tree", diff --git a/accessibility-rs/Cargo.toml b/accessibility-rs/Cargo.toml index 283dc54..0b96f64 100644 --- a/accessibility-rs/Cargo.toml +++ b/accessibility-rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "accessibility-rs" -version = "0.0.26" +version = "0.0.28" authors = ["The A11yWatch Project Developers", "Jeff Mendez "] edition = "2021" license = "MIT OR Apache-2.0" diff --git a/accessibility-rs/src/engine/rules/techniques.rs b/accessibility-rs/src/engine/rules/techniques.rs index 347d0e3..e2c0ca5 100644 --- a/accessibility-rs/src/engine/rules/techniques.rs +++ b/accessibility-rs/src/engine/rules/techniques.rs @@ -3,7 +3,7 @@ use strum_macros::IntoStaticStr; #[derive(PartialOrd, Ord, std::cmp::Eq, PartialEq, Hash, Debug, IntoStaticStr)] /// techniques for WCAG pub enum Techniques { - /// + /// H25, /// H32, diff --git a/accessibility-rs/src/engine/rules/utils/mod.rs b/accessibility-rs/src/engine/rules/utils/mod.rs index 69e3fea..61a4ec0 100644 --- a/accessibility-rs/src/engine/rules/utils/mod.rs +++ b/accessibility-rs/src/engine/rules/utils/mod.rs @@ -1 +1,2 @@ +/// utilities for node extracting pub mod nodes; diff --git a/accessibility-rs/src/engine/rules/wcag_rule_map.rs b/accessibility-rs/src/engine/rules/wcag_rule_map.rs index 09f50ef..b72df7c 100644 --- a/accessibility-rs/src/engine/rules/wcag_rule_map.rs +++ b/accessibility-rs/src/engine/rules/wcag_rule_map.rs @@ -11,9 +11,8 @@ use std::collections::BTreeMap; use std::collections::HashMap; use std::ops::Add; -// todo: validate each element and add a shape that can prevent repitiion lazy_static! { - /// a list of rules that should be applied for WCAG1 A-AAA + /// a list of rules that should be applied for WCAG2.0 A-AAA pub static ref RULES_A: BTreeMap<&'static str, Vec> = vec![ ("html", Vec::from([ diff --git a/accessibility-rs/src/engine/styles/errors.rs b/accessibility-rs/src/engine/styles/errors.rs index 3114816..2fbd252 100644 --- a/accessibility-rs/src/engine/styles/errors.rs +++ b/accessibility-rs/src/engine/styles/errors.rs @@ -8,7 +8,9 @@ use selectors::parser::SelectorParseErrorKind; // UnknownUnit(CowRcStr<'i>), // } +/// rule parsing errors pub enum RuleParseErrorKind<'i> { + /// selector parse error Selector(SelectorParseErrorKind<'i>), } diff --git a/accessibility-rs/src/engine/styles/rules.rs b/accessibility-rs/src/engine/styles/rules.rs index 2f96bdf..7b5497b 100644 --- a/accessibility-rs/src/engine/styles/rules.rs +++ b/accessibility-rs/src/engine/styles/rules.rs @@ -4,13 +4,18 @@ use cssparser::{AtRuleParser, ParseError, QualifiedRuleParser}; use std::sync::Arc; #[derive(Debug)] +/// Css rules to match selectors pub enum CssRule { + /// the style rules for css StyleRule { + /// css selectors list with selector trait selectors: selectors::SelectorList, + /// a css block parsed block: Arc, }, } +/// css parser pub struct Parser; impl<'i> selectors::parser::Parser<'i> for Parser { @@ -18,9 +23,11 @@ impl<'i> selectors::parser::Parser<'i> for Parser { type Error = RuleParseErrorKind<'i>; } +/// css selector list pub type SelectorList = selectors::SelectorList; // pub type Selector = selectors::parser::Selector; +/// css rules parser pub struct RulesParser; impl<'i> QualifiedRuleParser<'i> for RulesParser { @@ -51,7 +58,6 @@ impl<'i> QualifiedRuleParser<'i> for RulesParser { impl<'i> AtRuleParser<'i> for RulesParser { type PreludeBlock = (); type PreludeNoBlock = (); - type AtRule = CssRule; type Error = RuleParseErrorKind<'i>; } diff --git a/accessibility-rs/src/i18n/locales.rs b/accessibility-rs/src/i18n/locales.rs index ecc6337..8f2e3bd 100644 --- a/accessibility-rs/src/i18n/locales.rs +++ b/accessibility-rs/src/i18n/locales.rs @@ -25,6 +25,7 @@ pub struct Messages { hi: M, } +/// the languages for auditing results pub enum Langs { /// english En, diff --git a/accessibility-rs/src/lib.rs b/accessibility-rs/src/lib.rs index 879d25b..0413cf2 100644 --- a/accessibility-rs/src/lib.rs +++ b/accessibility-rs/src/lib.rs @@ -37,10 +37,10 @@ extern crate lazy_static; #[macro_use] extern crate rust_i18n; -/// the main engine for audits. -mod engine; +/// the main engine for accessibility auditing. +pub mod engine; /// locales for translations. -mod i18n; +pub mod i18n; use crate::engine::audit::auditor::Auditor; use crate::engine::issue::Issue;