red-gate / XmlDoc2CmdletDoc

Create cmdlet XML help files from XML doc comments
Other
63 stars 24 forks source link

Force new line within paragraph? #18

Closed bozho closed 7 years ago

bozho commented 8 years ago

I can't seem to get a newline within a paragraph. Multiple lines in a paragraph:

<para type="description">line 1
line 2
line 3
</para>

Are converted to a single-line <maml:para> element.

If I edit the generated .xml file and add line breaks, the help is rendered as expected.

Thank you, Marko

ChrisLambrou commented 8 years ago

Hi Marko,

This is intended behaviour. For <para\> elements in XML Doc comments, the line breaks are ignored, so XmlDoc2CmdletDoc honours this. The closest that's currently available is to use multiple <para\> elements. For example, the following:

<para type="description">line 1</para>
<para type="description">line 2</para>
<para type="description">line 3</para>

would be translated into the following MAML:

<maml:description>
  <maml:para>line 1</maml:para>
  <maml:para>line 2</maml:para>
  <maml:para>line 3</maml:para>
</maml:description>

which would in turn be rendered as follows by the Get-Help cmdlet:

DESCRIPTION
    line 1

    line 2

    line 3

This might be closer to what you need, but there's a very definite blank line between paragraphs. If you really need line breaks rather than separate paragraphs, I could maybe look into supporting this using <![CDATA[]]>, but it depends entirely on how well the Get-Help cmdlet accommodates this (and my experience with it doesn't make me hopeful!). Please let me know whether or not using multiple paragraphs will satisfy your needs. Either way, I still ought to make sure that <![CDATA[]]> is correctly handled, but knowing whether or not it's causing problems right now will help me prioritise this against all the other stuff I have on my plate! :wink:

ChrisLambrou commented 7 years ago

Abandoned.