You are here: Documenting Your Class Library with Microsoft® Sandcastle > D2HML hot spots in XML comments in source code

D2HML hot spots in XML comments in source code

It is possible to use D2HML in your XML source code comments, for example, to create links from reference topics (generated by Sandcastle) to narrative topics (written manually by the author).

Writing comments in your source code that are included in the documentation through the XML comment file, you can use special tag <span> supported by Doc-to-Help Sandcastle plugin, to include any links and other help hot spots supported by D2HML.

To format a range of text in your XML comment with any D2HML style, use the <span> tag with style attribute. Since it allows you to use all styles, you have the full power of D2HML for creating hot spots of any kind. You can create topic links, keyword links, expanding text and other kinds of hot spots, see D2HML for details. Note that although the standard XML comment tag <see> allows you to create links to assembly element topics, it does not allow you to create links to narrative topics in your help. Using the <span> tag you can easily overcome this limitation; in fact, the <span> tag allows your XML comment text to use all Doc-To-Help features available in Word and HTML source documents via D2HML.

For example, you can add a link to a Doc-To-Help topic like this:

<remarks>

    These are my remarks and there is a link to <span style=”C1H Jump”>this topic|tag=mytopic</span> here

</remarks