#!/usr/bin/env bash # Make HTML page of all man pages so we can see them in Evergreen. # # Command-line positional parameters: # # LIBNAME bson or mongoc, for the page title # DIRECTORY path to .3 files # # Is the "aha" program in CWD or installed systemwide? if [ -e "aha" ]; then AHA="./aha" else AHA="aha" fi echo " $1 man pages
"

for doc in $2/*.3; do
  fullpath=$(pwd)/$doc
  name=$(basename $doc)

  if [ ! -e "$fullpath" ]; then
    >&2 echo "No .3 files in $2!"
    exit 1
  fi

  echo "
$name

"

  # suppress man's warnings "cannot break line" or "cannot adjust line"
  MAN_KEEP_FORMATTING=1 COLUMNS=80 man "$fullpath" 2>/dev/null | ul -t xterm | "$AHA" --no-header

  echo "

" done echo "
"