hook: add a 'hashook' function to test for hook existence
Preparing the data for some hooks can be expensive. Add a function to check if
a hook exists so we can skip useless preparation if no hook is configured.
#require docutils gettext $ $TESTDIR/check-gendoc pt_BR checking for parse errors