renderDocument function

Render an html_document object