WinEdt Macro Library  | HTML previous macro  | next macro



This macro automatically generates a table of contents with hyperlinks and correct indentation levels.

It will insert anchors before every header and construct a list (of lists, of lists ...) of references to the headers.
This Table of Contents will be inserted at the position of the cursor, when you start the macro, for example here (generated by HTMLtoc.edt):

Table of Contents

  1. HTMLtoc
    1. Description
    2. Installation
    3. Options
    4. Download

That was (too) simple!
(Note, that it does not include the Table of Contents in the Table of Contents...)


Put the macro in a folder (e.g. %b\Macros\HTML), and assign a shortcut to it or make a menu item for it.


You can easily change the type of list (<OL> or <UL>) that will be generated.
You might need to accustom the maximum number of lines that a header can span. (Read the macro's documentation to learn how to.)



Macro contributed by Robert <>.

WinEdt Macro Library  | HTML previous macro  | next macro