MarkdownSnippets icon indicating copy to clipboard operation
MarkdownSnippets copied to clipboard

Support for NuGet readme

Open distantcam opened this issue 3 years ago • 2 comments

I want to use MarkdownSnippets to generate a readme for GitHub and NuGet.

Currently I'm generating 1 file that is compatible with both. This means omitting the links as NuGet does not support html tags in the readme.

First issue. I would like a way to enforce "strict" markdown without any html output. The links could be rendered in markdown format instead of anchor tags, which would make them compatible with NuGet.

Second issue. It would be nice if I could generate 2 different readmes from the same source, but with different configs. I figure the easiest way to do this would be using the msbuild task, but there's currently an issue with nullable task parameters in msbuild dotnet/msbuild#4729

So, I'm wondering how to proceed. I'm happy to work on a PR.

distantcam avatar Jul 12 '22 00:07 distantcam

Are the only 2 cases of links you want to be markdown the following?

<a id='snippet-MySnippetName'></a>
<sup><a href='/relativeUrlToFile#L1-L11' title='Snippet source file'>snippet source</a> | <a href='#snippet-MySnippetName' title='Start of snippet'>anchor</a></sup>

and what markdown would you use for those?

SimonCropp avatar Jul 12 '22 02:07 SimonCropp

Yep, those are the cases I know of.

For pure markdown I'd remove the id tag, and change the link below the code to [snippet source](/relativeUrlToFile#L1-L11)

distantcam avatar Jul 12 '22 02:07 distantcam