This application takes in an HTML file with default Dreamweaver table of contents formatting and reformats the table of contents to follow WET guidelines. It also generates clearer links for the table of contents, and replaces the old links in the main document with these new links.
Before using the tool, make sure that:
Note that since this code adds/removes tags while making specific assumptions about formatting / tags used, the immediate output WILL contain formatting errors if the original Dreamweaver paste is malformed enough. Be sure to go through the document and manually fix any resulting errors - Dreamweaver is helpful for this.
This tool will search for each entry in the table of contents and replace all instances of it in the Word document with a header (that the table of contents entry links to). This is one of the most common sources of errors that the tool creates. You will have to fix these manually; to aid in this, the original line is included as a comment above the replaced line.
This tool assumes the input has proper HTML formatting (in Dreamweaver, Edit -> Code -> Apply Source Formatting). It may also be worth running through the general Dreamweaver formatting tool if the current document is malformed enough.
Check the console (ctrl + shift + i) for logs on number of entries found, entries that did not have any content matches to link to, and potential error messages.
If the option to search for list numberings is selected, the tool checks each line in the table of contents to see if it starts with a list number, e.g. 3.1. The list numbering must be formatted with numbers and periods.
For example, if there is a line that consists of "3.1 Overview", then "3.1" is extracted as the list numbering.
This list numbering is used for two things:
More in-depth information can be found in the readme.