#!/bin/sh # SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2026 Martino Ferrari # # The manual's check, the way tools/check_ui.py is the .ui files' check: it runs the four # yelp-check subcommands that need no network, then renders the whole set to HTML with # yelp-build so a page that only fails at the transform step is caught too. # # `yelp-check validate` is deliberately absent. It fetches the Mallard RelaxNG schema over # the network and fails on an offline machine for that reason rather than for a fault in the # pages -- links/media/orphans/ids are the offline checks. # # Exit status is nonzero on the first finding. set -eu dir=${1:?usage: check_help.sh HELP_DIR} if [ ! -f "$dir/index.page" ]; then echo "check_help: no index.page under $dir" >&2 exit 1 fi tmp=$(mktemp -d) trap 'rm -rf "$tmp"' EXIT for sub in links media orphans ids; do printf 'yelp-check %s %s\n' "$sub" "$dir" yelp-check "$sub" "$dir" >/dev/null done mkdir -p "$tmp/html" yelp-build html -o "$tmp/html" "$dir" pages=$(find "$tmp/html" -maxdepth 1 -name '*.html' | wc -l) printf 'yelp-build html: %s page(s) rendered\n' "$pages"