Display of multiple <code region="" sections

Topics: Developer Forum, Project Management Forum, User Forum
Mar 28, 2007 at 11:11 AM
Hi,

In the previous incarnation (pre-1.4.0.1) the following method comment section containing multiple "<code regions=xyz" declarations would produce a simple code example section containing the required pieces of code. (Using VS2005 presentation style)

/// <example>How to use the StringExtractor.LeftOf method
/// <code region="Namespace Include #1" source="Code Samples\UsingStringExt.cs" lang="cs"/>
/// <code region="Namespace Include #2" source="Code Samples\UsingStringExt.cs" lang="cs"/>
/// <code region="LeftOf" source="Code Samples\UsingStringExt.cs"  lang="cs"/>
/// </example>

Now the same comment section produces three separate blocks of code, each inside its own bordered table block which makes it difficult for the reader to view the code sample as a whole.

Yes, one solution is to create a new complete code sample per example but that seems to defeat the point of having distinct includeable regions.

Is there another solution, preferrably without having to re-write large chunks of the VS2005 presentation transform stylesheets?

Could we create an "<code-block>" or somesuch to encapsulate example code i.e

/// <example>How to use the StringExtractor.LeftOf method
/// <code-block>
/// <code region="Namespace Include #1" source="Code Samples\UsingStringExt.cs" lang="cs"/>
/// <code region="Namespace Include #2" source="Code Samples\UsingStringExt.cs" lang="cs"/>
/// <code region="LeftOf" source="Code Samples\UsingStringExt.cs"  lang="cs"/>
/// </code-block>
/// </example>
Coordinator
Mar 28, 2007 at 8:03 PM
Edited Mar 28, 2007 at 8:04 PM
Code blocks are distinct entities. If it was showing them as one continuous block in prior releases, it was by accident rather than by design. The intent of the includeable regions was to allow pulling in code from actual source files rather than merging disparate chunks of code into one single block. The change in the March CTP was the inclusion of the "Copy Code" link which now precedes each block in the VS2005 style. The code block component was modified to match it so rewriting the VS2005 transformations won't fix it as the code block component is actually managing the code block layout. I'll take a look at supporting a <code-block> tag or something similar to allow merging code samples.

Eric