#! /bin/bash . ./bin/utils.sh releases="$*" log() { echo >&2 "$@" } debug=: if [ "$DEBUG" != "" ]; then debug=log fi for r in $releases; do # For those doing a test build, the docs for all the version might not # be present. That's fine, just skip them. if ! [ -d docs/man$r ]; then continue fi echo >&2 -n "$r : " for s in 1 3 5 7; do echo >&2 -n $s for f in docs/man$r/man$s/*.md.tt; do $debug -n '.' existsin='' # b=$(basename_custom $f md.tt) for x in $releases; do if [ "$x" = "$r" ]; then continue fi if [ -f "docs/man$x/man$s/$b.md.tt" ]; then existsin="$existsin $x" fi done ( if [ "$existsin" != "" ]; then echo "sidebar: |" echo " # This manpage" for x in $existsin; do echo " - [$x version]([% top %]docs/man$x/man$s/$b.html)" done fi ) >"docs/man$r/man$s/$b.cross" done done echo >&2 done