Move HTML formatting of TOC

Move the HTML formatting of the table of contents from MainWindow to the
HtmlPreviewGenerator class.