Add transform_document argument to convert_to_html