Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 872 Bytes

File metadata and controls

39 lines (29 loc) · 872 Bytes

GitLinkGenerator

Generate a static field representing the hyperlink to the related github content.

For the following class :

[GitPathGenerator.GitPath]
public partial class Class1
{

}

An static const GitPath is added and can used. For example:

Assert.AreEqual("https://github.com/kgen-llc/GitLinkGenerator/blob/dev/GeneratorGitHubSample/Class1.cs", Class1.GitPath);

In order to work, csproj MUST contains PackageProjectUrl property:

<PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <PackageProjectUrl>https://github.com/kgen-llc/GitLinkGenerator</PackageProjectUrl>
</PropertyGroup>

And do not forget to reference the package :

<ItemGroup>
    <PackageReference Include="kgen.GitLinkGenerator" />
</ItemGroup>