Outlining Documents in WebEdit.NET
Wednesday, September 7, 2005
There's another member in the family of configurable language objects in WebEdit: Outline Providers. They scan documents for interesting places, like headings or method signatures, all depending. The results are displayed in a new tool window (the Outline Window).
So far, there is support for the following languages:
- VB.NET files: With the typical icons, namespace, type, and most member signatures will appear.
- C# files: Same as VB.NET.
- HTML documents: They are outlined according to headings. If a heading level is missing, there will even be an error element in the outline.
- XML documents: Here, elements and comments will show up. The title of outline elements can be produced from an XPath expression (applied against the respective XML element), or a format string in WebEdit.NET's parameter syntax (for example, ID: $id%, Name: $name%, using the XML elements attributes). Both of these options may be configured in the settings dialog, though there is no persistance for it (yet).
- Plain text documents: There are two different outliner types available: one for creating an outline element for each paragraph, and another for each paragraph that follows a blank line. This will produce a useful outline for text files edited with word wrap turned on or off.
As you can see, things can be quite specialized, because there are very few constraints on how an Outline Provider produces a document outline.