Adding Links Directly in Comments

Sometimes you may want to insert links to other topics resulting document. VBdocman doesn't support links directly but you can workaround it by macros.

There are several solutions for creating links, from specific for each output format to general.

Note, all macros mentioned bellow are already defined in the templates for your convenience, you can use or redefine them if you wish.

1. HTML and HTML Help

All topics are named in the same form MODULE-MEMBER, e.g. Class1-Method1 if there is Method1 method defined in Class1 class.

Links in HTML and HTML Help documentation are created by standard HTML syntax:

<a href=MODULE-MEMBER.html>LABEL</a>

For instance:

<a href=class1-method1.html>this is link to Method1</a>

If you write this code in your comments, you create a link in HTML and CHM documentation. It will not work with other formats. To solve this problem, just use macros instead of HTML code.

In HTML and CHM templates define three macros for that purpose:

$LS$ <a href=
$le$ .html>
$EL$ </a>

To create a link add to your comments something like this:

'**
'@rem If you are interested, you can jump
' to $LS$Class1-Method1$LE$very interesting method$EL$
'
Public Function getCell(ByVal x As Integer, ByVal y As Integer) As Integer End Function

Note, in CHM format you can make reference to other CHM file. This can be useful when working with project groups. Syntax of such link is similar to usual HTML topic:

<a href=PROJECT.chm::/MODULE-MEMBER.html>LABEL</a>

For instance:

<a href=mclass1-method1.html>this is link to Method1 in other project</a>

 

2. RTF

Three macros mentioned above will create link in RTF and HLP documentation too. But there is one difference in referencing topics. You must use MODULE_MEMBER instead of MODULE-MEMBER format.

Macros in RTF and HLP may be defined as follows:

$LS$ {\f69\lang1033 {\field\flddirty {\*\fldinst {\lang1033 HYPERLINK \\l "
$LE$ "}}{\fldrslt {\cs19\cf2 
$EL$ }}}}

To create a link add to your comments something like this:

'**
'@rem If you are interested, you can jump
' to $LS$Class1_Method1$LE$very interesting method$EL$
'
Public Function getCell(ByVal x As Integer, ByVal y As Integer) As Integer End Function

3. General

You can combine two previous methods where "-" (for HTML) and "_" (for RTF) characters are replaced by macro e.g. $SL$. This macro is defined in HTML and CHM templates as:

$SL$ -

and in RTF and HLP templates as:

$SL$ _

You then create link as follows:

'**
'@rem If you are interested, you can jump
' to $LS$Class1$SL$Method1$LE$very interesting method$EL$
'
Public Function getCell(ByVal x As Integer, ByVal y As Integer) As Integer End Function

Though it is not very comfortable solution, it is general and you can produce documentation in all formats.

 

Note, this approach can be also applied to the title page text in the Options dialog.

For more information see Using Macros Directly in Comments.


Send feedback to Helixoft
© 2000-2005 Helixoft. All rights reserved.