validate_lesson: Pre-build validation of lesson elements

View source: R/validate_lesson.R

validate_lessonR Documentation

Pre-build validation of lesson elements

Description

A validator based on the pegboard::Lesson class cached with this_lesson() that will provide line reports for fenced divs, links, images, and heading structure. For details on the type of validators avaliable, see the {pegboard} article Validation of Lesson Elements

Usage

validate_lesson(path = ".", headings = FALSE, quiet = FALSE)

Arguments

path

the path to the lesson. Defaults ot the current directory

headings

If TRUE, headings will be checked and validated. Currently set to FALSE as we are re-investigating some false positives.

quiet

if TRUE, no messages will be issued, otherwise progress messages will be issued for each test

Details

Headings

We expect the headings to be semantic and informative. Details of the tests for headings can be found at pegboard::validate_headings()

Internal Links and Images

Internal links and images should exist and images should have alt text. Details for these tests can be found at pegboard::validate_links()

Fenced Divs (callout blocks)

Callout Blocks should be one of the expected types. Details for this test can be found at pegboard::validate_divs()

Value

a list with the results for each test as described in pegboard::Lesson

Examples

tmp <- tempfile()
lsn <- create_lesson(tmp, open = FALSE)
validate_lesson(lsn, headings = TRUE)

zkamvar/sandpaper documentation built on Nov. 8, 2024, 5:36 p.m.