Module: Raakt

Defined in:
lib/raakt.rb,
lib/iso_language_codes.rb

Overview

The Ruby Accessibility Analysis Kit (RAAKT)

:title: Ruby Accessibility Analysis Kit (RAAKT)

Author

Peter Krantz (www.peterkrantz.com/)

License

See LICENSE file

RAAKT is a toolkit to find accessibility issues in HTML documents. RAAKT can be used as part of a an automatic test procedure or as a standalone module for mass validation of all pages in a site.

The ambition has been to provide tests that can be fully automated. Currently, none of the included tests should fail for any web page.

Many of the tests included here map to tests defined in the Unified Web Evaluation Methodology (UWEM). See note for each test to find the corresponding UWEM test.

Output

RAAKT output is in the form of an array of Raakt::ErrorMessage objects.

Contributions

Thanks to Derek Perrault for refactoring RAAKT to use Hpricot while at the same time making the code more readable.

Example usage

See the examples folder for a small script that shows how to retrieve a remote web page and perform an accessibility test on it.

Defined Under Namespace

Classes: ErrorMessage, Test

Constant Summary collapse

MESSAGES =
{
  :missing_title       => "The title element is missing. Provide a descriptive title for your document.",
  :empty_title         => "The title element is empty. Provide a descriptive title for your document.",  
  :missing_alt         => "Missing alt attribute for image (with src '%s').",
  :missing_heading     => "Missing first level heading (h1). Provide at least one first level heading describing document content.",
  :wrong_h_structure   => "Document heading structure is wrong.",
  :first_h_not_h1      => "The first heading is not h1.",
  :has_nested_tables   => "You have one or more nested tables.",
  :missing_semantics   => "You have used %s for visual formatting. Use CSS instead.",
  :has_flicker         => "You have used <blink> and/or <marquee>. These may create accessibility issues and should be avoided.",
  :missing_lang_info   => "Document language information is missing. Use the lang attribute on the html element.",
  :missing_th          => "Missing table headings (th) for table #%s.",
  :ambiguous_link_text => "One or more links have the same link text ('%s'). Make sure each link is unambiguous.",
  :field_missing_label => "A field (with id/name '%s') is missing a corresponding label element. Make sure a label exists for all visible fields.",
  :missing_frame_title => "Missing title attribute for frame with url %s",
  :has_meta_refresh    => "Client side redirect (meta refresh) detected. Use server side redirection instead.",
	:charset_mismatch	 => "The character set specified in the HTTP headers does not match that specified in the markup.",
	:embed_used			 => "You have used the embed element. It does not provide a way to express a text representation.",
	:wrong_lang_code	 => "You have used a language code ('%s') not recognized in the ISO 639 standard.",
	:fieldset_missing_legend => "Missing legend element for fieldset #%s.",
	:missing_input_alt	 => "Missing alt attribute for image button with id/name '%s'.",
	:missing_input_alt_text	 => "Missing alt text for image button with id/name '%s'.",
	:missing_area_alt	 => "Missing alt attribute for area with id/name '%s'.",
	:missing_area_alt_text	 => "Missing alt text for area with id/name '%s'."
}
VERSION =
"0.5.1"