MatejKafka / XmlDoc2CmdletDoc

Create cmdlet XML help files from XML doc comments. Forked version retargeted for .NET 8, with fixed dependency loading for local builds depending on the NuGet cache.
Other
3 stars 0 forks source link

Example code generates inline not in separate lines #2

Open PrzemyslawKlys opened 3 hours ago

PrzemyslawKlys commented 3 hours ago

This example:

/// <example>
///   <para>This is part of the example's introduction.</para>
///   <para>This is also part of the example's introduction.</para>
///   <code>Test-MyExample | Wrte-Host</code>
///   <para>This is part of the example's remarks.</para>
///   <para>This is also part of the example's remarks.</para>
/// </example>
[Cmdlet("Test", "MyExample")]
public class TestMyExampleCommand : Cmdlet {
    ...
}

Generates:

image

It seems powershell help is sort of broken when positioning para/code. Do you have solution for this?

PrzemyslawKlys commented 2 hours ago

From what i see in others code, the reverse is usually in use

/// <summary>
///   <para type="synopsis">Adds a local folder to the Archivial backup folders list.</para>
///   <para type="description">A Local Source is a folder on your computer (or a directly attached external drive) that you would like Archivial to backup and automatically monitor for new and updated files.</para>
///   <para type="description">The priority of the source determines how frequently it will be scanned for changes. The automated scanning schedule for Low priority sources is once every 48 hours. Medium priority sources are scanned every 12 hours. High priority sources are scanned every hour.</para>
///   <para type="description">The optional MatchFilter parameter allows you to narrow the scope of files in the folder to be monitored. For example, by file extension. Any windows file path wildcard expression will be accepted here.</para>
/// </summary>
/// <example>
///   <code>C:\> Add-ArchivialLocalSource -FolderPath "C:\users\test\documents" -Priority High -Revisions 3</code>
///   <para>Adds the specified folder to backup with high priority, and to retain up to 3 revisions of file history.</para>
///   <para></para>
/// </example>
/// <example>
///   <code>C:\> Add-ArchivialLocalSource -FolderPath "C:\users\test\music\playlists" -Priority High -Revisions 3 -MatchFilter *.m3u</code>
///   <para>Adds the specified folder to backup with high priority, but only files that match the wildcard extension filter.</para>
///   <para></para>
/// </example>
PrzemyslawKlys commented 2 hours ago

It seems related:

PrzemyslawKlys commented 2 hours ago

It seems:


/// <summary>Sets the position of the desktop for one or more monitors.</summary>
/// <para type="synopsis">Sets the position of the desktop for one or more monitors.</para>
/// <para type="description">Sets the position of the desktop for one or more monitors. You can specify the monitor by index, device ID, or device name. You can also set the position for all monitors or only the primary monitor.</para>
/// <example>
/// <code>
/// <para>Set the position for a specific monitor by index</para>
/// 
/// Set-DesktopPosition -Index 1 -Left 0 -Top 0 -Right 1920 -Bottom 1080
/// </code>
/// </example>
/// <example>
/// <code>
/// <para>Set the position for the primary monitor only</para>
/// 
/// Set-DesktopPosition -PrimaryOnly -Left 0 -Top 0 -Right 1920 -Bottom 1080
/// </code>
/// </example>

image

So there's workaround for that, as proposed in that link.

Which generated:

    <command:examples>
      <command:example>
        <maml:title>----------  EXAMPLE 1  ----------</maml:title>
        <dev:code>Set the position for a specific monitor by index

Set-DesktopPosition -Index 1 -Left 0 -Top 0 -Right 1920 -Bottom 1080</dev:code>
      </command:example>
      <command:example>
        <maml:title>----------  EXAMPLE 2  ----------</maml:title>
        <dev:code>Set the position for the primary monitor only

Set-DesktopPosition -PrimaryOnly -Left 0 -Top 0 -Right 1920 -Bottom 1080</dev:code>
      </command:example>
    </command:examples>

Which seems to work, but wonder if itt's not gonna blow up

PrzemyslawKlys commented 34 minutes ago

Another option would be to do --EXAMPLE 1 : xxxxxx -- but not surew how to achieve that