Skip to content

🌄 ✅ R package: assess image alt text on websites

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

matt-dray/altcheckr

Repository files navigation

{altcheckr}

An experimental R package to assess the alternative (alt) text from a web page.

Project Status: Inactive – The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows. R build status Coverage status CodeFactor CRAN status Blog post

Description

Scrape image element attributes from a webpage, detect alternative (alt) text and assess it with simple heuristics. Alt text is important for users of assistive technologies, like screen readers, for understanding the content of images. This package should be used in conjunction with other accessibility assessment tools for more comprehensive coverage.

Read more about this package in the accompanying blog post.

Use

Install from GitHub using the {remotes} package:

install.packages("remotes")
remotes::install_github("matt-dray/altcheckr")
library(altcheckr)

There are two major functions for now:

  • alt_get() creates a tibble of HTML attributes for each 'img' element on a supplied web page
  • alt_check() performs basic checks of the alt text for each image

See the 'introduction to {altcheckr} functions' vignette for more information: run vignette("introduction", altcheckr) or visit the {altcheckr} website.

Right now, the alt_check() function flags when alt text:

  • is missing (but this is okay if the image is decorative)
  • is noticeably short or long (length can be controlled by the user)
  • contains self-evident phrases ('image of', 'picture of', etc)
  • is missing terminal punctuation, which interferes with how the sentence is parsed

And it also:

  • highlights words that may be misspelled, via the {hunspell} package
  • returns a list of words that don't appear to be basic English

Links

Code of conduct

Please note that the 'altcheckr' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.