rename previewHtml to generateHtml