Statiq Docs

Statiq Docs builds on Statiq Web by adding support for .NET API documentation and other functionality that's important for documentation web sites.

Quick Start

The easiest way to get started with Statiq Docs is to install the Statiq.Docs package into a .NET Core console application and use the bootstrapper to configure everything.

There's no statiq.exe. Unlike other static generators which ship as a self-contained executable, Statiq is a framework and as such it runs from within your own console application. This provides the greatest flexibility and extensibility and is one of the unique aspects of using Statiq.

Step 1: Install .NET Core

Statiq Docs consists of .NET Core libraries and installing the .NET Core SDK is the only prerequisite.

Step 2: Create a .NET Core Console Application

Create a new console application using the dotnet command-line interface:

dotnet new console --name MySite

Step 3: Install Statiq.Docs

In same folder as your newly created project (i.e. MySite).

dotnet add package Statiq.Docs --version x.y.z

Use whatever is the most recent version of Statiq.Docs. The --version flag is needed while the package is pre-release.

Step 4: Create a Bootstrapper

Creating a bootstrapper for Statiq Docs initializes everything you’ll need to generate your web site and API documentation. While you can certainly extend Statiq Docs with new pipelines or custom modules, you shouldn’t need to for most documentation sites. Add the following code in your Program.cs file:

using System.Threading.Tasks;
using Statiq.App;
using Statiq.Docs;

namespace MySite
{
  public class Program
  {
    public static async Task<int> Main(string[] args) =>
      await Bootstrapper
        .Factory
        .CreateDocs(args)
        .RunAsync();
  }
}

Alternatively if you're using .NET 6 and have <ImplicitUsings>enable</ImplicitUsings> in your project file, you can make use of top-level statements and implicit usings to simplify your Program.cs file and this is all that's needed:

return await Bootstrapper
  .Factory
  .CreateDocs(args)
  .RunAsync();

Step 5: Specify Your Code If Needed

By default, Statiq Docs is configured to look for source files in an src folder either one level up from your documentation site (I.e. if you've placed in a docs subfolder of your main repository) or directly under your documentation site. You can define alternate locations for your code, including directly pointing to assemblies, project files, or solution files.

Step 6: Add Some Content

Start adding content by creating Markdown files in your input folder (by default the input folder is located in your project root).

To get something started, you can add the following code as index.md file in your input folder.

Title: My First Statiq page
---
# Hello World!

Hello from my first Statiq page.

Step 7: Run it!

Let the magic happen:

dotnet run

This will create an output folder in your project folder by default (if it doesn't already exist) and generate static web site content based on what's in your input folder.

You can also preview the generated site:

dotnet run -- preview

This will generate content and serve your output folder over HTTP (i.e. http://localhost:5080). statiq preview

Next Steps

🎨 Download a theme like Docable.

📖 Read the guide to learn more about all the features of Statiq.

💬 Use the Discussions for assistance, questions, and general discussion about all Statiq projects.

🐞 File an issue if you find a bug or have a feature request related to Statiq Docs.

How It Works

Statiq is powerful because it combines a few simple building blocks that can be rearranged and used in limitless combinations. Think of it like LEGO® for static generation.

  • Content and data can come from a variety of sources.

  • Documents are created that each contain content or data and metadata.

  • The documents are processed by pipelines.

  • Each pipeline consists of one or more modules that manipulate the documents given to it by transforming, aggregating, filtering, or producing entirely new documents.

  • The final output of each pipeline is made available to other pipelines and may be written to output files or deployed to hosting services.

Statiq Docs includes pipelines, modules, and other functionality related to generating documentation sites out of the box.