You are here: Documenter for .NET > Using Documenter Styles to Create Links > Special Characters in Link Text

Special Characters in Link Text

There are three special characters that you can use in link text, in addition to link styles, to control the process of creating links: ‘!’ (exclamation sign), ‘()’ (parenthesis), ‘+’ (plus). These characters have special meanings to the Doc-To-Help compiler (more exactly, to the scripts in the Doc-To-Help project created by Documenter for .NET). They are removed or replaced in the resulting help file.

By default, Doc-To-Help removes the qualifying namespace, if present, from type names in links to types. It also removes the qualifying type name from member names in links to members. So, for example, a link System.Windows.Forms.CheckBox formatted with Link Class style will become simply CheckBox in the help file. And a link DataSet.Clone formatted with Link Method style will become simply Clone in the help file. This is done so you can use a namespace or type name to qualify your link so it points to the correct topic. For example, a class CheckBox also exists in the namespace System.Web.UI.WebControls, and many different classes have a Clone method, so you may need to qualify those links to ensure uniqueness, but you usually don’t want the qualifier to appear in the help file text.

However, sometimes you may want the fully qualified name to appear in the link text. In that case, use one of the special characters, either exclamation sign or parenthesis.

An exclamation sign ‘!’ at the start of the link text instructs Doc-To-Help to leave the full name as is, not to remove the namespace or type name qualifier. Special character ‘!’ is supported in all link styles except Link Namespace, Link Topic and Link Tag where it is not applicable.

Enclosing the qualifier (including the dot in the end) in parenthesis has a similar effect. It also stops the qualifier from being removed from the link text. But, unlike the exclamation sign, parentheses specify a different link target topic: the link points to a topic whose name does not contain the qualifier.

The following table illustrates the use of special characters ‘!’ and ‘()’ (link text in the document is formatted with Link Method style):

 

In document

In help file

Links to topic

File.Delete

Delete

File.Delete Method

System.IO.File.Delete

Delete

System.IO.File.Delete Method

!System.IO.File.Delete

System.IO.File.Delete

System.IO.File.Delete Method

(System.IO.)File.Delete

System.IO.File.Delete

File.Delete Method

The special character ‘+’ (plus) is used only in nested type names (nested types are classes, enumerations and other types defined inside a class). It must be used in every nested type name in any link, wherever a type name can occur (that includes links to nested types, links to members of nested types if they are qualified with a type name, and links to method overloads that have nested type names in their argument list). It separates the type name from the parent type name. The normal separator is dot (‘.’), and indeed Doc-To-Help replaces ‘+’ with ‘.’ in the help file text, but ‘+’ is necessary to tell Doc-To-Help where the parent type name ends and the type name itself starts.

This behavior, called the nested type separator substitution, is supported in all link types except Link Namespace and Link Tag where it has no meaning.

The following table illustrates the use of the special character ‘+’ for a SpecialFolder enumeration nested in the Environment class (all examples are from Microsoft .NET Framework). It also demonstrates the other two special characters, ‘!’ and ‘()’. Link text in the document is formatted with Link Enumeration style.

 

In document

In help file

Links to topic

Environment+SpecialFolder

Environment.SpecialFolder

Environment.SpecialFolder Enumeration

System.Environment+SpecialFolder

Environment.SpecialFolder

System.Environment.SpecialFolder Enumeration

!System.Environment+SpecialFolder

System.Environment.SpecialFolder

System.Environment.SpecialFolder Enumeration

(System.)Environment+SpecialFolder

System.Environment.SpecialFolder

Environment.SpecialFolder Enumeration