Skip to content
🌄 R package to assess image alt text
R
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
data-raw
data
docs
man
pkgdown/favicon
tests
vignettes
.Rbuildignore
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
DESCRIPTION
LICENSE
LICENSE.md
NAMESPACE
README.md
_pkgdown.yml
altcheckr.Rproj
codecov.yml

README.md

altcheckr

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

Lifecycle: experimental Travis build status Coverage 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.

You can’t perform that action at this time.