Please find attached a preliminary rough shell script that does the job for the faq[0-9]+.html files, keeping track of anchors appropriately. It is missing pf, ports, and other files, but it's a starting point.
Disclaimer: this is unofficial stuff and I am not asking for this script to be supported by OpenBSD or included in the release workflow. I will probably put the script in my git repo, just in case somebody wants to use it. Comments are welcome. HTH
faq_local.sh
Description: Bourne shell script