#!/bin/sh

# Outputs the extra dependencies of a doc.
#
# Must be run from the website directory.

cat ${1%.html}.md |
  awk '/^@module/{ if (NF == 3) { print $3 } else { print "pkg/mods/" $2 } }' |
  sed 's/-//g' |
  while read dir; do
    echo ../$dir ../$dir/*
  done

cat ${1%.html}.md |
  awk '$1 == "@ttyshot" { print "ttyshot/" $2 ".html" }'
