LithoSharp.Generators 1.0.0

dotnet add package LithoSharp.Generators --version 1.0.0
                    
NuGet\Install-Package LithoSharp.Generators -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LithoSharp.Generators" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LithoSharp.Generators" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="LithoSharp.Generators" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LithoSharp.Generators --version 1.0.0
                    
#r "nuget: LithoSharp.Generators, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LithoSharp.Generators@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LithoSharp.Generators&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=LithoSharp.Generators&version=1.0.0
                    
Install as a Cake Tool

LithoSharp.Generators

Roslyn incremental generators for explicitly declared static Markdown collections. Reference LithoSharp normally, then add this package as a private analyzer:

<PackageReference Include="LithoSharp.Generators" Version="1.0.0" PrivateAssets="all" />

Declare a top-level, nongeneric static partial class with StaticContentCollectionAttribute. Include Markdown as AdditionalFiles with all three metadata values:

<AdditionalFiles Include="content\**\*.md">
  <LithoSharpCollection>guides</LithoSharpCollection>
  <LithoSharpId>%(Filename)</LithoSharpId>
  <LithoSharpRoute>guides/%(Filename)/</LithoSharpRoute>
</AdditionalFiles>

The annotated class receives Binder, SchemaJson, and nested Pages, Entries, and Ids classes. Set EmitJsonSchema = true to also generate WriteJsonSchema(string outputPath) for an optional runtime export. SchemaJson exists regardless of that option.

NuGet imports the required analyzer metadata through buildTransitive. When using a source-tree ProjectReference, set OutputItemType="Analyzer" and ReferenceOutputAssembly="false", then import this project's buildTransitive/LithoSharp.Generators.props; the Docs sample shows the complete project-reference setup. Do not add a normal assembly reference to the generator.

Diagnostics LSG001 through LSG006 cover invalid declarations and input metadata, duplicate identities or generated names, invalid or conflicting routes, malformed YAML or unknown fields, and values that cannot bind to the declared front matter type. Dynamic loader data remains a runtime validation concern.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 42 9/15/2026
0.3.1 87 9/9/2026
0.3.0 81 9/8/2026