Para tags inside example tags

Topics: Developer Forum
Aug 12, 2010 at 8:22 PM

Hi all, I started using StyleCop and I was getting warnings about new lines inside documentation and I should use para tags instead.

So I did but now I'm getting the para tags inside my examples, for example this:

   

/// <example>
/// <code language="c#">
/// <para>
/// using System.Data;
/// using System.Data.Odbc;
/// using Cnbv.Sait.Utilities.Conversions;
/// </para>
/// public void Convert()
/// {
///   string name = "@nombre";
///   string value = "erika";
///   OdbcParameter parameter = value.ToOdbcParameter(
///     name, OdbcType.NVarChar, 10, ParameterDirection.InputOutput);
/// }
/// </code>
/// </example>

in the chm file gets converted into this:

<para>
            using System.Data;
            using System.Data.Odbc;
            using Cnbv.Sait.Utilities.Conversions;
            </para>
            public void Convert()
            {
              string name = "@nombre";
              string value = "erika";
              OdbcParameter parameter = value.ToOdbcParameter(
                name, OdbcType.NVarChar, 10, ParameterDirection.InputOutput);
            }

I'm using sandcastle 2.6.1062.1 and SHFB v1.9.1.0, is there anyway to avoid this?

 

thanks for the help.

Juan Zamudio

 

 

Coordinator
Aug 13, 2010 at 2:58 AM

I'd ignore that rule or turn it off.  You can format the comments however you like and it doesn't apply to code in an <code> element.  If you do want to break your text up into paragraphs in <summary> and <remarks> elements, that's the place to use <para>.

Eric