Accept functions as header and footer options

this allows to generate different header and footer according to the file