LithoSharp 4.0.0

dotnet add package LithoSharp --version 4.0.0
                    
NuGet\Install-Package LithoSharp -Version 4.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" Version="4.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LithoSharp" Version="4.0.0" />
                    
Directory.Packages.props
<PackageReference Include="LithoSharp" />
                    
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 --version 4.0.0
                    
#r "nuget: LithoSharp, 4.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@4.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&version=4.0.0
                    
Install as a Cake Addin
#tool nuget:?package=LithoSharp&version=4.0.0
                    
Install as a Cake Tool

LithoSharp

build NuGet

English | 日本語

LithoSharp is a C# and .NET static site generator for technical documentation, API references, and Open Knowledge Format (OKF) bundles. Use C# types to define content schemas, routes, and references; write pages in Markdown or optionally MDX; then build HTML and static assets for an ordinary HTTP host. OKF support is in Preview.

OKF version What LithoSharp uses
"0.2" The existing 0.2 rules, including the previous verification and timestamp behavior.
"0.3" Current verification only for trust, date-only metadata at midnight UTC, and document-relative metadata paths unless rooted with /.

For either version, validation and site generation require a quoted okf_version in the bundle-root index.md. An existing 0.2 bundle can add okf_version: "0.2" to keep the previous rules. This requirement does not apply to ordinary Markdown.

When to use LithoSharp

  • Product documentation and developer guides: Build a Docs site with sidebars, a table of contents, local search, versions, and locales. Use the Blog template or independent pages alongside Docs.
  • Typed documentation and API references: Model Markdown or YAML content with C# types and use XML .NET API documentation, OpenAPI 3 JSON, checked examples, and cross-references to keep authored guides connected to generated references.
  • Knowledge bundles: Inspect and validate local OKF Markdown and YAML metadata, preserve original bundle bytes, or render documents through the Docs pipeline. No model or external service is required.

Start with the adoption guide if you are evaluating fit, the 4.0 OKF migration instructions if you have an existing OKF bundle, or the 3.0 migration guide if you are migrating a site from an older release.

Quick Start: build and serve a Docs site

Install the .NET 10 SDK (minimum 10.0.300), then run these commands for 4.0.0:

dotnet new install LithoSharp.ProjectTemplates::4.0.0
dotnet tool install LithoSharp.Tool --version 4.0.0 --tool-path .tools
.tools/lithosharp new docs MyDocs -o MyDocs
.tools/lithosharp build MyDocs -c Release
.tools/lithosharp serve MyDocs -c Release

On Windows use .tools/lithosharp.exe. Edit MyDocs/content and GuideFrontMatter.cs to define your content. Configure the site in DocsSiteFactory.cs. The template checks site quality at Error severity without external HTTP requests. Build and check the site, then deploy MyDocs/dist to your static host.

Existing .NET apps can install the library with dotnet add package LithoSharp --version 4.0.0 and call it directly. See the full Quick Start for setup, Markdown authoring, and optional MDX components.

Docs sample, light theme Blog sample, dark theme
Docs with sidebar, article, and table of contents Blog with featured article and navigation

Inspect an OKF bundle

Create knowledge/index.md:

---
okf_version: "0.3"
---
# Knowledge

- [Build process](build.md)

Create knowledge/build.md:

---
type: Guide
title: Build process
---
# Build process

Run the documentation build before deployment.

Run the CLI from the directory containing knowledge:

.tools/lithosharp okf inspect --input knowledge --format json
.tools/lithosharp okf validate --input knowledge --format sarif

As in Quick Start, use .tools/lithosharp.exe on Windows. A bare 0.3 metadata path is not retried at the bundle root if it cannot be resolved from the containing document.

The bundle reader, CLI, site generation, and writer use the selected OKF version. Live editor diagnostics and reference edits are not authoritative for 0.3; validate the bundle with the CLI. OKF inspection and export do not run computations or verify runtime attestations. See the OKF guide for diagnostics, preservation, and version-specific behavior.

What gets checked?

Stage Example Boundary
C# compilation A required content field is missing (LSG006). Checks explicit inputs and requirements known to the generator.
Roslyn analyzer A statically known entry and route disagree (LSA1402). Does not prove values known only at runtime.
Generated output An internal link or heading target is missing (LSQ001 / LSQ002). Checks built artifacts, not unbuilt source or unchecked external sites.

The editor can report source syntax and support navigation without running your custom schema on every keystroke. A valid typed reference does not certify the final HTML. Try the typed content walkthrough or read the generated-output checks guide.

FAQ

Do I need Node.js, React, or a server runtime?

No for Markdown-only authoring. The CLI development server uses ASP.NET Core from the .NET SDK. Optional MDX 3 uses React and requires Node.js 24.13.0 plus an explicit worker restore. Production output is served by a static HTTP host. C# site code and MDX run as trusted build code, not in a sandbox. See MDX setup and known limitations.

How is Agent Ready publishing different from OKF?

Agent Ready publishing optionally exposes public Markdown with stable URLs and discovery links alongside the site. OKF support reads local knowledge bundles and their structured metadata, such as sources and verification records. Neither feature guarantees indexing or citations by a search engine or AI system.

Can I author in VS Code?

LithoSharp for VS Code supports Markdown/MDX diagnostics, heading navigation, builds, and site previews. See the extension guide.

Documentation and examples

Goal Start here
Choose packages and guides Documentation index
Configure Docs layout and themes Docs template, theme switching
Model content in C# Typed Markdown, typed YAML, source generators
Add React components MDX sample
Inspect builds and deployment changes Build graph, incremental builds, site quality
Test sites and check performance Testing, reference measurements
Upgrade an existing project 4.0 OKF migration, 3.0 migration guide, older upgrade history

MIT licensed. See LICENSE and third-party notices.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on LithoSharp:

Package Downloads
LithoSharp.Testing

Framework-independent assertions for generated LithoSharp documentation sites, routes and HTML snapshots.

LithoSharp.Images

Declared, cached responsive image transforms for LithoSharp documentation and static sites.

LithoSharp.Mdx

Optional MDX and React rendering for documentation managed with LithoSharp C# types and builds.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0 91 11/20/2026
3.1.0 169 11/17/2026
3.0.0 191 11/16/2026
2.2.0 640 11/9/2026
2.1.3 178 11/7/2026
2.1.2 139 10/31/2026
2.1.1 134 10/29/2026
2.1.0 133 10/28/2026
2.0.1 133 10/25/2026
2.0.0 328 10/17/2026
1.1.0 1,384 10/7/2026
1.0.0 844 9/15/2026
0.3.1 184 9/9/2026
0.3.0 172 9/8/2026
0.2.0 384 8/18/2026
0.1.0 379 6/30/2026