MkDocsServeAsyncRunner.

ServeAsync(DirectoryPath, MkDocsServeAsyncSettings) Method

Summary

Run the builtin development server async.
Assembly
Cake.MkDocs.dll
Namespace
Cake.MkDocs.Serve
Containing Type
MkDocsServeAsyncRunner

Syntax

public Task ServeAsync(DirectoryPath projectDirectory, MkDocsServeAsyncSettings settings)

Examples

 var tokenSource = new CancellationTokenSource();
 var task = runner.Serve(new DirectoryPath("./project-with-docs-is-here"),
     new MkDocsServeSettings() { Token = tokenSource.Token });

 // Do something...

 tokenSource.Cancel();

 try
 {
     task.Wait();
 }
 catch (OperationCanceledException)
 {
     // Handle excecption
 }

Parameters

Name Type Description
projectDirectory DirectoryPath Project dir to serve.
settings MkDocsServeAsyncSettings The settings.

Return Value

Type Description
Task Long running task.