RecordVisitors- Readme for Nuget–part 10

Nuget now allow for a package to see a Markdown document. I choose to embed the readme.md file

I just embed into csproj file:

<ItemGroup>
     <None Include=”../../../readme.md” Pack=”true” PackagePath=”\” />
   </ItemGroup>

<PropertyGroup>

<PackageReadmeFile>readme.md</PackageReadmeFile>

</PropertyGroup>

I needed also to make a small modif , to remove HTML comments that were seeing into nuget

$path = “../../README.md”

$path =Resolve-Path $path

Write-Host $path

$fileContent = gc $path

Write-Host $fileContent.Length

For($i=0;$i -lt $fileContent.Length ; $i++){

$line = $fileContent[$i];

If ($line -match ‘^<!–‘) {

$state=’comment’

$fileContent[$i] =$null # because `continue` doesn’t work in a foreach-object

      }

If ($line -match ‘–>$’) {

$state=’content’

$fileContent[$i] =$null

      }

If ($state -eq ‘comment’) {

$fileContent[$i] =$null

      }

}

$fileContent |Set-Content $path

You can see the end result at https://www.nuget.org/packages/recordvisitors#