Docs redesign (#728)

* Adding a dark mode
* Adding reference for types to summary pages
* Adding API Reference
* Adding modifiers to methods/fields/etc
* Minimizing files input
* Caching a lot of the output pages
* Cache only for each execution
* Adding API references to existing docs
This commit is contained in:
Phil Scott
2022-02-14 12:44:25 -05:00
committed by GitHub
parent 74a2e10ff0
commit c2da268129
147 changed files with 4112 additions and 6897 deletions

View File

@ -1,9 +1,12 @@
Title: Creating Commands
Order: 6
Description: "How to create commands for *Spectre.Console.Cli*"
Reference:
- T:Spectre.Console.Cli.AsyncCommand`1
- T:Spectre.Console.Cli.Command`1
---
Commands in `Spectre.Console.Cli` are defined by creating a class that inherits from either `Spectre.Console.Cli.Command<TSettings>` or `Spectre.Console.Cli.AsyncCommand<TSettings>`. `Command<TSettings>` must implement an `Execute` method that returns an int where as `AsyncCommand<TSettings>` must implement `ExecuteAsync` returning `Task<int>`.
Commands in `Spectre.Console.Cli` are defined by creating a class that inherits from either `Command<TSettings>` or `AsyncCommand<TSettings>`. `Command<TSettings>` must implement an `Execute` method that returns an int where as `AsyncCommand<TSettings>` must implement `ExecuteAsync` returning `Task<int>`.
```csharp
public class HelloCommand : Command<HelloCommand.Settings>