Adding VB code snippets in help documentation

J

Jothishankar

Hi,

I am creating a C# class library. I want to add C# and VB code
snippets along with the code documentation, so that these snippets
appear as examples when help file is generated (I use Docuemnt! X help
file generator). I am using the following tag structure in the source
code to add the documentation.

/// <summary>
.....
/// </summary>
/// <example>
/// <code>
.......
/// </code>
/// </example>

But the issue is, whatever code (C# or VB) I give inside the <code></
code> tag, appears as only a C# Example section in the final help
file. How can I create a VB Example section?

Thanks in advance.

- Jothishankar
 
K

Kevin Matthews

vb documentation uses three single quotes instead of slashes for it's
notation. This might be the issue.

''' <summary></summary>
 
J

Jothishankar

vb documentation uses three single quotes instead of slashes for it's
notation.  This might be the issue.

''' <summary></summary>

Thanks for the reply Kevin. I am inserting these tags in a C#
solution. So I have to use ///. But I am trying to insert a VB code
snippet inside the <code> tag (Just like in MSDN, where both C# and VB
example code snippets are provided). The final help file generated by
Document!X seems to show both the C# and VB code snippets as C#
examples.
 
P

Peter Foot [MVP]

The <code> tag was devised originally for C# comments and no capability was
added to it to specify the code language. Therefore the documentation
compiler is probably just making a best guess and assuming it's C#. Ideally
the spec should be updated to include an attribute to specify the code type
and help file generators could use this to correctly display the snippet
e.g.
<code language="C#"> etc

Some help file generators allow you to extend them to support custom xml
tags in which case you could add a <codevb> tag and then define how this is
integrated into the help file.

Peter

--
Peter Foot
Microsoft Device Application Development MVP
peterfoot.net | appamundi.com | inthehand.com
APPA Mundi Ltd - software solutions for a mobile world
In The Hand Ltd - .NET Components for Mobility

vb documentation uses three single quotes instead of slashes for it's
notation. This might be the issue.

''' <summary></summary>

Thanks for the reply Kevin. I am inserting these tags in a C#
solution. So I have to use ///. But I am trying to insert a VB code
snippet inside the <code> tag (Just like in MSDN, where both C# and VB
example code snippets are provided). The final help file generated by
Document!X seems to show both the C# and VB code snippets as C#
examples.
 
J

Jothishankar

The <code> tag was devised originally for C# comments and no capability was
added to it to specify the code language. Therefore the documentation
compiler is probably just making a best guess and assuming it's C#. Ideally
the spec should be updated to include an attribute to specify the code type
and help file generators could use this to correctly display the snippet
e.g.
<code language="C#"> etc

Some help file generators allow you to extend them to support custom xml
tags in which case you could add a <codevb> tag and then define how this is
integrated into the help file.

Peter

--
Peter Foot
Microsoft Device Application Development MVP
peterfoot.net | appamundi.com | inthehand.com
APPA Mundi Ltd - software solutions for a mobile world
In The Hand Ltd - .NET Components for Mobility






Thanks for the reply Kevin. I am inserting these tags in a C#
solution. So I have to use ///. But I am trying to insert a VB code
snippet inside the <code> tag (Just like in MSDN, where both C# and VB
example code snippets are provided). The final help file generated by
Document!X seems to show both the C# and VB code snippets as C#
examples.- Hide quoted text -

- Show quoted text -

I tried using <code lang="VB"> and it worked. But strange thing is
that the 'lang' attribute for the code tag was not documented anywhere
nor was it visible in Intellisense. Anyway, thanks for your help Peter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top