mirror of
				https://github.com/spectreconsole/spectre.console.git
				synced 2025-10-25 15:19:23 +00:00 
			
		
		
		
	Compare commits
	
		
			98 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 38d9386e00 | ||
|  | 7998ece6b6 | ||
|  | 1d8154f9b0 | ||
|  | 1f2629e2e1 | ||
|  | a6364e066b | ||
|  | fbe1d0b6f2 | ||
|  | eb4a7d3bf4 | ||
|  | 5e41a2f505 | ||
|  | 921d595269 | ||
|  | 899dd20b65 | ||
|  | 8ae3d258e4 | ||
|  | 974aa1afda | ||
|  | 66fc949e2a | ||
|  | d6cdd1fbda | ||
|  | bec3315d91 | ||
|  | d465d93a9b | ||
|  | 782a99d726 | ||
|  | b6be693007 | ||
|  | f9a85e017a | ||
|  | 36e5350968 | ||
|  | 3ac63d2670 | ||
|  | c2da268129 | ||
|  | 74a2e10ff0 | ||
|  | e8eb5b85b9 | ||
|  | 78958aae27 | ||
|  | a0e20f299c | ||
|  | ff4215f431 | ||
|  | f221c1f25c | ||
|  | 0b988ff65c | ||
|  | 9a6d8d92b4 | ||
|  | 52c1d9122b | ||
|  | eb6a9d8d04 | ||
|  | ec1188b837 | ||
|  | 1dbaf50935 | ||
|  | 523adc6c49 | ||
|  | bba5f0c5dc | ||
|  | 19ff48f4b8 | ||
|  | 8fcd2e59d6 | ||
|  | 8ce40bac3c | ||
|  | 8e762e4618 | ||
|  | 37f661a963 | ||
|  | 55633b59fa | ||
|  | 3f561e0902 | ||
|  | 461348f2fb | ||
|  | fd4b96944e | ||
|  | 2e5d18fa78 | ||
|  | 168f35202d | ||
|  | 225305f90e | ||
|  | 8fed3bc575 | ||
|  | 19eb273813 | ||
|  | 48df9cf68b | ||
|  | 2f6b4f53c4 | ||
|  | 21ac952307 | ||
|  | e86f9d3c5a | ||
|  | 9c9eb04f91 | ||
|  | ba4b7b97f8 | ||
|  | b738187b28 | ||
|  | b3ef7d4fa6 | ||
|  | c5c1852fc3 | ||
|  | 045d0922c8 | ||
|  | 949f35defd | ||
|  | f5a2735501 | ||
|  | d02c9e552e | ||
|  | a4ae36738b | ||
|  | 35d2750b68 | ||
|  | 4d2d927caa | ||
|  | 174d285035 | ||
|  | e8e92e7f44 | ||
|  | 3718502eee | ||
|  | 39cfc7a62f | ||
|  | 2e90ef28e4 | ||
|  | 2a3763cdc7 | ||
|  | e0395dfa2b | ||
|  | ca2e6ce0ad | ||
|  | fa15389158 | ||
|  | a5716a35e2 | ||
|  | 644fb76d61 | ||
|  | e3dfe23b59 | ||
|  | ad23855b0a | ||
|  | 64f444114a | ||
|  | b058c54f3c | ||
|  | 8cfe06e77a | ||
|  | 48d49d6e18 | ||
|  | 49e8a980a7 | ||
|  | d34012cad0 | ||
|  | c3510f3036 | ||
|  | 786b7670da | ||
|  | ffd24ec451 | ||
|  | e081593012 | ||
|  | bf95564ebb | ||
|  | 3c5b98123b | ||
|  | 7276e11ecc | ||
|  | d306ad82d1 | ||
|  | d96817dc9c | ||
|  | e169df6303 | ||
|  | 57731c0d55 | ||
|  | 170901f584 | ||
|  | c2b25eea8a | 
| @@ -30,6 +30,9 @@ trim_trailing_whitespace = false | |||||||
| end_of_line = lf | end_of_line = lf | ||||||
|  |  | ||||||
| [*.cs] | [*.cs] | ||||||
|  | # Prefer file scoped namespace declarations | ||||||
|  | csharp_style_namespace_declarations = file_scoped:warning | ||||||
|  |  | ||||||
| # Sort using and Import directives with System.* appearing first | # Sort using and Import directives with System.* appearing first | ||||||
| dotnet_sort_system_directives_first = true | dotnet_sort_system_directives_first = true | ||||||
| dotnet_separate_import_directive_groups = false | dotnet_separate_import_directive_groups = false | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								.git-blame-ignore-revs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								.git-blame-ignore-revs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | |||||||
|  | # Use file scoped namespace declarations | ||||||
|  | 7b2da0a4f63bf3ceab99d2c88535e74155f2b99c | ||||||
							
								
								
									
										24
									
								
								.github/workflows/ci.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								.github/workflows/ci.yaml
									
									
									
									
										vendored
									
									
								
							| @@ -18,16 +18,17 @@ jobs: | |||||||
|     - name: Checkout |     - name: Checkout | ||||||
|       uses: actions/checkout@master |       uses: actions/checkout@master | ||||||
|  |  | ||||||
|     - name: Setup dotnet |     - name: Setup .NET SDK | ||||||
|       uses: actions/setup-dotnet@v1 |       uses: actions/setup-dotnet@v1 | ||||||
|       with: |       with: | ||||||
|         dotnet-version: 6.0.x |         dotnet-version: |  | ||||||
|         include-prerelease: true |           5.0.301 | ||||||
|  |           6.0.100 | ||||||
|  |  | ||||||
|     - name: Setup Node.js |     - name: Setup Node.js | ||||||
|       uses: actions/setup-node@v2 |       uses: actions/setup-node@v2 | ||||||
|       with: |       with: | ||||||
|         node-version: '14' |         node-version: '16' | ||||||
|  |  | ||||||
|     - name: Cache dependencies |     - name: Cache dependencies | ||||||
|       uses: actions/cache@v2 |       uses: actions/cache@v2 | ||||||
| @@ -42,6 +43,7 @@ jobs: | |||||||
|         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
|       run: | |       run: | | ||||||
|         cd docs |         cd docs | ||||||
|  |         dotnet tool restore | ||||||
|         dotnet run --configuration Release |         dotnet run --configuration Release | ||||||
|  |  | ||||||
|     - name: Archive doc generation |     - name: Archive doc generation | ||||||
| @@ -75,21 +77,19 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           fetch-depth: 0 |           fetch-depth: 0 | ||||||
|  |  | ||||||
|       - name: Setup dotnet 3.1.402 |       - name: Setup .NET SDK | ||||||
|         uses: actions/setup-dotnet@v1 |         uses: actions/setup-dotnet@v1 | ||||||
|         with: |         with: | ||||||
|           dotnet-version: 3.1.402 |           dotnet-version: |  | ||||||
|  |             3.1.402 | ||||||
|       - name: Setup dotnet 5.0.301 |             5.0.301 | ||||||
|         uses: actions/setup-dotnet@v1 |             6.0.100 | ||||||
|         with: |  | ||||||
|           dotnet-version: 5.0.301 |  | ||||||
|  |  | ||||||
|       - name: Integration Tests |       - name: Integration Tests | ||||||
|         shell: bash |         shell: bash | ||||||
|         run: | |         run: | | ||||||
|           dotnet tool restore |           dotnet tool restore | ||||||
|           dotnet example --all |           dotnet example --all --skip live --skip livetable --skip prompt --skip screens | ||||||
|  |  | ||||||
|       - name: Build |       - name: Build | ||||||
|         shell: bash |         shell: bash | ||||||
|   | |||||||
							
								
								
									
										18
									
								
								.github/workflows/docs.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.github/workflows/docs.yaml
									
									
									
									
										vendored
									
									
								
							| @@ -5,6 +5,9 @@ on: | |||||||
|         paths: |         paths: | ||||||
|         - 'docs/**' |         - 'docs/**' | ||||||
|         - 'src/**' |         - 'src/**' | ||||||
|  |         - 'test/**' | ||||||
|  |         - 'examples/**' | ||||||
|  |         - '.github/**' | ||||||
|  |  | ||||||
| jobs: | jobs: | ||||||
|  |  | ||||||
| @@ -21,16 +24,17 @@ jobs: | |||||||
|       with: |       with: | ||||||
|         fetch-depth: 0 |         fetch-depth: 0 | ||||||
|  |  | ||||||
|     - name: Setup dotnet |     - name: Setup .NET SDK | ||||||
|       uses: actions/setup-dotnet@v1 |       uses: actions/setup-dotnet@v1 | ||||||
|       with: |       with: | ||||||
|         dotnet-version: 6.0.x |         dotnet-version: |  | ||||||
|         include-prerelease: true |           5.0.301 | ||||||
|  |           6.0.100 | ||||||
|  |  | ||||||
|     - name: Setup Node.js |     - name: Setup Node.js | ||||||
|       uses: actions/setup-node@v2 |       uses: actions/setup-node@v2 | ||||||
|       with: |       with: | ||||||
|         node-version: '14' |         node-version: '16' | ||||||
|  |  | ||||||
|     - name: Cache dependencies |     - name: Cache dependencies | ||||||
|       uses: actions/cache@v2 |       uses: actions/cache@v2 | ||||||
| @@ -43,7 +47,9 @@ jobs: | |||||||
|       shell: bash |       shell: bash | ||||||
|       env: |       env: | ||||||
|         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
|  |         NETLIFY_ACCESS_TOKEN: ${{ secrets.NETLIFY_ACCESS_TOKEN }} | ||||||
|  |         NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | ||||||
|       run: | |       run: | | ||||||
|         cd docs |         cd docs | ||||||
|         dotnet run --configuration Release |         dotnet tool restore | ||||||
|         dotnet run -- deploy |         dotnet run --configuration Release -- deploy | ||||||
|   | |||||||
							
								
								
									
										34
									
								
								.github/workflows/publish.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										34
									
								
								.github/workflows/publish.yaml
									
									
									
									
										vendored
									
									
								
							| @@ -6,8 +6,6 @@ on: | |||||||
|       - '*' |       - '*' | ||||||
|     branches: |     branches: | ||||||
|       - main |       - main | ||||||
|     paths: |  | ||||||
|       - 'src/**' |  | ||||||
|  |  | ||||||
| env: | env: | ||||||
|   DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true |   DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | ||||||
| @@ -26,11 +24,12 @@ jobs: | |||||||
|     - name: Checkout |     - name: Checkout | ||||||
|       uses: actions/checkout@master |       uses: actions/checkout@master | ||||||
|  |  | ||||||
|     - name: Setup dotnet |     - name: Setup .NET SDK | ||||||
|       uses: actions/setup-dotnet@v1 |       uses: actions/setup-dotnet@v1 | ||||||
|       with: |       with: | ||||||
|         dotnet-version: 6.0.x |         dotnet-version: |  | ||||||
|         include-prerelease: true |           5.0.301 | ||||||
|  |           6.0.100 | ||||||
|  |  | ||||||
|     - name: Build |     - name: Build | ||||||
|       shell: bash |       shell: bash | ||||||
| @@ -38,6 +37,7 @@ jobs: | |||||||
|         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
|       run: | |       run: | | ||||||
|         cd docs |         cd docs | ||||||
|  |         dotnet tool restore | ||||||
|         dotnet run --configuration Release |         dotnet run --configuration Release | ||||||
|  |  | ||||||
|   ################################################### |   ################################################### | ||||||
| @@ -65,15 +65,13 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           fetch-depth: 0 |           fetch-depth: 0 | ||||||
|  |  | ||||||
|       - name: Setup dotnet 3.1.402 |       - name: Setup .NET SDK | ||||||
|         uses: actions/setup-dotnet@v1 |         uses: actions/setup-dotnet@v1 | ||||||
|         with: |         with: | ||||||
|           dotnet-version: 3.1.402 |           dotnet-version: |  | ||||||
|  |             3.1.402 | ||||||
|       - name: Setup dotnet 5.0.301 |             5.0.301 | ||||||
|         uses: actions/setup-dotnet@v1 |             6.0.100 | ||||||
|         with: |  | ||||||
|           dotnet-version: 5.0.301 |  | ||||||
|  |  | ||||||
|       - name: Build |       - name: Build | ||||||
|         shell: bash |         shell: bash | ||||||
| @@ -96,15 +94,13 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           fetch-depth: 0 |           fetch-depth: 0 | ||||||
|  |  | ||||||
|       - name: Setup dotnet 3.1.402 |       - name: Setup .NET SDK | ||||||
|         uses: actions/setup-dotnet@v1 |         uses: actions/setup-dotnet@v1 | ||||||
|         with: |         with: | ||||||
|           dotnet-version: 3.1.402 |           dotnet-version: |  | ||||||
|  |             3.1.402 | ||||||
|       - name: Setup dotnet 5.0.301 |             5.0.301 | ||||||
|         uses: actions/setup-dotnet@v1 |             6.0.100 | ||||||
|         with: |  | ||||||
|           dotnet-version: 5.0.301 |  | ||||||
|  |  | ||||||
|       - name: Publish |       - name: Publish | ||||||
|         shell: bash |         shell: bash | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| MIT License | MIT License | ||||||
|  |  | ||||||
| Copyright (c) 2020 Patrik Svensson, Phil Scott | Copyright (c) 2020 Patrik Svensson, Phil Scott, Nils Andresen | ||||||
|  |  | ||||||
| Permission is hereby granted, free of charge, to any person obtaining a copy | Permission is hereby granted, free of charge, to any person obtaining a copy | ||||||
| of this software and associated documentation files (the "Software"), to deal | of this software and associated documentation files (the "Software"), to deal | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| # `Spectre.Console` | # `Spectre.Console` | ||||||
|  |  | ||||||
| _[](https://www.nuget.org/packages/spectre.console)_ | _[](https://www.nuget.org/packages/spectre.console)_ [](https://app.netlify.com/sites/spectreconsole/deploys) | ||||||
|  |  | ||||||
| A .NET 5/.NET Standard 2.0 library that makes it easier to create beautiful, cross platform, console applications.   | A .NET 5/.NET Standard 2.0 library that makes it easier to create beautiful, cross platform, console applications.   | ||||||
| It is heavily inspired by the excellent [Rich library](https://github.com/willmcgugan/rich)  | It is heavily inspired by the excellent [Rich library](https://github.com/willmcgugan/rich)  | ||||||
| @@ -85,7 +85,7 @@ I really appreciate it. | |||||||
|  |  | ||||||
| ## License | ## License | ||||||
|  |  | ||||||
| Copyright © Patrik Svensson, Phil Scott | Copyright © Patrik Svensson, Phil Scott, Nils Andresen | ||||||
|  |  | ||||||
| Spectre.Console is provided as-is under the MIT license. For more information see LICENSE. | Spectre.Console is provided as-is under the MIT license. For more information see LICENSE. | ||||||
|  |  | ||||||
|   | |||||||
| @@ -83,7 +83,7 @@ Eu estou muito agradecido. | |||||||
|  |  | ||||||
| ## Licença | ## Licença | ||||||
|  |  | ||||||
| Copyright © Patrik Svensson, Phil Scott | Copyright © Patrik Svensson, Phil Scott, Nils Andresen | ||||||
|  |  | ||||||
| Spectre.Console é fornecido no estado em que se encontra sob a licença do MIT. Para obter mais informações, consulte o arquivo [LICENSE](LICENSE.md). | Spectre.Console é fornecido no estado em que se encontra sob a licença do MIT. Para obter mais informações, consulte o arquivo [LICENSE](LICENSE.md). | ||||||
|  |  | ||||||
|   | |||||||
| @@ -77,7 +77,7 @@ https://spectreconsole.net/ | |||||||
|  |  | ||||||
| ## 开源许可 | ## 开源许可 | ||||||
|  |  | ||||||
| 版权所有 © Patrik Svensson, Phil Scott | 版权所有 © Patrik Svensson, Phil Scott, Nils Andresen | ||||||
|  |  | ||||||
| Spectre.Console 基于 MIT 协议提供。查看 LICENSE 文件了解更多信息。 | Spectre.Console 基于 MIT 协议提供。查看 LICENSE 文件了解更多信息。 | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										16
									
								
								build.cake
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								build.cake
									
									
									
									
									
								
							| @@ -14,7 +14,7 @@ Task("Build") | |||||||
|     .IsDependentOn("Clean") |     .IsDependentOn("Clean") | ||||||
|     .Does(context =>  |     .Does(context =>  | ||||||
| { | { | ||||||
|     DotNetCoreBuild("./src/Spectre.Console.sln", new DotNetCoreBuildSettings { |     DotNetBuild("./src/Spectre.Console.sln", new DotNetBuildSettings { | ||||||
|         Configuration = configuration, |         Configuration = configuration, | ||||||
|         NoIncremental = context.HasArgument("rebuild"), |         NoIncremental = context.HasArgument("rebuild"), | ||||||
|         MSBuildSettings = new DotNetCoreMSBuildSettings() |         MSBuildSettings = new DotNetCoreMSBuildSettings() | ||||||
| @@ -26,7 +26,7 @@ Task("Build-Analyzer") | |||||||
|     .IsDependentOn("Build") |     .IsDependentOn("Build") | ||||||
|     .Does(context =>  |     .Does(context =>  | ||||||
| { | { | ||||||
|     DotNetCoreBuild("./src/Spectre.Console.Analyzer.sln", new DotNetCoreBuildSettings { |     DotNetBuild("./src/Spectre.Console.Analyzer.sln", new DotNetBuildSettings { | ||||||
|         Configuration = configuration, |         Configuration = configuration, | ||||||
|         NoIncremental = context.HasArgument("rebuild"), |         NoIncremental = context.HasArgument("rebuild"), | ||||||
|         MSBuildSettings = new DotNetCoreMSBuildSettings() |         MSBuildSettings = new DotNetCoreMSBuildSettings() | ||||||
| @@ -38,7 +38,7 @@ Task("Build-Examples") | |||||||
|     .IsDependentOn("Build") |     .IsDependentOn("Build") | ||||||
|     .Does(context =>  |     .Does(context =>  | ||||||
| { | { | ||||||
|     DotNetCoreBuild("./examples/Examples.sln", new DotNetCoreBuildSettings { |     DotNetBuild("./examples/Examples.sln", new DotNetBuildSettings { | ||||||
|         Configuration = configuration, |         Configuration = configuration, | ||||||
|         NoIncremental = context.HasArgument("rebuild"), |         NoIncremental = context.HasArgument("rebuild"), | ||||||
|         MSBuildSettings = new DotNetCoreMSBuildSettings() |         MSBuildSettings = new DotNetCoreMSBuildSettings() | ||||||
| @@ -52,13 +52,13 @@ Task("Test") | |||||||
|     .IsDependentOn("Build-Examples") |     .IsDependentOn("Build-Examples") | ||||||
|     .Does(context =>  |     .Does(context =>  | ||||||
| { | { | ||||||
|     DotNetCoreTest("./test/Spectre.Console.Tests/Spectre.Console.Tests.csproj", new DotNetCoreTestSettings { |     DotNetTest("./test/Spectre.Console.Tests/Spectre.Console.Tests.csproj", new DotNetTestSettings { | ||||||
|         Configuration = configuration, |         Configuration = configuration, | ||||||
|         NoRestore = true, |         NoRestore = true, | ||||||
|         NoBuild = true, |         NoBuild = true, | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|     DotNetCoreTest("./test/Spectre.Console.Analyzer.Tests/Spectre.Console.Analyzer.Tests.csproj", new DotNetCoreTestSettings { |     DotNetTest("./test/Spectre.Console.Analyzer.Tests/Spectre.Console.Analyzer.Tests.csproj", new DotNetTestSettings { | ||||||
|         Configuration = configuration, |         Configuration = configuration, | ||||||
|         NoRestore = true, |         NoRestore = true, | ||||||
|         NoBuild = true, |         NoBuild = true, | ||||||
| @@ -69,7 +69,7 @@ Task("Package") | |||||||
|     .IsDependentOn("Test") |     .IsDependentOn("Test") | ||||||
|     .Does(context =>  |     .Does(context =>  | ||||||
| { | { | ||||||
|     context.DotNetCorePack($"./src/Spectre.Console.sln", new DotNetCorePackSettings { |     context.DotNetPack($"./src/Spectre.Console.sln", new DotNetPackSettings { | ||||||
|         Configuration = configuration, |         Configuration = configuration, | ||||||
|         NoRestore = true, |         NoRestore = true, | ||||||
|         NoBuild = true, |         NoBuild = true, | ||||||
| @@ -78,7 +78,7 @@ Task("Package") | |||||||
|             .TreatAllWarningsAs(MSBuildTreatAllWarningsAs.Error) |             .TreatAllWarningsAs(MSBuildTreatAllWarningsAs.Error) | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|     context.DotNetCorePack($"./src/Spectre.Console.Analyzer.sln", new DotNetCorePackSettings { |     context.DotNetPack($"./src/Spectre.Console.Analyzer.sln", new DotNetPackSettings { | ||||||
|         Configuration = configuration, |         Configuration = configuration, | ||||||
|         NoRestore = true, |         NoRestore = true, | ||||||
|         NoBuild = true, |         NoBuild = true, | ||||||
| @@ -134,7 +134,7 @@ Task("Publish-NuGet") | |||||||
|     foreach(var file in context.GetFiles("./.artifacts/*.nupkg"))  |     foreach(var file in context.GetFiles("./.artifacts/*.nupkg"))  | ||||||
|     { |     { | ||||||
|         context.Information("Publishing {0}...", file.GetFilename().FullPath); |         context.Information("Publishing {0}...", file.GetFilename().FullPath); | ||||||
|         DotNetCoreNuGetPush(file.FullPath, new DotNetCoreNuGetPushSettings |         DotNetNuGetPush(file.FullPath, new DotNetNuGetPushSettings | ||||||
|         { |         { | ||||||
|             Source = "https://api.nuget.org/v3/index.json", |             Source = "https://api.nuget.org/v3/index.json", | ||||||
|             ApiKey = apiKey, |             ApiKey = apiKey, | ||||||
|   | |||||||
| @@ -6,12 +6,13 @@ | |||||||
|     <RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory> |     <RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory> | ||||||
|     <DefaultItemExcludes>$(DefaultItemExcludes);output\**;.gitignore</DefaultItemExcludes> |     <DefaultItemExcludes>$(DefaultItemExcludes);output\**;.gitignore</DefaultItemExcludes> | ||||||
|     <NoWarn>MVC1000</NoWarn> |     <NoWarn>MVC1000</NoWarn> | ||||||
|     <MinVerSkip Condition="'$(Configuration)' == 'Debug'">true</MinVerSkip> |     <MinVerSkip>true</MinVerSkip> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|  |  | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <Compile Remove="input\**" /> |     <Compile Remove="input\**" /> | ||||||
|     <Compile Remove="sass\**" /> |     <Compile Remove="sass\**" /> | ||||||
|  |     <Compile Include="input\api\Sections\_ConstantValue.cshtml.cs" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|  |  | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
| @@ -32,10 +33,13 @@ | |||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|  |  | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <PackageReference Include="Microsoft.Playwright" Version="1.13.0-next-1" /> |     <PackageReference Include="Microsoft.Playwright" Version="1.19.0" /> | ||||||
|  |     <PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> | ||||||
|     <PackageReference Include="Statiq.Web" Version="1.0.0-beta.31" /> |     <PackageReference Include="Statiq.CodeAnalysis" Version="1.0.0-beta.58" /> | ||||||
|  |     <PackageReference Include="Statiq.Common" Version="1.0.0-beta.58" /> | ||||||
|  |     <PackageReference Include="Statiq.Web" Version="1.0.0-beta.44" /> | ||||||
|     <PackageReference Include="MinVer" PrivateAssets="All" Version="2.3.1" /> |     <PackageReference Include="MinVer" PrivateAssets="All" Version="2.3.1" /> | ||||||
|  |     <PackageReference Include="Statiq.Web.Netlify" Version="1.0.0-beta.44" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|  |  | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|   | |||||||
| @@ -1,7 +1,12 @@ | |||||||
|  | using System.Collections.Generic; | ||||||
| using System.Threading.Tasks; | using System.Threading.Tasks; | ||||||
|  | using Docs.Extensions; | ||||||
| using Docs.Shortcodes; | using Docs.Shortcodes; | ||||||
|  | using Docs.Utilities; | ||||||
|  | using Microsoft.Extensions.DependencyInjection; | ||||||
| using Statiq.App; | using Statiq.App; | ||||||
| using Statiq.Common; | using Statiq.Common; | ||||||
|  | using Statiq.Core; | ||||||
| using Statiq.Web; | using Statiq.Web; | ||||||
|  |  | ||||||
| namespace Docs | namespace Docs | ||||||
| @@ -14,18 +19,41 @@ namespace Docs | |||||||
|                 .AddSetting(Keys.Host, "spectreconsole.net") |                 .AddSetting(Keys.Host, "spectreconsole.net") | ||||||
|                 .AddSetting(Keys.LinksUseHttps, true) |                 .AddSetting(Keys.LinksUseHttps, true) | ||||||
|                 .AddSetting(Constants.EditLink, ConfigureEditLink()) |                 .AddSetting(Constants.EditLink, ConfigureEditLink()) | ||||||
|  |                 .AddSetting(Constants.SourceFiles, new List<string> | ||||||
|  |                 { | ||||||
|  |                     "../../src/Spectre.Console/**/{!bin,!obj,!packages,!*.Tests,}/**/*.cs", | ||||||
|  |                     "../../src/Spectre.Console.ImageSharp/**/{!bin,!obj,!packages,!*.Tests,}/**/*.cs" | ||||||
|  |                 }) | ||||||
|  |                 .AddSetting(Constants.ExampleSourceFiles, new List<string> | ||||||
|  |                     { | ||||||
|  |                         "../../examples/**/{!bin,!obj,!packages,!*.Tests,}/**/*.cs", | ||||||
|  |                     } | ||||||
|  |                 ) | ||||||
|  |                 .ConfigureServices(i => | ||||||
|  |                 { | ||||||
|  |                     i.AddSingleton(new TypeNameLinks()); | ||||||
|  |                 }) | ||||||
|                 .ConfigureSite("spectreconsole", "spectre.console", "main") |                 .ConfigureSite("spectreconsole", "spectre.console", "main") | ||||||
|                 .ConfigureDeployment(deployBranch: "docs") |  | ||||||
|                 .AddShortcode("Children", typeof(ChildrenShortcode)) |                 .AddShortcode("Children", typeof(ChildrenShortcode)) | ||||||
|                 .AddShortcode("ColorTable", typeof(ColorTableShortcode)) |                 .AddShortcode("ColorTable", typeof(ColorTableShortcode)) | ||||||
|                 .AddShortcode("EmojiTable", typeof(EmojiTableShortcode)) |                 .AddShortcode("EmojiTable", typeof(EmojiTableShortcode)) | ||||||
|                 .AddShortcode("Alert", typeof(AlertShortcode)) |                 .AddShortcode("Alert", typeof(AlertShortcode)) | ||||||
|  |                 .AddShortcode("Info", typeof(InfoShortcode)) | ||||||
|                 .AddShortcode("AsciiCast", typeof(AsciiCastShortcode)) |                 .AddShortcode("AsciiCast", typeof(AsciiCastShortcode)) | ||||||
|  |                 .AddShortcode("Example", typeof(ExampleSnippet)) | ||||||
|                 .AddPipelines() |                 .AddPipelines() | ||||||
|                 .AddProcess(ProcessTiming.Initialization, _ => new ProcessLauncher("npm", "install", "--audit", "false", "--fund", "false") |                 .BuildPipeline( | ||||||
|  | 			        "Bootstrap", | ||||||
|  | 			            builder => builder | ||||||
|  | 				            .WithInputReadFiles("../node_modules/asciinema-player/dist/bundle/asciinema-player.js") | ||||||
|  | 				            .WithProcessModules(new SetDestination(Config.FromDocument(doc => new NormalizedPath($"./assets/{doc.Source.FileName}")), true)) | ||||||
|  | 				    .WithOutputWriteFiles() | ||||||
|  |                 ) | ||||||
|  |                 .AddProcess(ProcessTiming.Initialization, _ => new ProcessLauncher("npm", "install --audit false --fund false --progress false") | ||||||
|                 { |                 { | ||||||
|                     LogErrors = false |                     LogErrors = false | ||||||
|                 }) |                 }) | ||||||
|  |                 .AddProcess(ProcessTiming.Initialization, _ => new ProcessLauncher("dotnet", "playwright install chromium")) | ||||||
|                 .AddProcess(ProcessTiming.BeforeDeployment, _ => new ProcessLauncher("npm", "run build:tailwind") |                 .AddProcess(ProcessTiming.BeforeDeployment, _ => new ProcessLauncher("npm", "run build:tailwind") | ||||||
|                 { |                 { | ||||||
|                     LogErrors = false |                     LogErrors = false | ||||||
|   | |||||||
| @@ -37,7 +37,7 @@ The documentation site has custom enhancements to Statiq located under the [./sr | |||||||
|  |  | ||||||
| MIT License | MIT License | ||||||
|  |  | ||||||
| Copyright (c) 2020 Patrik Svensson, Phil Scott | Copyright (c) 2020 Patrik Svensson, Phil Scott, Nils Andresen | ||||||
|  |  | ||||||
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										12
									
								
								docs/dotnet-tools.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								docs/dotnet-tools.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | |||||||
|  | { | ||||||
|  |   "version": 1, | ||||||
|  |   "isRoot": true, | ||||||
|  |   "tools": { | ||||||
|  |     "microsoft.playwright.cli": { | ||||||
|  |       "version": "1.2.2", | ||||||
|  |       "commands": [ | ||||||
|  |         "playwright" | ||||||
|  |       ] | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										72
									
								
								docs/input/DOC_TEMPLATE.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										72
									
								
								docs/input/DOC_TEMPLATE.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,72 @@ | |||||||
|  | Title: Short title of the Widget being documented. Typically the class name | ||||||
|  | Order: 99999 | ||||||
|  | Description: Description of the widget. This will be displayed on social card | ||||||
|  | Highlights: | ||||||
|  | - List features.  | ||||||
|  | - These will be used for the social card. | ||||||
|  | - Keep to three items. | ||||||
|  | Reference:  | ||||||
|  | - T:Spectre.Console.BarChart | ||||||
|  | Hidden: true     | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | <!--- | ||||||
|  | Documentation steps | ||||||
|  | 1. Edit front matter. Change all fields. Order dictates how it is sorted in the sidebar. Remove hidden attributes. | ||||||
|  |    Make sure to reference the appropriate XMLDOC page. You can find this by looking in the generated HTML | ||||||
|  |    of the API reference section. You can reference multiple items e.g. types, methods, etc that are related to the Widget.  | ||||||
|  | 2. Remove comments as you edit the fields. | ||||||
|  | 3. All widgets should have at minimum description and a usage section.  | ||||||
|  | --> | ||||||
|  |  | ||||||
|  | <!--- | ||||||
|  | Short description of the widget. Can be the same as the description above | ||||||
|  | --> | ||||||
|  |  | ||||||
|  |  | ||||||
|  | <!--- | ||||||
|  | Optional: Embed an asciicast. The cast parameter should be the base name of the cast. There are two files,  | ||||||
|  | one suffixed with -rich.cast and a second named -plain.cast. The cast attribute should be the name without | ||||||
|  | the suffix.  | ||||||
|  |  | ||||||
|  | To generate a new cast file, open the \resources\scripts\Generator\Generator.sln project and add a new sample in the | ||||||
|  | Commands/AsciiCast/Samples/ folder. If the widget is static such as a tree or a table, try and animate the widget | ||||||
|  | using the Live widget to change the content or styling.  | ||||||
|  |  | ||||||
|  | Running the generator project with by executing | ||||||
|  |  | ||||||
|  | dotnet run -- samples -l | ||||||
|  |  | ||||||
|  | and pick your sample. This will generate a new asciicast in the docs/input/assets/casts folder which can then be referenced via: | ||||||
|  |  | ||||||
|  | <?# AsciiCast cast="sample-name" /?> | ||||||
|  | --> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ## Usage | ||||||
|  |  | ||||||
|  | ### Basic usage | ||||||
|  |  | ||||||
|  | <!--- | ||||||
|  | Code sample for a default output of the widget. Code Samples can be embedded with a markdown code block or | ||||||
|  | linked to via the Example snipped. The example snippet takes the XMLDOC reference of the snippet from the Examples | ||||||
|  | project that you want to reference. | ||||||
|  |  | ||||||
|  | If linking to a method it will, by default, only include the method body. Include BodyOnly="false" to include | ||||||
|  | the entire method including the declaration. | ||||||
|  |  | ||||||
|  | <?# Example symbol="M:Prompt.Program.AskConfirmation" /?> | ||||||
|  | --> | ||||||
|  |  | ||||||
|  | ### Additional Styling | ||||||
|  |  | ||||||
|  | <!--- | ||||||
|  | Include additional examples of styling or functionality | ||||||
|  | --> | ||||||
|  |  | ||||||
|  | ### More styling and functions | ||||||
|  |  | ||||||
|  | <!--- | ||||||
|  | Include additional examples of styling or functionality | ||||||
|  | --> | ||||||
| @@ -1,3 +1,3 @@ | |||||||
| @{ | @{ | ||||||
|     Layout = @"/_layout.cshtml"; |     Layout = @"_layout.cshtml"; | ||||||
| } | } | ||||||
| @@ -1,137 +1,266 @@ | |||||||
|  | @using Docs.Extensions | ||||||
|  | @using Statiq.CodeAnalysis | ||||||
| <!DOCTYPE html> | <!DOCTYPE html> | ||||||
| <html lang="en"> | <html lang="en"> | ||||||
|     <head> | <head> | ||||||
|         <meta charset="utf-8"> |     <meta charset="utf-8"> | ||||||
|         <meta http-equiv="X-UA-Compatible" content="IE=Edge"> |     <meta http-equiv="X-UA-Compatible" content="IE=Edge"> | ||||||
|         <meta name="viewport" content="width=device-width, initial-scale=1.0"> |     <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||||||
|  |  | ||||||
|         <link href="@Context.GetLink("/assets/styles.css")" rel="stylesheet" /> |     <link href="@Context.GetLink("/assets/styles.css")" rel="stylesheet"/> | ||||||
|         <link rel="preconnect" href="https://fonts.gstatic.com" /> |     <link rel="preconnect" href="https://fonts.gstatic.com"/> | ||||||
|         <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;700&display=swap" rel="stylesheet" /> |     <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;700&display=swap" rel="stylesheet"/> | ||||||
|  |  | ||||||
|         <link rel="apple-touch-icon" sizes="180x180" href="@Context.GetLink("/assets/favicons/apple-touch-icon.png")"> |     <link rel="apple-touch-icon" sizes="180x180" href="@Context.GetLink("/assets/favicons/apple-touch-icon.png")"> | ||||||
|         <link rel="icon" type="image/png" sizes="32x32" href="@Context.GetLink("/assets/favicons/favicon-32x32.png")"> |     <link rel="icon" type="image/png" sizes="32x32" href="@Context.GetLink("/assets/favicons/favicon-32x32.png")"> | ||||||
|         <link rel="icon" type="image/png" sizes="16x16" href="@Context.GetLink("/assets/favicons/favicon-16x16.png")"> |     <link rel="icon" type="image/png" sizes="16x16" href="@Context.GetLink("/assets/favicons/favicon-16x16.png")"> | ||||||
|  |  | ||||||
|         @{ |     @{ | ||||||
|             string title = Document.ContainsKey(Keys.Title) ? $"Spectre.Console - {Document.GetString(Keys.Title)}" : "Spectre.Console"; |         string title = Document.ContainsKey(Keys.Title) ? $"Spectre.Console - {Document.GetString(Keys.Title)}" : "Spectre.Console"; | ||||||
|             string description = Document.ContainsKey(Constants.Description) ? Document.GetString(Constants.Description) : "Spectre.Console is a .NET Standard 2.0 library that makes it easier to create beautiful console applications"; |         string description = Document.ContainsKey(Constants.Description) ? Document.GetString(Constants.Description) : "Spectre.Console is a .NET Standard 2.0 library that makes it easier to create beautiful console applications"; | ||||||
|             var card = Outputs.FirstOrDefault(i => i.GetString("DocId") == Model.Id.ToString()); |         var card = Context.FindCard(Model.Id); | ||||||
|             var urlBase = $"https://{Document.GetString(Keys.Host)}/"; |         var urlBase = $"https://{Document.GetString(Keys.Host)}/"; | ||||||
|         } |     } | ||||||
|         <title>@title</title> |     <title>@title</title> | ||||||
|         <meta name="description" content="@description" /> |     <meta name="description" content="@description"/> | ||||||
|  |     <meta name="xref" content="@HtmlEncoder.Encode(Document.GetString(WebKeys.Xref))" /> | ||||||
|         @if(card != null){ |  | ||||||
|             <meta name="twitter:card" content="summary_large_image" /> |  | ||||||
|             <meta name="og:title" content="@title" /> |  | ||||||
|             <meta name="og:description" content="@description" /> |  | ||||||
|             <meta name="og:image" content="@(urlBase + card.Destination)" /> |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|     </head> |  | ||||||
|     <body class="antialiased text-gray-600 min-h-full flex flex-col  bg-gray-50"> |  | ||||||
|         <header class="flex-none text-sm font-medium bg-gradient-to-b from-gray-200 to-gray-100 ring-1 ring-gray-900 ring-opacity-5 shadow py-2 md:py-4"> |  | ||||||
|             <nav class="flex flex-row container mx-auto items-center"> |  | ||||||
|                 <a class="flex flex-row  items-center" href="@Context.GetLink("/")"> |  | ||||||
|                     <img id="logo" class="w-auto h-10 md:h-12" height="48" width="48" src="@Context.GetLink("/assets/logo.svg")" alt="Spectre.Console"> |  | ||||||
|                     <span class="text-lg md:text-2xl font-light ml-2 lg:ml-4 font-mono tracking-tighter">Spectre.Console</span> |  | ||||||
|                 </a> |  | ||||||
|                 <div class="ml-auto"> |  | ||||||
|                     <ul class="flex flex-row"> |  | ||||||
|                         <li> |  | ||||||
|                             <a class="flex flex-row items-center text-red-700" href="https://github.com/sponsors/patriksvensson"> |  | ||||||
|                                 <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor"> |  | ||||||
|                                     <title>Sponsor</title> |  | ||||||
|                                     <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" /> |  | ||||||
|                                 </svg> |  | ||||||
|                                 <span class="hidden sm:block">Sponsor</span> |  | ||||||
|                             </a> |  | ||||||
|                         </li> |  | ||||||
|                         <li class="ml-4"> |  | ||||||
|                             <a class="flex flex-row items-center text-gray-600" href="https://github.com/spectreconsole/spectre.console"> |  | ||||||
|                                 <svg role="img" class="h-6 w-6 mr-2"  stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> |  | ||||||
|                                     <title>GitHub icon</title> |  | ||||||
|                                     <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg> |  | ||||||
|                                 <span class="hidden sm:block">GitHub</span> |  | ||||||
|                             </a> |  | ||||||
|                         </li> |  | ||||||
|                     </ul> |  | ||||||
|                 </div> |  | ||||||
|             </nav> |  | ||||||
|         </header> |  | ||||||
|         <main class="container mx-auto pt-4 md:pt-8 w-full"> |  | ||||||
|             <div class="flex flex-col-reverse lg:flex-row"> |  | ||||||
|                 <nav class="flex-none font-light text-sm xl:text-base sm:mr-16 mt-8 pt-6 lg:mt-0 lg:pt-0 border-t border-gray-300 lg:border-t-0"> |  | ||||||
|                 @{ |  | ||||||
|                     IDocument root = OutputPages["index.html"].First(); |  | ||||||
|                     <div class="text-xl @(Document.IdEquals(root) ? "font-bold" : null)"> |  | ||||||
|                             @if(root.ShowLink()) |  | ||||||
|                             { |  | ||||||
|                                 @Html.DocumentLink(root) |  | ||||||
|                             } |  | ||||||
|                             else |  | ||||||
|                             { |  | ||||||
|                                 @root.GetTitle() |  | ||||||
|                             } |  | ||||||
|                     </div> |  | ||||||
|  |  | ||||||
|                     @foreach (IDocument document in OutputPages.GetChildrenOf(root).OrderBy(i => i.GetInt("Order")).OnlyVisible()) |  | ||||||
|                     { |  | ||||||
|                         if(string.IsNullOrWhiteSpace(document.GetTitle())) |  | ||||||
|                         { |  | ||||||
|                             continue; |  | ||||||
|                         } |  | ||||||
|  |  | ||||||
|                         DocumentList<IDocument> documentChildren = OutputPages.GetChildrenOf(document); |  | ||||||
|                         <div class="text-blue-700 mt-4"> |  | ||||||
|                             @if(document.ShowLink()) |  | ||||||
|                             { |  | ||||||
|                                 @Html.DocumentLink(document) |  | ||||||
|                             } |  | ||||||
|                             else |  | ||||||
|                             { |  | ||||||
|                                 @document.GetTitle() |  | ||||||
|                             } |  | ||||||
|                         </div> |  | ||||||
|  |  | ||||||
|                         @if (documentChildren.OnlyVisible().Any()) |  | ||||||
|                         { |  | ||||||
|                             <div class="ml-2 flex flex-row flex-wrap lg:flex-col border-separate"> |  | ||||||
|                                 @foreach (IDocument child in documentChildren.OnlyVisible()) |  | ||||||
|                                 { |  | ||||||
|                                     <div class="mt-2 mr-4 @(Document.IdEquals(child) ? "font-bold" : null)"> |  | ||||||
|                                         @Html.DocumentLink(child) |  | ||||||
|                                     </div> |  | ||||||
|                                 } |  | ||||||
|                             </div> |  | ||||||
|                         } |  | ||||||
|                     } |  | ||||||
|                 } |  | ||||||
|                 </nav> |  | ||||||
|                 <article class="flex-1 min-w-0"> |  | ||||||
|                     <header class="text-gray-800 mb-4"> |  | ||||||
|                         <h1 class="text-4xl font-extrabold">@(Document.GetString(Keys.Title) ?? Document.GetTitle())</h1> |  | ||||||
|                         @RenderSection("subheading", required: false) |  | ||||||
|                     </header> |  | ||||||
|                     <div class="prose max-w-none prose-sm lg:prose lg:max-w-none 2xl:prose-xl 2xl:max-w-none text-gray-700 font-light"> |  | ||||||
|                         @RenderBody() |  | ||||||
|                     </div> |  | ||||||
|                 </article> |  | ||||||
|             </div> |  | ||||||
|         </main> |  | ||||||
|  |  | ||||||
|         <footer class="py-4 md:py-8 mt-8 bg-gray-100 text-sm border-t border-gray-200"> |  | ||||||
|             <div class="container"> |  | ||||||
|                 <div class="flex flex-row"> |  | ||||||
|                     <span>© @DateTime.Today.Year Patrik Svensson, Phil Scott</span> |  | ||||||
|                     <span class="ml-auto">@VersionUtilities.GetVersion()</span> |  | ||||||
|                 </div> |  | ||||||
|             </div> |  | ||||||
|         </footer> |  | ||||||
|  |  | ||||||
|  |     @if (card != null) | ||||||
|  |     { | ||||||
|  |         <meta name="twitter:card" content="summary_large_image"/> | ||||||
|  |         <meta name="og:title" content="@title"/> | ||||||
|  |         <meta name="og:description" content="@description"/> | ||||||
|  |         <meta name="og:image" content="@(urlBase + card)"/> | ||||||
|  |     } | ||||||
|  |  | ||||||
|     <script> |     <script> | ||||||
|  |         if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) { | ||||||
|  |             document.documentElement.classList.add('dark'); | ||||||
|  |         } else { | ||||||
|  |             document.documentElement.classList.remove('dark'); | ||||||
|  |         } | ||||||
|  |     </script> | ||||||
|  |  | ||||||
|  | </head> | ||||||
|  | <body class="antialiased text-slate-800 dark:text-slate-200 bg-slate-100 dark:bg-slate-800 transition-colors min-h-full flex flex-col"> | ||||||
|  | <header class="flex-none sticky top-0 z-40 text-sm font-medium bg-slate-200 backdrop-blur  dark:bg-slate-800 ring-1 ring-slate-900 dark:ring-slate-700 ring-opacity-5 shadow-lg py-2 md:py-4"> | ||||||
|  |     <nav class="flex flex-row container mx-auto items-center"> | ||||||
|  |         <a class="flex flex-row  items-center" href="@Context.GetLink("/")"> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |             <svg xmlns="http://www.w3.org/2000/svg" | ||||||
|  |                  id="logo" class="w-auto h-10 md:h-12 fill-slate-700 dark:fill-slate-400 dark:stroke-slate-900" height="48" width="48" viewBox="0 0 1270.000000 1270.000000" | ||||||
|  |                  preserveAspectRatio="xMidYMid meet"> | ||||||
|  |                 <metadata> | ||||||
|  |                     Created by potrace 1.16, written by Peter Selinger 2001-2019 | ||||||
|  |                 </metadata> | ||||||
|  |                 <g transform="translate(0.000000,1270.000000) scale(0.100000,-0.100000)"> | ||||||
|  |                     <path d="M799 10610 c-199 -48 -354 -191 -414 -383 l-25 -78 0 -3084 0 -3084 | ||||||
|  | 25 -79 c45 -141 155 -270 289 -335 124 -61 -80 -57 2819 -57 l2646 0 5 -43 c3 | ||||||
|  | -23 8 -71 11 -105 13 -137 88 -334 179 -471 57 -85 187 -219 247 -254 25 -15 | ||||||
|  | 76 -34 112 -43 87 -22 163 -7 246 46 120 78 195 211 234 411 l23 124 14 -55 | ||||||
|  | c63 -263 172 -511 326 -741 94 -142 229 -291 313 -348 272 -185 583 -197 750 | ||||||
|  | -30 66 67 84 109 89 215 4 90 4 91 -51 230 -108 276 -137 477 -122 868 l7 196 | ||||||
|  | 77 0 c55 0 118 -11 229 -39 l154 -38 50 -84 c103 -172 221 -427 277 -599 38 | ||||||
|  | -120 70 -274 86 -412 8 -75 21 -155 29 -178 37 -106 117 -199 220 -253 51 -26 | ||||||
|  | 202 -35 283 -17 83 18 193 97 268 192 157 199 256 485 286 825 11 122 6 524 | ||||||
|  | -7 583 -5 24 -1 26 62 43 64 16 67 16 80 0 39 -50 109 -215 149 -351 25 -85 | ||||||
|  | 55 -174 67 -199 73 -156 261 -206 441 -117 65 32 110 70 159 135 128 169 178 | ||||||
|  | 414 157 764 -8 143 -38 350 -55 376 -2 4 7 25 22 46 77 112 168 344 200 504 | ||||||
|  | l16 86 87 28 c188 60 391 170 498 269 132 122 183 230 183 383 0 71 -5 98 -24 | ||||||
|  | 138 -24 52 -82 112 -138 141 -52 28 -205 30 -378 5 -80 -11 -179 -23 -220 -27 | ||||||
|  | l-75 -6 -29 56 c-33 65 -137 182 -211 236 -75 55 -156 94 -382 181 -110 43 | ||||||
|  | -221 87 -245 100 -54 27 -92 69 -125 138 -25 52 -26 59 -20 180 4 69 16 200 | ||||||
|  | 26 291 52 430 53 809 5 1170 -54 405 -249 740 -569 979 -136 102 -297 190 | ||||||
|  | -419 231 l-36 12 0 433 c0 433 0 434 -25 512 -52 167 -171 292 -341 360 l-69 | ||||||
|  | 28 -4215 2 c-2318 0 -4231 -3 -4251 -7z m8363 -1476 c417 -53 735 -193 962 | ||||||
|  | -423 98 -98 155 -175 210 -282 84 -160 117 -292 141 -559 28 -313 17 -684 -30 | ||||||
|  | -1025 -9 -60 -18 -164 -22 -230 -10 -208 22 -314 136 -452 76 -91 124 -118 | ||||||
|  | 391 -218 307 -116 377 -155 450 -249 23 -31 41 -58 39 -60 -2 -2 -47 8 -99 21 | ||||||
|  | -131 35 -268 36 -360 3 -132 -47 -248 -116 -364 -218 -163 -143 -516 -488 | ||||||
|  | -703 -687 -350 -372 -504 -514 -701 -644 -348 -231 -878 -408 -1322 -442 -409 | ||||||
|  | -31 -796 45 -1059 208 -111 69 -249 210 -292 298 -32 65 -34 76 -33 165 1 104 | ||||||
|  | 23 178 85 287 75 131 137 194 430 441 181 152 251 295 250 511 -1 152 -16 223 | ||||||
|  | -117 560 -35 117 -61 217 -58 222 3 5 20 9 38 9 55 0 217 31 261 50 53 23 103 | ||||||
|  | 73 132 131 43 88 56 187 59 437 2 266 -1 258 91 292 108 40 254 21 330 -45 35 | ||||||
|  | -30 35 -32 53 -170 41 -311 106 -484 206 -546 48 -29 168 -48 381 -59 188 -10 | ||||||
|  | 432 -1 548 20 76 14 206 56 266 86 64 32 122 101 144 170 15 49 17 82 12 253 | ||||||
|  | -5 198 -27 398 -52 482 -42 146 -125 221 -290 265 -57 15 -108 19 -268 19 | ||||||
|  | l-197 0 0 45 c0 120 -37 255 -82 300 -76 77 -210 5 -291 -157 -31 -60 -67 | ||||||
|  | -184 -67 -229 0 -27 -6 -34 -41 -50 -65 -29 -159 -98 -195 -144 -34 -43 -67 | ||||||
|  | -119 -79 -181 l-6 -35 -57 28 c-114 57 -270 58 -379 2 -61 -31 -70 -21 -49 54 | ||||||
|  | 33 118 16 442 -29 536 -38 79 -114 84 -188 12 -68 -66 -136 -230 -137 -330 l0 | ||||||
|  | -29 -61 7 c-34 3 -93 6 -131 6 l-69 0 6 48 c14 97 56 282 84 368 155 475 486 | ||||||
|  | 821 963 1008 108 42 308 94 430 110 62 9 124 17 138 20 76 11 479 5 592 -10z | ||||||
|  | m-7029 -78 c18 -8 261 -243 569 -552 582 -584 560 -559 543 -651 -6 -33 -69 | ||||||
|  | -101 -523 -557 -553 -554 -564 -564 -644 -551 -89 15 -151 110 -128 198 10 37 | ||||||
|  | 65 95 463 495 l452 452 -472 473 c-414 414 -472 477 -478 510 -25 132 98 235 | ||||||
|  | 218 183z m7169 -1405 c164 -57 201 -136 234 -502 37 -414 9 -486 -212 -558 | ||||||
|  | -155 -50 -298 -64 -579 -57 -249 6 -398 23 -439 50 -95 62 -177 346 -180 621 | ||||||
|  | -1 135 0 142 28 203 50 109 148 179 304 218 149 37 329 53 567 50 191 -2 216 | ||||||
|  | -4 277 -25z m-2002 -174 c95 -34 118 -52 152 -114 52 -94 63 -159 62 -368 -1 | ||||||
|  | -358 -44 -479 -187 -520 -146 -42 -612 -65 -727 -36 -153 38 -196 98 -226 316 | ||||||
|  | -16 120 -31 487 -21 527 9 35 89 121 140 151 99 58 228 76 522 73 200 -2 214 | ||||||
|  | -3 285 -29z m-1604 -443 c45 -33 67 -70 71 -121 5 -59 -25 -117 -77 -147 -35 | ||||||
|  | -21 -47 -21 -980 -24 -520 -2 -964 0 -988 3 -57 8 -116 60 -130 115 -19 75 12 | ||||||
|  | 146 78 182 34 17 75 18 1017 16 974 -3 982 -3 1009 -24z m5329 -2140 c66 -7 | ||||||
|  | 173 -14 237 -14 103 0 146 5 247 26 24 5 24 5 18 -64 -15 -159 -89 -371 -180 | ||||||
|  | -515 l-43 -68 -57 113 c-72 145 -160 261 -318 422 l-126 128 51 -7 c28 -3 105 | ||||||
|  | -13 171 -21z m-812 -652 c53 -41 140 -115 193 -165 96 -91 224 -231 224 -245 | ||||||
|  | 0 -5 -30 -18 -67 -30 -79 -25 -305 -84 -308 -80 -1 2 -12 53 -24 113 -28 135 | ||||||
|  | -70 268 -127 402 -24 57 -44 106 -44 109 0 9 43 -20 153 -104z m-1173 -560 | ||||||
|  | c-9 -4 -271 61 -315 78 -29 11 -28 12 79 55 59 24 111 46 114 49 3 3 33 -36 | ||||||
|  | 67 -87 34 -50 59 -93 55 -95z"/> | ||||||
|  |                 </g> | ||||||
|  |             </svg> | ||||||
|  |             <span class="text-lg md:text-2xl font-light ml-2 lg:ml-4 font-mono tracking-tighter">Spectre.Console</span> | ||||||
|  |         </a> | ||||||
|  |         <div class="ml-auto"> | ||||||
|  |             <ul class="flex flex-row"> | ||||||
|  |                 <li> | ||||||
|  |                     <button aria-label="Toggle Dark Mode" class="mr-4 dark:text-yellow-300 stroke-1 opacity-80" onclick="swapTheme()"> | ||||||
|  |                         <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> | ||||||
|  |                             <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"/> | ||||||
|  |                         </svg> | ||||||
|  |                     </button> | ||||||
|  |                 </li> | ||||||
|  |                 <li> | ||||||
|  |                     <a class="flex flex-row items-center text-rose-700 dark:text-rose-500" href="https://github.com/sponsors/patriksvensson"> | ||||||
|  |                         <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor"> | ||||||
|  |                             <title>Sponsor</title> | ||||||
|  |                             <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"/> | ||||||
|  |                         </svg> | ||||||
|  |                         <span class="hidden sm:block">Sponsor</span> | ||||||
|  |                     </a> | ||||||
|  |                 </li> | ||||||
|  |                 <li class="ml-4"> | ||||||
|  |                     <a class="flex flex-row items-center text-gray-600 fill-slate-200 stroke-slate-800 fill-slate-900 dark:stroke-slate-500 dark:fill-slate-300 dark:text-slate-300" href="https://github.com/spectreconsole/spectre.console"> | ||||||
|  |                         <svg role="img" class="h-6 w-6 mr-1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> | ||||||
|  |                             <title>GitHub icon</title> | ||||||
|  |                             <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/> | ||||||
|  |                         </svg> | ||||||
|  |                         <span class="hidden sm:block">GitHub</span> | ||||||
|  |                     </a> | ||||||
|  |                 </li> | ||||||
|  |  | ||||||
|  |             </ul> | ||||||
|  |         </div> | ||||||
|  |     </nav> | ||||||
|  | </header> | ||||||
|  | <main class="container mx-auto pt-8 w-full"> | ||||||
|  |     <div class="flex flex-col-reverse lg:flex-row"> | ||||||
|  |         <nav class="flex-none font-light text-sm xl:text-base sm:mr-16 mt-8 pt-6 lg:mt-0 lg:pt-0 lg:pb-10  border-t border-gray-300 lg:border-t-0"> | ||||||
|  |             @{ | ||||||
|  |                 var sidebar = Context.GetSidebar(); | ||||||
|  |                 var root = sidebar.Node; | ||||||
|  |                 <div class="text-xl @(Document.IdEquals(root) ? "font-bold" : null)"> | ||||||
|  |                     @if (sidebar.ShowLink) | ||||||
|  |                     { | ||||||
|  |                         @Html.DocumentLink(root) | ||||||
|  |                     } | ||||||
|  |                     else | ||||||
|  |                     { | ||||||
|  |                         @sidebar.Title; | ||||||
|  |                     } | ||||||
|  |                 </div> | ||||||
|  |  | ||||||
|  |                 @foreach (var sidebarItem in sidebar.Leafs) | ||||||
|  |                 { | ||||||
|  |                     var document = sidebarItem.Node; | ||||||
|  |                     if (string.IsNullOrWhiteSpace(sidebarItem.Title)) | ||||||
|  |                     { | ||||||
|  |                         continue; | ||||||
|  |                     } | ||||||
|  |  | ||||||
|  |                     var documentChildren = sidebarItem.Leafs; | ||||||
|  |                     <div class="text-teal-800 font-medium dark:text-teal-400 mt-4"> | ||||||
|  |                         @if (sidebarItem.ShowLink) | ||||||
|  |                         { | ||||||
|  |                             @Html.DocumentLink(document) | ||||||
|  |                         } | ||||||
|  |                         else | ||||||
|  |                         { | ||||||
|  |                             @sidebarItem.Title; | ||||||
|  |                         } | ||||||
|  |                     </div> | ||||||
|  |  | ||||||
|  |                     @if (documentChildren.Any()) | ||||||
|  |                     { | ||||||
|  |                         <div class="ml-2 flex flex-row flex-wrap lg:flex-col border-separate"> | ||||||
|  |                             @foreach (var childItem in documentChildren) | ||||||
|  |                             { | ||||||
|  |                                 var child = childItem.Node; | ||||||
|  |                                 <div class="mt-2 mr-4 @(Document.IdEquals(child) ? "font-bold" : null)"> | ||||||
|  |                                     @Html.DocumentLink(child) | ||||||
|  |                                 </div> | ||||||
|  |                             } | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         </nav> | ||||||
|  |         <article class="flex-1 min-w-0"> | ||||||
|  |             <header class="text-slate-900 dark:text-slate-50 mb-4"> | ||||||
|  |                 @RenderSection("header", required: false) | ||||||
|  |                 @if (!IsSectionDefined("header")) | ||||||
|  |                 { | ||||||
|  |                     <h1 class="text-2xl md:text-4xl font-extrabold">@(Document.GetString(Keys.Title) ?? Document.GetTitle())</h1> | ||||||
|  |                 } | ||||||
|  |  | ||||||
|  |                 @RenderSection("subheading", required: false) | ||||||
|  |             </header> | ||||||
|  |             <div class="prose prose-sm md:prose-base prose-slate dark:prose-invert max-w-full font-light lg:leading-loose"> | ||||||
|  |                 @RenderBody() | ||||||
|  |  | ||||||
|  |                 @{ | ||||||
|  |                     var referenceLinks = Model.GetList<string>(Constants.ApiReference); | ||||||
|  |                     if (referenceLinks != null) | ||||||
|  |                     { | ||||||
|  |                         <h3>References</h3> | ||||||
|  |                         <ul> | ||||||
|  |                             @foreach (var link in referenceLinks) | ||||||
|  |                             { | ||||||
|  |                                 if (Context.TryGetXrefDocument(link, out var refDoc, out string error)) | ||||||
|  |                                 { | ||||||
|  |                                     <li> | ||||||
|  |                                         @{ | ||||||
|  |                                             var kind = refDoc.GetString(CodeAnalysisKeys.SpecificKind); | ||||||
|  |                                             var prefix = string.Empty; | ||||||
|  |                                             var containingType = @refDoc.GetDocument(CodeAnalysisKeys.ContainingType); | ||||||
|  |                                             if (containingType != null) | ||||||
|  |                                             { | ||||||
|  |                                                 prefix = containingType.GetString(CodeAnalysisKeys.DisplayName) + "."; | ||||||
|  |                                             } | ||||||
|  |                                         } | ||||||
|  |  | ||||||
|  |                                         @if (!string.IsNullOrWhiteSpace(prefix)){ <span class="text-slate-600 dark:text-slate-400">@prefix</span>}@Html.DocumentLink(refDoc, refDoc.GetString(CodeAnalysisKeys.DisplayName) ?? refDoc.GetTitle()) <span class="ml-4 uppercase text-xs text-slate-700 dark:text-slate-400">@kind</span> | ||||||
|  |                                     </li> | ||||||
|  |                                 } | ||||||
|  |                                 else | ||||||
|  |                                 { | ||||||
|  |                                     Context.LogWarning(Model, $"Error finding xref for {link} - {error}"); | ||||||
|  |                                 } | ||||||
|  |                             } | ||||||
|  |                         </ul> | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  |             </div> | ||||||
|  |         </article> | ||||||
|  |     </div> | ||||||
|  | </main> | ||||||
|  |  | ||||||
|  | <footer class="py-4 md:py-8 mt-8 bg-gray-100 dark:bg-slate-800 text-sm border-t border-gray-200 dark:border-slate-700"> | ||||||
|  |     <div class="container"> | ||||||
|  |         <div class="flex flex-row"> | ||||||
|  |             <span>© @DateTime.Today.Year Patrik Svensson, Phil Scott, Nils Andresen</span> | ||||||
|  |             <span class="ml-auto">Powered by <a href="https://www.netlify.com/">Netlify</a></span> | ||||||
|  |             <span class="ml-auto">@VersionUtilities.GetVersion()</span> | ||||||
|  |         </div> | ||||||
|  |     </div> | ||||||
|  | </footer> | ||||||
|  |  | ||||||
|  |  | ||||||
|  | <script> | ||||||
|         // adapted from https://www.w3schools.com/howto/howto_js_filter_table.asp |         // adapted from https://www.w3schools.com/howto/howto_js_filter_table.asp | ||||||
|         function search(input, searchTarget, columnIndex) { |         function search(input, searchTarget, columnIndex) { | ||||||
|             // Declare variables |             // Declare variables | ||||||
| @@ -154,8 +283,25 @@ | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     </script> |     </script> | ||||||
|         <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/prism.min.js" integrity="sha512-YBk7HhgDZvBxmtOfUdvX0z8IH2d10Hp3aEygaMNhtF8fSOvBZ16D/1bXZTJV6ndk/L/DlXxYStP8jrF77v2MIg==" crossorigin="anonymous"></script> | <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/prism.min.js" integrity="sha512-YBk7HhgDZvBxmtOfUdvX0z8IH2d10Hp3aEygaMNhtF8fSOvBZ16D/1bXZTJV6ndk/L/DlXxYStP8jrF77v2MIg==" crossorigin="anonymous"></script> | ||||||
| 	    <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/plugins/autoloader/prism-autoloader.min.js" integrity="sha512-zc7WDnCM3aom2EziyDIRAtQg1mVXLdILE09Bo+aE1xk0AM2c2cVLfSW9NrxE5tKTX44WBY0Z2HClZ05ur9vB6A==" crossorigin="anonymous"></script> | <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/plugins/autoloader/prism-autoloader.min.js" integrity="sha512-zc7WDnCM3aom2EziyDIRAtQg1mVXLdILE09Bo+aE1xk0AM2c2cVLfSW9NrxE5tKTX44WBY0Z2HClZ05ur9vB6A==" crossorigin="anonymous"></script> | ||||||
|         <script src="@Context.GetLink("/assets/asciinema-player.js")"></script> | <script src="@Context.GetLink("/assets/asciinema-player.js")"></script> | ||||||
|     </body> | <script> | ||||||
|  |             document.querySelectorAll('asciinema-player').forEach(cast => { | ||||||
|  |                 AsciinemaPlayer.create(cast.attributes['src'].value, cast, {autoplay: true, fit: 'none', fontSize: 'inherit'}); | ||||||
|  |             }); | ||||||
|  |         </script> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  |             function swapTheme(){ | ||||||
|  |                 if (document.documentElement.classList.contains('dark')) { | ||||||
|  |                     document.documentElement.classList.remove('dark'); | ||||||
|  |                     localStorage.theme = 'light'; | ||||||
|  |                 } else { | ||||||
|  |                     document.documentElement.classList.add('dark'); | ||||||
|  |                     localStorage.theme = 'dark'; | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         </script> | ||||||
|  | </body> | ||||||
| </html> | </html> | ||||||
| @@ -7,7 +7,7 @@ Severity: Warning | |||||||
|  |  | ||||||
| ## Cause | ## Cause | ||||||
|  |  | ||||||
| A violation of this rule occurs when a AnsiConsole prompt is called within the context of an executing renderable e.g. `Progress`, `Status` and `Live`. Concurrent LiveRenderable are not supported and will cause issues when running simultaneously. | A violation of this rule occurs when an AnsiConsole prompt is called within the context of an executing renderable e.g. `Progress`, `Status` and `Live`. Concurrent LiveRenderable are not supported and will cause issues when running simultaneously. | ||||||
|  |  | ||||||
| ## Reason for rule | ## Reason for rule | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| @inherits StatiqRazorPage<IDocument> | @inherits StatiqRazorPage<IDocument> | ||||||
|  |  | ||||||
| @{ | @{ | ||||||
|     Layout = @"/_layout.cshtml"; |     Layout = @"../../_layout.cshtml"; | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										19
									
								
								docs/input/api/Kind/_Assembly.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								docs/input/api/Kind/_Assembly.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @using Docs.Pipelines | ||||||
|  | @using Docs.Extensions | ||||||
|  | @foreach (IGrouping<string, IDocument> typeGroup | ||||||
|  |     in Outputs.FromPipeline(nameof(Api)) | ||||||
|  |         .Where(x => x.GetBool(CodeAnalysisKeys.IsResult) | ||||||
|  |                     && x.GetString(CodeAnalysisKeys.Kind) == "NamedType" | ||||||
|  |                     && Document.IdEquals(x.GetDocument(CodeAnalysisKeys.ContainingAssembly))) | ||||||
|  |         .GroupBy(x => x.GetString(CodeAnalysisKeys.SpecificKind)) | ||||||
|  |         .OrderBy(x => x.Key)) | ||||||
|  | { | ||||||
|  |     <h2>@typeGroup.Key</h2> | ||||||
|  |     @foreach (var type in typeGroup) | ||||||
|  |     { | ||||||
|  |         <ul> | ||||||
|  |             <li>@Context.GetTypeLink(type)</li> | ||||||
|  |         </ul> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										4
									
								
								docs/input/api/Kind/_Event.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								docs/input/api/Kind/_Event.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | |||||||
|  | @await Html.PartialAsync("../Sections/_Syntax.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Examples.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Remarks.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_SeeAlso.cshtml") | ||||||
							
								
								
									
										9
									
								
								docs/input/api/Kind/_Field.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								docs/input/api/Kind/_Field.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | |||||||
|  | @await Html.PartialAsync("../Sections/_Summary.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Syntax.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_SymbolInfo.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Examples.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Remarks.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Attributes.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Parameters.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Value.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_SeeAlso.cshtml") | ||||||
							
								
								
									
										10
									
								
								docs/input/api/Kind/_Method.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								docs/input/api/Kind/_Method.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | |||||||
|  | @await Html.PartialAsync("../Sections/_Summary.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Syntax.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_SymbolInfo.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Examples.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Remarks.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Attributes.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_TypeParameters.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Parameters.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_ReturnValue.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_SeeAlso.cshtml") | ||||||
							
								
								
									
										15
									
								
								docs/input/api/Kind/_NamedType.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								docs/input/api/Kind/_NamedType.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | |||||||
|  | @await Html.PartialAsync("../Sections/_Summary.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Syntax.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_SymbolInfo.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Examples.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Remarks.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Attributes.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_TypeParameters.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Constructors.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Events.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Fields.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Properties.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Methods.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_ExtensionMethods.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Operators.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_SeeAlso.cshtml") | ||||||
							
								
								
									
										25
									
								
								docs/input/api/Kind/_Namespace.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								docs/input/api/Kind/_Namespace.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @using Docs.Extensions | ||||||
|  | @await Html.PartialAsync("../Sections/_Summary.cshtml") | ||||||
|  | @{ | ||||||
|  |     foreach (IGrouping<string, IDocument> typeGroup | ||||||
|  |         in Document.GetDocuments(CodeAnalysisKeys.MemberTypes) | ||||||
|  |             .Where(x => x.GetBool(CodeAnalysisKeys.IsResult) && x.GetString(CodeAnalysisKeys.Kind) == "NamedType") | ||||||
|  |             .GroupBy(x => x.GetString(CodeAnalysisKeys.SpecificKind))) | ||||||
|  |     { | ||||||
|  |         <h3>@typeGroup.Key</h3> | ||||||
|  |         <div class="doc-summary short-term"> | ||||||
|  |             <div> | ||||||
|  |                 <dl> | ||||||
|  |                     @foreach (var type in typeGroup.OrderBy(x => x.GetString(CodeAnalysisKeys.DisplayName)).ToList()) | ||||||
|  |                     { | ||||||
|  |                         <div> | ||||||
|  |                             <dt>@Context.GetTypeLink(type)</dt> | ||||||
|  |                             <dd>@Html.Raw(type.GetString(CodeAnalysisKeys.Summary))</dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |                 </dl> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										9
									
								
								docs/input/api/Kind/_Property.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								docs/input/api/Kind/_Property.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | |||||||
|  | @await Html.PartialAsync("../Sections/_Summary.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Syntax.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_SymbolInfo.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Examples.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Remarks.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Attributes.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Parameters.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_Value.cshtml") | ||||||
|  | @await Html.PartialAsync("../Sections/_SeeAlso.cshtml") | ||||||
							
								
								
									
										26
									
								
								docs/input/api/Sections/_Attributes.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								docs/input/api/Sections/_Attributes.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @using Docs.Extensions | ||||||
|  | @{ | ||||||
|  |     IReadOnlyList<IDocument> attributes = Document.GetDocumentList(CodeAnalysisKeys.Attributes); | ||||||
|  |     if (attributes?.Count > 0) | ||||||
|  |     { | ||||||
|  |         <h3>Attributes</h3> | ||||||
|  |         <div class="doc-summary"> | ||||||
|  |             <div> | ||||||
|  |                 <dl> | ||||||
|  |                     @foreach (var attribute in attributes) | ||||||
|  |                     { | ||||||
|  |                         var type = attribute.GetDocument(CodeAnalysisKeys.Type); | ||||||
|  |  | ||||||
|  |                         <div> | ||||||
|  |                             <dt> | ||||||
|  |                                 @Context.GetTypeLink(type) | ||||||
|  |                             </dt> | ||||||
|  |                             <dd>@Html.Raw(type.GetString(CodeAnalysisKeys.Summary))</dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |                 </dl> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										22
									
								
								docs/input/api/Sections/_ConstantValue.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								docs/input/api/Sections/_ConstantValue.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @using Microsoft.AspNetCore.Html | ||||||
|  | @if(Document.GetBool(CodeAnalysisKeys.HasConstantValue)) | ||||||
|  | { | ||||||
|  |     var constantValue = Document.Get(CodeAnalysisKeys.ConstantValue); | ||||||
|  |  | ||||||
|  |     <h3>Constant Value</h3> | ||||||
|  |     <div class="doc-summary"> | ||||||
|  |         <div> | ||||||
|  |             <dl> | ||||||
|  |  | ||||||
|  |                 <div> | ||||||
|  |  | ||||||
|  |                     <dt> | ||||||
|  |                         @(new HtmlString(constantValue?.ToString() ?? "null")) | ||||||
|  |                     </dt> | ||||||
|  |                     <dd>@(new HtmlString(constantValue?.GetType().Name ?? string.Empty))</dd> | ||||||
|  |                 </div> | ||||||
|  |             </dl> | ||||||
|  |         </div> | ||||||
|  |     </div> | ||||||
|  | } | ||||||
							
								
								
									
										6
									
								
								docs/input/api/Sections/_ConstantValue.cshtml.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								docs/input/api/Sections/_ConstantValue.cshtml.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | |||||||
|  | namespace Docs.input.api.Sections; | ||||||
|  |  | ||||||
|  | public class _ConstantValue_cshtml | ||||||
|  | { | ||||||
|  |      | ||||||
|  | } | ||||||
							
								
								
									
										29
									
								
								docs/input/api/Sections/_Constructors.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								docs/input/api/Sections/_Constructors.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @using Docs.Extensions | ||||||
|  |  | ||||||
|  | @{ | ||||||
|  |     var constructors = Document.GetDocumentList(CodeAnalysisKeys.Constructors) | ||||||
|  |         ?.Where(x => x.GetBool(CodeAnalysisKeys.IsResult)) | ||||||
|  |         .OrderBy(x => x.GetString(CodeAnalysisKeys.DisplayName)) | ||||||
|  |         .ToList(); | ||||||
|  |  | ||||||
|  |     if (constructors?.Count > 0) | ||||||
|  |     { | ||||||
|  |         <h3>Constructors</h3> | ||||||
|  |         <div class="doc-summary"> | ||||||
|  |             <div> | ||||||
|  |                 <dl> | ||||||
|  |                     @foreach (var constructor in constructors) | ||||||
|  |                     { | ||||||
|  |                         <div> | ||||||
|  |                             <dt> | ||||||
|  |                                 @constructor.GetModifiers() @Context.GetTypeLink(constructor, false) | ||||||
|  |                             </dt> | ||||||
|  |                             <dd>@Html.Raw(constructor.GetString(CodeAnalysisKeys.Summary))</dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |                 </dl> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										0
									
								
								docs/input/api/Sections/_DocumentList.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								docs/input/api/Sections/_DocumentList.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								docs/input/api/Sections/_Events.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								docs/input/api/Sections/_Events.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										9
									
								
								docs/input/api/Sections/_Examples.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								docs/input/api/Sections/_Examples.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @{ | ||||||
|  |     var examples = Document.GetString(CodeAnalysisKeys.Example); | ||||||
|  |     if (!examples.IsNullOrWhiteSpace()) | ||||||
|  |     { | ||||||
|  |         <h3>Examples</h3> | ||||||
|  |         <div>@Html.Raw(examples)</div> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										40
									
								
								docs/input/api/Sections/_ExtensionMethods.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								docs/input/api/Sections/_ExtensionMethods.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,40 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @using Docs.Extensions | ||||||
|  | @using Microsoft.CodeAnalysis | ||||||
|  |  | ||||||
|  | @{ | ||||||
|  |     var modelSymbol = Document.Get<ITypeSymbol>(CodeAnalysisKeys.Symbol); | ||||||
|  |     IReadOnlyList<IDocument> methods = Document.GetDocumentList(CodeAnalysisKeys.ExtensionMethods) | ||||||
|  |         ?.Where(x => x.GetBool(CodeAnalysisKeys.IsResult)) | ||||||
|  |         .OrderBy(x => x.GetString(CodeAnalysisKeys.DisplayName)) | ||||||
|  |         .ToList(); | ||||||
|  |  | ||||||
|  |     if (methods?.Count > 0) | ||||||
|  |     { | ||||||
|  |         <h3>Extension Methods</h3> | ||||||
|  |         <div class="doc-summary"> | ||||||
|  |             <div> | ||||||
|  |                 <dl> | ||||||
|  |                     @foreach (var method in methods) | ||||||
|  |                     { | ||||||
|  |                         ISymbol reducedSymbol = method.Get<IMethodSymbol>(CodeAnalysisKeys.Symbol)?.ReduceExtensionMethod(modelSymbol); | ||||||
|  |                         string reducedName = reducedSymbol?.ToDisplayString(new SymbolDisplayFormat( | ||||||
|  |                             typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypes, | ||||||
|  |                             genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters, | ||||||
|  |                             parameterOptions: SymbolDisplayParameterOptions.IncludeType, | ||||||
|  |                             memberOptions: SymbolDisplayMemberOptions.IncludeParameters, | ||||||
|  |                             miscellaneousOptions: SymbolDisplayMiscellaneousOptions.UseSpecialTypes)); | ||||||
|  |  | ||||||
|  |                         <div> | ||||||
|  |                             <dt> | ||||||
|  |                                 @method.GetModifiers(skipStatic:true) @method.GetDocument(CodeAnalysisKeys.ReturnType).GetString(CodeAnalysisKeys.DisplayName) @Context.GetTypeLink(method,reducedName, false) | ||||||
|  |                             </dt> | ||||||
|  |                             <dd>@Html.Raw(method.GetString(CodeAnalysisKeys.Summary))</dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |  | ||||||
|  |                 </dl> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										59
									
								
								docs/input/api/Sections/_Fields.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								docs/input/api/Sections/_Fields.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,59 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @using Microsoft.AspNetCore.Html | ||||||
|  | @using Docs.Extensions | ||||||
|  | @{ | ||||||
|  |     var isEnum = Document.GetString(CodeAnalysisKeys.SpecificKind) == "Enum"; | ||||||
|  |     IReadOnlyList<IDocument> fields; | ||||||
|  |     if (isEnum) | ||||||
|  |     { | ||||||
|  |         fields = Document.GetDocumentList(CodeAnalysisKeys.Members)?.Where(x => x.GetBool(CodeAnalysisKeys.IsResult) && x.GetString(CodeAnalysisKeys.Kind) == "Field") | ||||||
|  |             .OrderBy(x => x.Get(CodeAnalysisKeys.ConstantValue) as int? ?? 0) | ||||||
|  |             .ToList(); | ||||||
|  |     } | ||||||
|  |     else | ||||||
|  |     { | ||||||
|  |         fields = Document.GetDocumentList(CodeAnalysisKeys.Members)?.Where(x => x.GetBool(CodeAnalysisKeys.IsResult) && x.GetString(CodeAnalysisKeys.Kind) == "Field") | ||||||
|  |             .OrderBy(x => x.GetString(CodeAnalysisKeys.DisplayName)) | ||||||
|  |             .ToList(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     if (fields?.Count > 0) | ||||||
|  |     { | ||||||
|  |         <h3>Fields</h3> | ||||||
|  |         <div class="doc-summary"> | ||||||
|  |             <div> | ||||||
|  |                 <dl> | ||||||
|  |                     @foreach (var field in fields) | ||||||
|  |                     { | ||||||
|  |                         <div> | ||||||
|  |                             <dt> | ||||||
|  |  | ||||||
|  |                                 <div class="flex flex-row"> | ||||||
|  |                                     <div class="w-4/5"> | ||||||
|  |                                         @if (isEnum) | ||||||
|  |                                         { | ||||||
|  |                                             @Context.GetTypeLink(field, false) | ||||||
|  |                                         } | ||||||
|  |                                         else | ||||||
|  |                                         { | ||||||
|  |                                             @field.GetModifiers() @Context.GetTypeLink(field.GetDocument(CodeAnalysisKeys.Type)) | ||||||
|  |                                             @Context.GetTypeLink(field, false) | ||||||
|  |                                         } | ||||||
|  |                                     </div> | ||||||
|  |                                     <div> | ||||||
|  |                                         @(field.GetBool(CodeAnalysisKeys.HasConstantValue) ? new HtmlString(field.Get(CodeAnalysisKeys.ConstantValue)?.ToString() ?? "null") : new HtmlString(string.Empty)) | ||||||
|  |                                     </div> | ||||||
|  |                                 </div> | ||||||
|  |                             </dt> | ||||||
|  |                             <dd> | ||||||
|  |                                 @Html.Raw(field.GetString(CodeAnalysisKeys.Summary)) | ||||||
|  |                             </dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |                 </dl> | ||||||
|  |             </div> | ||||||
|  |  | ||||||
|  |         </div> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										30
									
								
								docs/input/api/Sections/_Methods.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								docs/input/api/Sections/_Methods.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @using Docs.Extensions | ||||||
|  |  | ||||||
|  | @{ | ||||||
|  |     IReadOnlyList<IDocument> methods = Model.GetDocumentList(CodeAnalysisKeys.Members) | ||||||
|  |         ?.Where(x => x.GetBool(CodeAnalysisKeys.IsResult) && x.GetString(CodeAnalysisKeys.Kind) == "Method") | ||||||
|  |         .OrderBy(x => x.GetString(CodeAnalysisKeys.DisplayName)) | ||||||
|  |         .ToList(); | ||||||
|  |  | ||||||
|  |     if (methods?.Count > 0) | ||||||
|  |     { | ||||||
|  |         <h3>Methods</h3> | ||||||
|  |         <div class="doc-summary"> | ||||||
|  |             <div> | ||||||
|  |                 <dl> | ||||||
|  |                     @foreach (var method in methods) | ||||||
|  |                     { | ||||||
|  |                         <div> | ||||||
|  |                             <dt> | ||||||
|  |                                 @method.GetModifiers() @method.GetDocument(CodeAnalysisKeys.ReturnType).GetString(CodeAnalysisKeys.DisplayName) @Context.GetTypeLink(method, false) | ||||||
|  |                             </dt> | ||||||
|  |                             <dd>@Html.Raw(method.GetString(CodeAnalysisKeys.Summary))</dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |  | ||||||
|  |                 </dl> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										0
									
								
								docs/input/api/Sections/_Operators.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								docs/input/api/Sections/_Operators.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										25
									
								
								docs/input/api/Sections/_Parameters.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								docs/input/api/Sections/_Parameters.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @using Docs.Extensions | ||||||
|  | @{ | ||||||
|  |     var parameters = Model.GetDocumentList(CodeAnalysisKeys.Parameters); | ||||||
|  |     var paramComments = Model.GetList<ReferenceComment>(CodeAnalysisKeys.Params); | ||||||
|  |     if (parameters?.Count > 0) | ||||||
|  |     { | ||||||
|  |         <h3>Parameters</h3> | ||||||
|  |         <div class="doc-summary"> | ||||||
|  |         <div> | ||||||
|  |             <dl> | ||||||
|  |                 @foreach (var parameter in parameters) | ||||||
|  |                 { | ||||||
|  |                     <div> | ||||||
|  |                         <dt> | ||||||
|  |                             @Context.GetTypeLink(parameter.GetDocument(CodeAnalysisKeys.Type)) <span class="identifier">@parameter.GetString(CodeAnalysisKeys.Name)</span> | ||||||
|  |                         </dt> | ||||||
|  |                         <dd>@Html.Raw(paramComments?.Where(x => x.Name.Equals(parameter.GetString(CodeAnalysisKeys.Name))).Select(x => x.Html).FirstOrDefault()) </dd> | ||||||
|  |                     </div> | ||||||
|  |                 } | ||||||
|  |             </dl> | ||||||
|  |         </div> | ||||||
|  |         </div> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										30
									
								
								docs/input/api/Sections/_Properties.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								docs/input/api/Sections/_Properties.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @using Docs.Extensions | ||||||
|  | @{ | ||||||
|  |     IReadOnlyList<IDocument> properties = Model.GetDocumentList(CodeAnalysisKeys.Members) | ||||||
|  |         ?.Where(x => x.GetBool(CodeAnalysisKeys.IsResult) && x.GetString(CodeAnalysisKeys.Kind) == "Property") | ||||||
|  |         .OrderBy(x => x.GetString(CodeAnalysisKeys.DisplayName)) | ||||||
|  |         .ToList(); | ||||||
|  |  | ||||||
|  |     if (properties?.Count > 0) | ||||||
|  |     { | ||||||
|  |         <h3>Properties</h3> | ||||||
|  |  | ||||||
|  |         <div class="doc-summary"> | ||||||
|  |  | ||||||
|  |             <div> | ||||||
|  |                 <dl> | ||||||
|  |                     @foreach (var property in properties) | ||||||
|  |                     { | ||||||
|  |                         <div> | ||||||
|  |                             <dt> | ||||||
|  |                                 @property.GetModifiers() @property.GetDocument(CodeAnalysisKeys.Type).GetString(CodeAnalysisKeys.DisplayName) @Context.GetTypeLink(property, false) | ||||||
|  |                             </dt> | ||||||
|  |                             <dd>@Html.Raw(property.GetString(CodeAnalysisKeys.Summary))</dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |                 </dl> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										9
									
								
								docs/input/api/Sections/_Remarks.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								docs/input/api/Sections/_Remarks.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @{ | ||||||
|  |     var remarks = Document.GetString(CodeAnalysisKeys.Remarks); | ||||||
|  |     if (!remarks.IsNullOrWhiteSpace()) | ||||||
|  |     { | ||||||
|  |         <h3>Remarks</h3> | ||||||
|  |         <div>@Html.Raw(remarks)</div> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										23
									
								
								docs/input/api/Sections/_ReturnValue.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								docs/input/api/Sections/_ReturnValue.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @using Docs.Extensions | ||||||
|  | @{ | ||||||
|  |     var returnType = Model.GetDocument(CodeAnalysisKeys.ReturnType); | ||||||
|  |     var returns = Model.GetString(CodeAnalysisKeys.Returns); | ||||||
|  |     if ((returnType != null && returnType.GetString(CodeAnalysisKeys.DisplayName) != "void") || !string.IsNullOrWhiteSpace(returns)) | ||||||
|  |     { | ||||||
|  |         <h3>Returns</h3> | ||||||
|  |         <div class="doc-summary"> | ||||||
|  |             <div> | ||||||
|  |                 <dl> | ||||||
|  |                     <div> | ||||||
|  |  | ||||||
|  |                         <dt> | ||||||
|  |                             @Context.GetTypeLink(returnType, false) | ||||||
|  |                         </dt> | ||||||
|  |                         <dd></dd> | ||||||
|  |                     </div> | ||||||
|  |                 </dl> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										14
									
								
								docs/input/api/Sections/_SeeAlso.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								docs/input/api/Sections/_SeeAlso.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @{ | ||||||
|  |     var seeAlso = Document.GetList<string>(CodeAnalysisKeys.SeeAlso); | ||||||
|  |     if (seeAlso?.Count > 0) | ||||||
|  |     { | ||||||
|  |         <h3 id="SeeAlso">See Also</h3> | ||||||
|  |         <ul> | ||||||
|  |             @foreach (string seeAlsoComment in seeAlso) | ||||||
|  |             { | ||||||
|  |                 <li>@Html.Raw(seeAlsoComment)</li> | ||||||
|  |             } | ||||||
|  |         </ul> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										7
									
								
								docs/input/api/Sections/_Summary.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								docs/input/api/Sections/_Summary.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | |||||||
|  | @{ | ||||||
|  |     var summary = Document.GetString("Summary"); | ||||||
|  |     if (!summary.IsNullOrWhiteSpace()) | ||||||
|  |     { | ||||||
|  |         <div class="my-4 md:my-8">@Html.Raw(summary)</div> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										131
									
								
								docs/input/api/Sections/_SymbolInfo.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										131
									
								
								docs/input/api/Sections/_SymbolInfo.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,131 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @using Docs.Extensions | ||||||
|  | @{ | ||||||
|  |     var containingAssembly = Document.GetDocument(CodeAnalysisKeys.ContainingAssembly); | ||||||
|  |     var containingNamespace = Document.GetDocument(CodeAnalysisKeys.ContainingNamespace); | ||||||
|  |     var containingType = Document.GetDocument(CodeAnalysisKeys.ContainingType); | ||||||
|  |     var type = Document.GetDocument(CodeAnalysisKeys.Type); | ||||||
|  |     var overridden = Document.GetDocument(CodeAnalysisKeys.Overridden); | ||||||
|  |     IReadOnlyList<IDocument> allInterfaces = Document.GetDocumentList(CodeAnalysisKeys.AllInterfaces); | ||||||
|  |     IReadOnlyList<IDocument> baseTypes = Document.GetDocumentList(CodeAnalysisKeys.BaseTypes)? | ||||||
|  |         .Where(i => !i.GetString(CodeAnalysisKeys.QualifiedName).Equals("System.Object")) | ||||||
|  |         .Reverse() | ||||||
|  |         .ToList(); | ||||||
|  |     IReadOnlyList<IDocument> derivedTypes = Document.GetDocumentList(CodeAnalysisKeys.DerivedTypes); | ||||||
|  |     IReadOnlyList<IDocument> implementingTypes = Document.GetDocumentList(CodeAnalysisKeys.ImplementingTypes); | ||||||
|  |     if (containingAssembly is object | ||||||
|  |         || containingNamespace is object | ||||||
|  |         || allInterfaces?.Count > 0 | ||||||
|  |         || baseTypes?.Count > 0 | ||||||
|  |         || derivedTypes?.Count > 0 | ||||||
|  |         || implementingTypes?.Count > 0) | ||||||
|  |     { | ||||||
|  |         <div class="doc-summary tiny-term"> | ||||||
|  |             <div> | ||||||
|  |                 <dl> | ||||||
|  |  | ||||||
|  |                     @if (containingAssembly != null) | ||||||
|  |                     { | ||||||
|  |                         <div> | ||||||
|  |                             <dt>Assembly</dt> | ||||||
|  |                             <dd>containingAssembly</dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |  | ||||||
|  |                     @if (containingNamespace != null) | ||||||
|  |                     { | ||||||
|  |                         <div> | ||||||
|  |                             <dt>Namespace</dt> | ||||||
|  |                             <dd>@Context.GetTypeLink(containingNamespace)</dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |  | ||||||
|  |                     @if (containingType != null) | ||||||
|  |                     { | ||||||
|  |                         <div> | ||||||
|  |                             <dt>Containing Type</dt> | ||||||
|  |                             <dd>@Context.GetTypeLink(containingType)</dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |  | ||||||
|  |                     @if (overridden != null) | ||||||
|  |                     { | ||||||
|  |                         <div> | ||||||
|  |                             <dt>Overridden</dt> | ||||||
|  |                             <dd>@Context.GetTypeLink(overridden)</dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |  | ||||||
|  |                     @if (allInterfaces?.Count > 0) | ||||||
|  |                     { | ||||||
|  |                         <div> | ||||||
|  |                             <dt>Interfaces</dt> | ||||||
|  |                             <dd> | ||||||
|  |                                 <ul class="list-unstyled"> | ||||||
|  |                                     @foreach (var interfaceDocument in allInterfaces) | ||||||
|  |                                     { | ||||||
|  |                                         <li>@Context.GetTypeLink(interfaceDocument)</li> | ||||||
|  |                                     } | ||||||
|  |                                 </ul> | ||||||
|  |                             </dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |  | ||||||
|  |                     @if (baseTypes?.Count > 0) | ||||||
|  |                     { | ||||||
|  |                         <div> | ||||||
|  |                             <dt>Base Types</dt> | ||||||
|  |                             <dd> | ||||||
|  |                                 <ul class="list-unstyled"> | ||||||
|  |                                     @foreach (var baseType in baseTypes) | ||||||
|  |                                     { | ||||||
|  |                                         <li>@Context.GetTypeLink(baseType)</li> | ||||||
|  |                                     } | ||||||
|  |                                 </ul> | ||||||
|  |                             </dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |  | ||||||
|  |                     @if (derivedTypes?.Count > 0) | ||||||
|  |                     { | ||||||
|  |                         <div> | ||||||
|  |                             <dt>Derived Types</dt> | ||||||
|  |                             <dd> | ||||||
|  |                                 <ul class="list-unstyled"> | ||||||
|  |                                     @foreach (var derivedType in derivedTypes) | ||||||
|  |                                     { | ||||||
|  |                                         <li>@Context.GetTypeLink(derivedType)</li> | ||||||
|  |                                     } | ||||||
|  |                                 </ul> | ||||||
|  |                             </dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |  | ||||||
|  |                     @if (implementingTypes?.Count > 0) | ||||||
|  |  | ||||||
|  |                     { | ||||||
|  |                         <div> | ||||||
|  |                             <dt>Implementing Types</dt> | ||||||
|  |                             <dd> | ||||||
|  |                                 <ul class="list-unstyled"> | ||||||
|  |                                     @foreach (var implementingType in implementingTypes) | ||||||
|  |                                     { | ||||||
|  |                                         <li>@Context.GetTypeLink(implementingType)</li> | ||||||
|  |                                     } | ||||||
|  |                                 </ul> | ||||||
|  |                             </dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |  | ||||||
|  |                     @if (type != null) | ||||||
|  |                     { | ||||||
|  |                         <div> | ||||||
|  |                             <dt>@Document.GetString(CodeAnalysisKeys.Kind) Type</dt> | ||||||
|  |                             <dd>@Context.GetTypeLink(type)</dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |                 </dl> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										8
									
								
								docs/input/api/Sections/_Syntax.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								docs/input/api/Sections/_Syntax.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @{ | ||||||
|  |     string syntax = Document.GetString(CodeAnalysisKeys.Syntax); | ||||||
|  |     if (!syntax.IsNullOrWhiteSpace()) | ||||||
|  |     { | ||||||
|  |         <pre class="language-csharp"><code class="language-csharp">@syntax</code></pre> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										26
									
								
								docs/input/api/Sections/_TypeParameters.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								docs/input/api/Sections/_TypeParameters.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  |  | ||||||
|  | @{ | ||||||
|  |     var typeParameters = Model.GetDocumentList(CodeAnalysisKeys.TypeParameters); | ||||||
|  |     var typeParams = Model.GetList<ReferenceComment>(CodeAnalysisKeys.TypeParams); | ||||||
|  |  | ||||||
|  |     if (typeParameters?.Count > 0) | ||||||
|  |     { | ||||||
|  |         <h3>Parameters</h3> | ||||||
|  |         <div class="doc-summary"> | ||||||
|  |             <div> | ||||||
|  |                 <dl> | ||||||
|  |                     @foreach (var typeParam in typeParameters) | ||||||
|  |                     { | ||||||
|  |                         <div> | ||||||
|  |                             <dt> | ||||||
|  |                                 <code>@typeParam.GetString(CodeAnalysisKeys.Name)</code> | ||||||
|  |                             </dt> | ||||||
|  |                             <dd>@Html.Raw(typeParams?.Where(x => x.Name.Equals(typeParam.GetString(CodeAnalysisKeys.Name))).Select(x => x.Html).FirstOrDefault()) </dd> | ||||||
|  |                         </div> | ||||||
|  |                     } | ||||||
|  |                 </dl> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										12
									
								
								docs/input/api/Sections/_Value.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								docs/input/api/Sections/_Value.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @using Docs.Extensions | ||||||
|  | @{ | ||||||
|  |     IDocument type = Document.GetDocument(CodeAnalysisKeys.Type); | ||||||
|  |     string value = Document.GetString(CodeAnalysisKeys.Value); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | @if (type is object && !string.IsNullOrWhiteSpace(value)) | ||||||
|  | { | ||||||
|  |     <p>@Context.GetTypeLink(type)</p> | ||||||
|  |     <p>@Html.Raw(value)</p> | ||||||
|  | } | ||||||
							
								
								
									
										48
									
								
								docs/input/api/_layout.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								docs/input/api/_layout.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,48 @@ | |||||||
|  | @using Statiq.CodeAnalysis | ||||||
|  | @using Docs.Extensions | ||||||
|  | @inherits StatiqRazorPage<IDocument> | ||||||
|  |  | ||||||
|  | @{ | ||||||
|  |     Layout = @"../_layout.cshtml"; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | @section header{ | ||||||
|  |     <h1 class="text-2xl md:text-4xl align-baseline font-extrabold"> | ||||||
|  |         @Document.GetString(CodeAnalysisKeys.DisplayName) <span class="text-lg md:text-2xl text-uppercase text-sky-600 dark:text-sky-400">@Document.GetString(CodeAnalysisKeys.SpecificKind)</span> | ||||||
|  |     </h1> | ||||||
|  |  | ||||||
|  |     <nav class="flex mt-2" aria-label="Breadcrumb"> | ||||||
|  |         <ol class="flex flex-col sm:flex-row sm:items-center space-x-2 lg:space-x-3"> | ||||||
|  |             @{ | ||||||
|  |                 var isFirst = true; | ||||||
|  |             } | ||||||
|  |             @foreach (var parent in Context.GetExecutionCache("sidebar", ctx => ctx.OutputPages).GetAncestorsOf(Document, Document.IdEquals(Model)).Reverse().Skip(1)) | ||||||
|  |             { | ||||||
|  |                 <li> | ||||||
|  |                     <div class="flex items-center"> | ||||||
|  |                         @if (isFirst) | ||||||
|  |                         { | ||||||
|  |                             isFirst = false; | ||||||
|  |                         } | ||||||
|  |                         else | ||||||
|  |                         { | ||||||
|  |                             <svg class="flex-shrink-0 h-5 w-5 mr-2 lg:mr-3 text-slate-400 dark:text-slate-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"> | ||||||
|  |                                 <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/> | ||||||
|  |                             </svg> | ||||||
|  |                         } | ||||||
|  |  | ||||||
|  |                         <span class="font-light text-sm text-slate-600 dark:text-slate-300" >@Html.DocumentLink(parent, parent.GetString(WebKeys.Title, parent.GetTitle()))</span> | ||||||
|  |                     </div> | ||||||
|  |                 </li> | ||||||
|  |             } | ||||||
|  |         </ol> | ||||||
|  |     </nav> | ||||||
|  |  | ||||||
|  |  | ||||||
|  | } | ||||||
|  |  | ||||||
|  | @await Html.PartialAsync($"Kind/_{Model.GetString(CodeAnalysisKeys.Kind)}.cshtml", Model) | ||||||
|  |  | ||||||
|  | @{ | ||||||
|  |     IgnoreBody(); | ||||||
|  | } | ||||||
							
								
								
									
										11
									
								
								docs/input/api/index.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								docs/input/api/index.cshtml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | |||||||
|  | Title: API Reference | ||||||
|  | Order: 10000 | ||||||
|  | --- | ||||||
|  | <p>The Spectre.Console API reference is organized by namespace. Each namespace has one or more classes for working with Console applications.</p> | ||||||
|  |  | ||||||
|  | <ul> | ||||||
|  |     @foreach (var child in OutputPages.GetChildrenOf(Document).OrderBy(i => i.GetTitle())) | ||||||
|  |     { | ||||||
|  |         <li>@Html.DocumentLink(child)</li> | ||||||
|  |     } | ||||||
|  | </ul> | ||||||
| @@ -8,7 +8,7 @@ Highlights: | |||||||
|     - And more... |     - And more... | ||||||
| --- | --- | ||||||
|  |  | ||||||
| There is different built-in borders you can use for tables and panels. | There are different built-in borders you can use for tables and panels. | ||||||
|  |  | ||||||
| ## Table borders | ## Table borders | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,7 +1,6 @@ | |||||||
| Title: Appendix | Title: Appendix | ||||||
| Order: 100 | Order: 100 | ||||||
| --- | --- | ||||||
|  |  | ||||||
| <h1>Sections</h1> | <h1>Sections</h1> | ||||||
|  |  | ||||||
| <ul> | <ul> | ||||||
|   | |||||||
| @@ -25,7 +25,7 @@ AnsiConsole.Status() | |||||||
| To implement your own spinner, all you have to do is  | To implement your own spinner, all you have to do is  | ||||||
| inherit from the `Spinner` base class. | inherit from the `Spinner` base class. | ||||||
|  |  | ||||||
| In the example below, the spinner will alterate between | In the example below, the spinner will alternate between | ||||||
| the characters `A`, `B` and `C` every 100 ms. | the characters `A`, `B` and `C` every 100 ms. | ||||||
|  |  | ||||||
| ```csharp | ```csharp | ||||||
|   | |||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -1,3 +1,3 @@ | |||||||
| {"version": 2, "width": 84, "height": 12, "title": "custom-colors-exception (plain)", "env": {"TERM": "Spectre.Console"}} | {"version": 2, "width": 102, "height": 12, "title": "custom-colors-exception (plain)", "env": {"TERM": "Spectre.Console"}} | ||||||
| [0, "o", "\u001B[37mInvalidOperationException\u001B[0m: \u001B[37mWhaaat?\u001B[0m\r\n     \u001B[37mInvalidCredentialException\u001B[0m: \u001B[37mThe credentials are invalid.\u001B[0m                     \r\n       \u001B[37mat\u001B[0m \u001B[31mCheckCredentials\u001B[0m\u001B[37m(\u001B[0m\u001B[31mInt32\u001B[0m \u001B[37mqux\u001B[0m, \u001B[31mString[,]\u001B[0m \u001B[37mcorgi)\u001B[0m \u001B[37min\u001B[0m \u001B]8;id=788450310;file://spectre-5/C:/Users/Patrik/Source/github/patriksvensson/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[31mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[37m:\u001B[0m\u001B[37m75\u001B[0m        \r\n       \u001B[37mat\u001B[0m \u001B[31mDoMagic\u001B[0m\u001B[37m(\u001B[0m\u001B[31mInt32\u001B[0m \u001B[37mfoo\u001B[0m, \u001B[31mString[,]\u001B[0m \u001B[37mbar)\u001B[0m \u001B[37min\u001B[0m \u001B]8;id=1709619784;file://spectre-5/C:/Users/Patrik/Source/github/patriksvensson/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[31mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[37m:\u001B[0m\u001B[37m65\u001B[0m                   \r\n  \u001B[37mat\u001B[0m \u001B[31mDoMagic\u001B[0m\u001B[37m(\u001B[0m\u001B[31mInt32\u001B[0m \u001B[37mfoo\u001B[0m, \u001B[31mString[,]\u001B[0m \u001B[37mbar)\u001B[0m \u001B[37min\u001B[0m \u001B]8;id=2048787664;file://spectre-5/C:/Users/Patrik/Source/github/patriksvensson/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[31mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[37m:\u001B[0m\u001B[37m69\u001B[0m                        \r\n  \u001B[37mat\u001B[0m \u001B[31mctor\u001B[0m\u001B[37m()\u001B[0m \u001B[37min\u001B[0m \u001B]8;id=1010331136;file://spectre-5/C:/Users/Patrik/Source/github/patriksvensson/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[31mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[37m:\u001B[0m\u001B[37m19\u001B[0m                                                   \r\n"] | [0, "o", "\u001B[37mInvalidOperationException\u001B[0m: \u001B[37mWhaaat?\u001B[0m\r\n     \u001B[37mInvalidCredentialException\u001B[0m: \u001B[37mThe credentials are invalid.\u001B[0m                                       \r\n       \u001B[37mat\u001B[0m \u001B[31mvoid\u001B[0m \u001B[31mCheckCredentials\u001B[0m\u001B[37m(\u001B[0m\u001B[31mint\u001B[0m \u001B[37mqux\u001B[0m, \u001B[31mstring[,]\u001B[0m \u001B[37mcorgi)\u001B[0m \u001B[37min\u001B[0m \u001B]8;id=496927177;file://phil-adler/R:/phil-scott/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[31mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[37m:\u001B[0m\u001B[37m76\u001B[0m                       \r\n       \u001B[37mat\u001B[0m \u001B[31mvoid\u001B[0m \u001B[31mDoMagic\u001B[0m\u001B[37m(\u001B[0m\u001B[31mint\u001B[0m \u001B[37mfoo\u001B[0m, \u001B[31mstring[,]\u001B[0m \u001B[37mbar)\u001B[0m \u001B[37min\u001B[0m \u001B]8;id=260293059;file://phil-adler/R:/phil-scott/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[31mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[37m:\u001B[0m\u001B[37m66\u001B[0m                                  \r\n  \u001B[37mat\u001B[0m \u001B[31mvoid\u001B[0m \u001B[31mDoMagic\u001B[0m\u001B[37m(\u001B[0m\u001B[31mint\u001B[0m \u001B[37mfoo\u001B[0m, \u001B[31mstring[,]\u001B[0m \u001B[37mbar)\u001B[0m \u001B[37min\u001B[0m \u001B]8;id=311730381;file://phil-adler/R:/phil-scott/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[31mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[37m:\u001B[0m\u001B[37m70\u001B[0m                                       \r\n  \u001B[37mat\u001B[0m \u001B[31mctor\u001B[0m\u001B[37m()\u001B[0m \u001B[37min\u001B[0m \u001B]8;id=661850274;file://phil-adler/R:/phil-scott/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[31mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[37m:\u001B[0m\u001B[37m20\u001B[0m                                                                     \r\n"] | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,3 +1,3 @@ | |||||||
| {"version": 2, "width": 84, "height": 12, "title": "custom-colors-exception (rich)", "env": {"TERM": "Spectre.Console"}} | {"version": 2, "width": 102, "height": 12, "title": "custom-colors-exception (rich)", "env": {"TERM": "Spectre.Console"}} | ||||||
| [0, "o", "\u001B[38;5;8mInvalidOperationException\u001B[0m: \u001B[38;5;15mWhaaat?\u001B[0m\r\n     \u001B[38;5;8mInvalidCredentialException\u001B[0m: \u001B[38;5;15mThe credentials are invalid.\u001B[0m                     \r\n       \u001B[38;5;8mat\u001B[0m \u001B[38;5;9mCheckCredentials\u001B[0m\u001B[38;5;230m(\u001B[0m\u001B[38;5;9mInt32\u001B[0m \u001B[38;5;230mqux\u001B[0m, \u001B[38;5;9mString[,]\u001B[0m \u001B[38;5;230mcorgi)\u001B[0m \u001B[38;5;8min\u001B[0m \u001B]8;id=1826752100;file://spectre-5/C:/Users/Patrik/Source/github/patriksvensson/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[38;5;9mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[38;5;8m:\u001B[0m\u001B[38;5;230m75\u001B[0m        \r\n       \u001B[38;5;8mat\u001B[0m \u001B[38;5;9mDoMagic\u001B[0m\u001B[38;5;230m(\u001B[0m\u001B[38;5;9mInt32\u001B[0m \u001B[38;5;230mfoo\u001B[0m, \u001B[38;5;9mString[,]\u001B[0m \u001B[38;5;230mbar)\u001B[0m \u001B[38;5;8min\u001B[0m \u001B]8;id=337489330;file://spectre-5/C:/Users/Patrik/Source/github/patriksvensson/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[38;5;9mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[38;5;8m:\u001B[0m\u001B[38;5;230m65\u001B[0m                   \r\n  \u001B[38;5;8mat\u001B[0m \u001B[38;5;9mDoMagic\u001B[0m\u001B[38;5;230m(\u001B[0m\u001B[38;5;9mInt32\u001B[0m \u001B[38;5;230mfoo\u001B[0m, \u001B[38;5;9mString[,]\u001B[0m \u001B[38;5;230mbar)\u001B[0m \u001B[38;5;8min\u001B[0m \u001B]8;id=250093008;file://spectre-5/C:/Users/Patrik/Source/github/patriksvensson/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[38;5;9mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[38;5;8m:\u001B[0m\u001B[38;5;230m69\u001B[0m                        \r\n  \u001B[38;5;8mat\u001B[0m \u001B[38;5;9mctor\u001B[0m\u001B[38;5;230m()\u001B[0m \u001B[38;5;8min\u001B[0m \u001B]8;id=2108937738;file://spectre-5/C:/Users/Patrik/Source/github/patriksvensson/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[38;5;9mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[38;5;8m:\u001B[0m\u001B[38;5;230m19\u001B[0m                                                   \r\n"] | [0, "o", "\u001B[38;5;8mInvalidOperationException\u001B[0m: \u001B[38;5;15mWhaaat?\u001B[0m\r\n     \u001B[38;5;8mInvalidCredentialException\u001B[0m: \u001B[38;5;15mThe credentials are invalid.\u001B[0m                                       \r\n       \u001B[38;5;8mat\u001B[0m \u001B[38;5;9mvoid\u001B[0m \u001B[38;5;9mCheckCredentials\u001B[0m\u001B[38;5;230m(\u001B[0m\u001B[38;5;9mint\u001B[0m \u001B[38;5;230mqux\u001B[0m, \u001B[38;5;9mstring[,]\u001B[0m \u001B[38;5;230mcorgi)\u001B[0m \u001B[38;5;8min\u001B[0m \u001B]8;id=960633358;file://phil-adler/R:/phil-scott/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[38;5;9mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[38;5;8m:\u001B[0m\u001B[38;5;230m76\u001B[0m                       \r\n       \u001B[38;5;8mat\u001B[0m \u001B[38;5;9mvoid\u001B[0m \u001B[38;5;9mDoMagic\u001B[0m\u001B[38;5;230m(\u001B[0m\u001B[38;5;9mint\u001B[0m \u001B[38;5;230mfoo\u001B[0m, \u001B[38;5;9mstring[,]\u001B[0m \u001B[38;5;230mbar)\u001B[0m \u001B[38;5;8min\u001B[0m \u001B]8;id=93980157;file://phil-adler/R:/phil-scott/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[38;5;9mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[38;5;8m:\u001B[0m\u001B[38;5;230m66\u001B[0m                                  \r\n  \u001B[38;5;8mat\u001B[0m \u001B[38;5;9mvoid\u001B[0m \u001B[38;5;9mDoMagic\u001B[0m\u001B[38;5;230m(\u001B[0m\u001B[38;5;9mint\u001B[0m \u001B[38;5;230mfoo\u001B[0m, \u001B[38;5;9mstring[,]\u001B[0m \u001B[38;5;230mbar)\u001B[0m \u001B[38;5;8min\u001B[0m \u001B]8;id=293733654;file://phil-adler/R:/phil-scott/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[38;5;9mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[38;5;8m:\u001B[0m\u001B[38;5;230m70\u001B[0m                                       \r\n  \u001B[38;5;8mat\u001B[0m \u001B[38;5;9mctor\u001B[0m\u001B[38;5;230m()\u001B[0m \u001B[38;5;8min\u001B[0m \u001B]8;id=762297770;file://phil-adler/R:/phil-scott/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[38;5;9mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[38;5;8m:\u001B[0m\u001B[38;5;230m20\u001B[0m                                                                     \r\n"] | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,3 +1,3 @@ | |||||||
| {"version": 2, "width": 84, "height": 12, "title": "default-exception (plain)", "env": {"TERM": "Spectre.Console"}} | {"version": 2, "width": 102, "height": 12, "title": "default-exception (plain)", "env": {"TERM": "Spectre.Console"}} | ||||||
| [0, "o", "\u001B[37mSystem.\u001B[0m\u001B[37mInvalidOperationException\u001B[0m: \u001B[1;31mWhaaat?\u001B[0m\r\n     \u001B[37mSystem.Security.Authentication.\u001B[0m\u001B[37mInvalidCredentialException\u001B[0m: \u001B[1;31mThe credentials \u001B[0m  \r\n     \u001B[1;31mare invalid.\u001B[0m                                                                 \r\n       \u001B[37mat\u001B[0m \u001B[37mGenerator.Commands.Samples.Exceptions.\u001B[0m\u001B[37mCheckCredentials\u001B[0m\u001B[37m(\u001B[0m\u001B[34mInt32\u001B[0m \u001B[37mqux\u001B[0m, \u001B[34mString\u001B[0m\r\n          \u001B[34m[,]\u001B[0m \u001B[37mcorgi)\u001B[0m \u001B[37min\u001B[0m                                                           \r\n          \u001B[37mC:\\Users\\Patrik\\Source\\github\\patriksvensson\\spectre.console\\resources\\s\u001B[0m\r\n          \u001B[37mcripts\\Generator\\Commands\\AsciiCast\\Samples\\\u001B[0m\u001B[1;37mExceptions.cs\u001B[0m\u001B[37m:\u001B[0m\u001B[34m75\u001B[0m            \r\n       \u001B[37mat\u001B[0m \u001B[37mGenerator.Commands.Samples.Exceptions.\u001B[0m\u001B[37mDoMagic\u001B[0m\u001B[37m(\u001B[0m\u001B[34mInt32\u001B[0m \u001B[37mfoo\u001B[0m, \u001B[34mString[,]\u001B[0m \u001B[37mbar)\u001B[0m \r\n          \u001B[37min\u001B[0m                                                                      \r\n          \u001B[37mC:\\Users\\Patrik\\Source\\github\\patriksvensson\\spectre.console\\resources\\s\u001B[0m\r\n          \u001B[37mcripts\\Generator\\Commands\\AsciiCast\\Samples\\\u001B[0m\u001B[1;37mExceptions.cs\u001B[0m\u001B[37m:\u001B[0m\u001B[34m65\u001B[0m            \r\n  \u001B[37mat\u001B[0m \u001B[37mGenerator.Commands.Samples.Exceptions.\u001B[0m\u001B[37mDoMagic\u001B[0m\u001B[37m(\u001B[0m\u001B[34mInt32\u001B[0m \u001B[37mfoo\u001B[0m, \u001B[34mString[,]\u001B[0m \u001B[37mbar)\u001B[0m \u001B[37min\u001B[0m   \r\n     \u001B[37mC:\\Users\\Patrik\\Source\\github\\patriksvensson\\spectre.console\\resources\\script\u001B[0m\r\n     \u001B[37ms\\Generator\\Commands\\AsciiCast\\Samples\\\u001B[0m\u001B[1;37mExceptions.cs\u001B[0m\u001B[37m:\u001B[0m\u001B[34m69\u001B[0m                      \r\n  \u001B[37mat\u001B[0m \u001B[37mGenerator.Commands.Samples.Exceptions.BaseExceptionSample..\u001B[0m\u001B[37mctor\u001B[0m\u001B[37m()\u001B[0m \u001B[37min\u001B[0m         \r\n     \u001B[37mC:\\Users\\Patrik\\Source\\github\\patriksvensson\\spectre.console\\resources\\script\u001B[0m\r\n     \u001B[37ms\\Generator\\Commands\\AsciiCast\\Samples\\\u001B[0m\u001B[1;37mExceptions.cs\u001B[0m\u001B[37m:\u001B[0m\u001B[34m19\u001B[0m                      \r\n"] | [0, "o", "\u001B[37mSystem.\u001B[0m\u001B[37mInvalidOperationException\u001B[0m: \u001B[1;31mWhaaat?\u001B[0m\r\n     \u001B[37mSystem.Security.Authentication.\u001B[0m\u001B[37mInvalidCredentialException\u001B[0m: \u001B[1;31mThe credentials are invalid.\u001B[0m        \r\n       \u001B[37mat\u001B[0m \u001B[34mvoid\u001B[0m \u001B[37mSamples.Exceptions.\u001B[0m\u001B[37mCheckCredentials\u001B[0m\u001B[37m(\u001B[0m\u001B[34mint\u001B[0m \u001B[37mqux\u001B[0m, \u001B[34mstring[,]\u001B[0m \u001B[37mcorgi)\u001B[0m \u001B[37min\u001B[0m \u001B[1;37mExceptions.cs\u001B[0m\u001B[37m:\u001B[0m\u001B[34m76\u001B[0m    \r\n       \u001B[37mat\u001B[0m \u001B[34mvoid\u001B[0m \u001B[37mSamples.Exceptions.\u001B[0m\u001B[37mDoMagic\u001B[0m\u001B[37m(\u001B[0m\u001B[34mint\u001B[0m \u001B[37mfoo\u001B[0m, \u001B[34mstring[,]\u001B[0m \u001B[37mbar)\u001B[0m \u001B[37min\u001B[0m \u001B[1;37mExceptions.cs\u001B[0m\u001B[37m:\u001B[0m\u001B[34m66\u001B[0m               \r\n  \u001B[37mat\u001B[0m \u001B[34mvoid\u001B[0m \u001B[37mSamples.Exceptions.\u001B[0m\u001B[37mDoMagic\u001B[0m\u001B[37m(\u001B[0m\u001B[34mint\u001B[0m \u001B[37mfoo\u001B[0m, \u001B[34mstring[,]\u001B[0m \u001B[37mbar)\u001B[0m \u001B[37min\u001B[0m \u001B[1;37mExceptions.cs\u001B[0m\u001B[37m:\u001B[0m\u001B[34m70\u001B[0m                    \r\n  \u001B[37mat\u001B[0m \u001B[37mSamples.Exceptions.BaseExceptionSample..\u001B[0m\u001B[37mctor\u001B[0m\u001B[37m()\u001B[0m \u001B[37min\u001B[0m \u001B[1;37mExceptions.cs\u001B[0m\u001B[37m:\u001B[0m\u001B[34m20\u001B[0m                             \r\n"] | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,3 +1,3 @@ | |||||||
| {"version": 2, "width": 84, "height": 12, "title": "default-exception (rich)", "env": {"TERM": "Spectre.Console"}} | {"version": 2, "width": 102, "height": 12, "title": "default-exception (rich)", "env": {"TERM": "Spectre.Console"}} | ||||||
| [0, "o", "\u001B[38;5;7mSystem.\u001B[0m\u001B[38;5;15mInvalidOperationException\u001B[0m: \u001B[1;38;5;9mWhaaat?\u001B[0m\r\n     \u001B[38;5;7mSystem.Security.Authentication.\u001B[0m\u001B[38;5;15mInvalidCredentialException\u001B[0m: \u001B[1;38;5;9mThe credentials \u001B[0m  \r\n     \u001B[1;38;5;9mare invalid.\u001B[0m                                                                 \r\n       \u001B[38;5;8mat\u001B[0m \u001B[38;5;7mGenerator.Commands.Samples.Exceptions.\u001B[0m\u001B[38;5;11mCheckCredentials\u001B[0m\u001B[38;5;7m(\u001B[0m\u001B[38;5;12mInt32\u001B[0m \u001B[38;5;7mqux\u001B[0m, \u001B[38;5;12mString\u001B[0m\r\n          \u001B[38;5;12m[,]\u001B[0m \u001B[38;5;7mcorgi)\u001B[0m \u001B[38;5;8min\u001B[0m                                                           \r\n          \u001B[38;5;7mC:\\Users\\Patrik\\Source\\github\\patriksvensson\\spectre.console\\resources\\s\u001B[0m\r\n          \u001B[38;5;7mcripts\\Generator\\Commands\\AsciiCast\\Samples\\\u001B[0m\u001B[1;38;5;11mExceptions.cs\u001B[0m\u001B[38;5;8m:\u001B[0m\u001B[38;5;12m75\u001B[0m            \r\n       \u001B[38;5;8mat\u001B[0m \u001B[38;5;7mGenerator.Commands.Samples.Exceptions.\u001B[0m\u001B[38;5;11mDoMagic\u001B[0m\u001B[38;5;7m(\u001B[0m\u001B[38;5;12mInt32\u001B[0m \u001B[38;5;7mfoo\u001B[0m, \u001B[38;5;12mString[,]\u001B[0m \u001B[38;5;7mbar)\u001B[0m \r\n          \u001B[38;5;8min\u001B[0m                                                                      \r\n          \u001B[38;5;7mC:\\Users\\Patrik\\Source\\github\\patriksvensson\\spectre.console\\resources\\s\u001B[0m\r\n          \u001B[38;5;7mcripts\\Generator\\Commands\\AsciiCast\\Samples\\\u001B[0m\u001B[1;38;5;11mExceptions.cs\u001B[0m\u001B[38;5;8m:\u001B[0m\u001B[38;5;12m65\u001B[0m            \r\n  \u001B[38;5;8mat\u001B[0m \u001B[38;5;7mGenerator.Commands.Samples.Exceptions.\u001B[0m\u001B[38;5;11mDoMagic\u001B[0m\u001B[38;5;7m(\u001B[0m\u001B[38;5;12mInt32\u001B[0m \u001B[38;5;7mfoo\u001B[0m, \u001B[38;5;12mString[,]\u001B[0m \u001B[38;5;7mbar)\u001B[0m \u001B[38;5;8min\u001B[0m   \r\n     \u001B[38;5;7mC:\\Users\\Patrik\\Source\\github\\patriksvensson\\spectre.console\\resources\\script\u001B[0m\r\n     \u001B[38;5;7ms\\Generator\\Commands\\AsciiCast\\Samples\\\u001B[0m\u001B[1;38;5;11mExceptions.cs\u001B[0m\u001B[38;5;8m:\u001B[0m\u001B[38;5;12m69\u001B[0m                      \r\n  \u001B[38;5;8mat\u001B[0m \u001B[38;5;7mGenerator.Commands.Samples.Exceptions.BaseExceptionSample..\u001B[0m\u001B[38;5;11mctor\u001B[0m\u001B[38;5;7m()\u001B[0m \u001B[38;5;8min\u001B[0m         \r\n     \u001B[38;5;7mC:\\Users\\Patrik\\Source\\github\\patriksvensson\\spectre.console\\resources\\script\u001B[0m\r\n     \u001B[38;5;7ms\\Generator\\Commands\\AsciiCast\\Samples\\\u001B[0m\u001B[1;38;5;11mExceptions.cs\u001B[0m\u001B[38;5;8m:\u001B[0m\u001B[38;5;12m19\u001B[0m                      \r\n"] | [0, "o", "\u001B[38;5;7mSystem.\u001B[0m\u001B[38;5;15mInvalidOperationException\u001B[0m: \u001B[1;38;5;9mWhaaat?\u001B[0m\r\n     \u001B[38;5;7mSystem.Security.Authentication.\u001B[0m\u001B[38;5;15mInvalidCredentialException\u001B[0m: \u001B[1;38;5;9mThe credentials are invalid.\u001B[0m        \r\n       \u001B[38;5;8mat\u001B[0m \u001B[38;5;12mvoid\u001B[0m \u001B[38;5;7mSamples.Exceptions.\u001B[0m\u001B[38;5;11mCheckCredentials\u001B[0m\u001B[38;5;7m(\u001B[0m\u001B[38;5;12mint\u001B[0m \u001B[38;5;7mqux\u001B[0m, \u001B[38;5;12mstring[,]\u001B[0m \u001B[38;5;7mcorgi)\u001B[0m \u001B[38;5;8min\u001B[0m \u001B[1;38;5;11mExceptions.cs\u001B[0m\u001B[38;5;8m:\u001B[0m\u001B[38;5;12m76\u001B[0m    \r\n       \u001B[38;5;8mat\u001B[0m \u001B[38;5;12mvoid\u001B[0m \u001B[38;5;7mSamples.Exceptions.\u001B[0m\u001B[38;5;11mDoMagic\u001B[0m\u001B[38;5;7m(\u001B[0m\u001B[38;5;12mint\u001B[0m \u001B[38;5;7mfoo\u001B[0m, \u001B[38;5;12mstring[,]\u001B[0m \u001B[38;5;7mbar)\u001B[0m \u001B[38;5;8min\u001B[0m \u001B[1;38;5;11mExceptions.cs\u001B[0m\u001B[38;5;8m:\u001B[0m\u001B[38;5;12m66\u001B[0m               \r\n  \u001B[38;5;8mat\u001B[0m \u001B[38;5;12mvoid\u001B[0m \u001B[38;5;7mSamples.Exceptions.\u001B[0m\u001B[38;5;11mDoMagic\u001B[0m\u001B[38;5;7m(\u001B[0m\u001B[38;5;12mint\u001B[0m \u001B[38;5;7mfoo\u001B[0m, \u001B[38;5;12mstring[,]\u001B[0m \u001B[38;5;7mbar)\u001B[0m \u001B[38;5;8min\u001B[0m \u001B[1;38;5;11mExceptions.cs\u001B[0m\u001B[38;5;8m:\u001B[0m\u001B[38;5;12m70\u001B[0m                    \r\n  \u001B[38;5;8mat\u001B[0m \u001B[38;5;7mSamples.Exceptions.BaseExceptionSample..\u001B[0m\u001B[38;5;11mctor\u001B[0m\u001B[38;5;7m()\u001B[0m \u001B[38;5;8min\u001B[0m \u001B[1;38;5;11mExceptions.cs\u001B[0m\u001B[38;5;8m:\u001B[0m\u001B[38;5;12m20\u001B[0m                             \r\n"] | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| {"version": 2, "width": 122, "height": 24, "title": "figlet (plain)", "env": {"TERM": "Spectre.Console"}} | {"version": 2, "width": 102, "height": 24, "title": "figlet (plain)", "env": {"TERM": "Spectre.Console"}} | ||||||
| [0, "o", "\u001B[31m  _               __   _               _   _                              _ \u001B[0m                                            \r\n\u001B[31m | |       ___   / _| | |_      __ _  | | (_)   __ _   _ __     ___    __| |\u001B[0m                                            \r\n\u001B[31m | |      / _ \\ | |_  | __|    / _\u0060 | | | | |  / _\u0060 | | \u0027_ \\   / _ \\  / _\u0060 |\u001B[0m                                            \r\n\u001B[31m | |___  |  __/ |  _| | |_    | (_| | | | | | | (_| | | | | | |  __/ | (_| |\u001B[0m                                            \r\n\u001B[31m |_____|  \\___| |_|    \\__|    \\__,_| |_| |_|  \\__, | |_| |_|  \\___|  \\__,_|\u001B[0m                                            \r\n\u001B[31m                                               |___/                        \u001B[0m                                            \r\n"] | [0, "o", "\u001B[31m  _               __   _               _   _                              _ \u001B[0m                        \r\n\u001B[31m | |       ___   / _| | |_      __ _  | | (_)   __ _   _ __     ___    __| |\u001B[0m                        \r\n\u001B[31m | |      / _ \\ | |_  | __|    / _\u0060 | | | | |  / _\u0060 | | \u0027_ \\   / _ \\  / _\u0060 |\u001B[0m                        \r\n\u001B[31m | |___  |  __/ |  _| | |_    | (_| | | | | | | (_| | | | | | |  __/ | (_| |\u001B[0m                        \r\n\u001B[31m |_____|  \\___| |_|    \\__|    \\__,_| |_| |_|  \\__, | |_| |_|  \\___|  \\__,_|\u001B[0m                        \r\n\u001B[31m                                               |___/                        \u001B[0m                        \r\n"] | ||||||
| [0, "o", "                               \u001B[32m   ____                  _                              _ \u001B[0m                               \r\n                               \u001B[32m  / ___|   ___   _ __   | |_    ___   _ __    ___    __| |\u001B[0m                               \r\n                               \u001B[32m | |      / _ \\ | \u0027_ \\  | __|  / _ \\ | \u0027__|  / _ \\  / _\u0060 |\u001B[0m                               \r\n                               \u001B[32m | |___  |  __/ | | | | | |_  |  __/ | |    |  __/ | (_| |\u001B[0m                               \r\n                               \u001B[32m  \\____|  \\___| |_| |_|  \\__|  \\___| |_|     \\___|  \\__,_|\u001B[0m                               \r\n                               \u001B[32m                                                          \u001B[0m                               \r\n"] | [0.016, "o", "                     \u001B[32m   ____                  _                              _ \u001B[0m                     \r\n                     \u001B[32m  / ___|   ___   _ __   | |_    ___   _ __    ___    __| |\u001B[0m                     \r\n                     \u001B[32m | |      / _ \\ | \u0027_ \\  | __|  / _ \\ | \u0027__|  / _ \\  / _\u0060 |\u001B[0m                     \r\n                     \u001B[32m | |___  |  __/ | | | | | |_  |  __/ | |    |  __/ | (_| |\u001B[0m                     \r\n                     \u001B[32m  \\____|  \\___| |_| |_|  \\__|  \\___| |_|     \\___|  \\__,_|\u001B[0m                     \r\n                     \u001B[32m                                                          \u001B[0m                     \r\n"] | ||||||
| [0, "o", "                                     \u001B[34m  ____    _           _       _               _   _                              _ \u001B[0m\r\n                                     \u001B[34m |  _ \\  (_)   __ _  | |__   | |_      __ _  | | (_)   __ _   _ __     ___    __| |\u001B[0m\r\n                                     \u001B[34m | |_) | | |  / _\u0060 | | \u0027_ \\  | __|    / _\u0060 | | | | |  / _\u0060 | | \u0027_ \\   / _ \\  / _\u0060 |\u001B[0m\r\n                                     \u001B[34m |  _ \u003C  | | | (_| | | | | | | |_    | (_| | | | | | | (_| | | | | | |  __/ | (_| |\u001B[0m\r\n                                     \u001B[34m |_| \\_\\ |_|  \\__, | |_| |_|  \\__|    \\__,_| |_| |_|  \\__, | |_| |_|  \\___|  \\__,_|\u001B[0m\r\n                                     \u001B[34m              |___/                                   |___/                        \u001B[0m\r\n"] | [0.016, "o", "                 \u001B[34m  ____    _           _       _               _   _                              _ \u001B[0m\r\n                 \u001B[34m |  _ \\  (_)   __ _  | |__   | |_      __ _  | | (_)   __ _   _ __     ___    __| |\u001B[0m\r\n                 \u001B[34m | |_) | | |  / _\u0060 | | \u0027_ \\  | __|    / _\u0060 | | | | |  / _\u0060 | | \u0027_ \\   / _ \\  / _\u0060 |\u001B[0m\r\n                 \u001B[34m |  _ \u003C  | | | (_| | | | | | | |_    | (_| | | | | | | (_| | | | | | |  __/ | (_| |\u001B[0m\r\n                 \u001B[34m |_| \\_\\ |_|  \\__, | |_| |_|  \\__|    \\__,_| |_| |_|  \\__, | |_| |_|  \\___|  \\__,_|\u001B[0m\r\n                 \u001B[34m              |___/                                   |___/                        \u001B[0m\r\n"] | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| {"version": 2, "width": 122, "height": 24, "title": "figlet (rich)", "env": {"TERM": "Spectre.Console"}} | {"version": 2, "width": 102, "height": 24, "title": "figlet (rich)", "env": {"TERM": "Spectre.Console"}} | ||||||
| [0, "o", "\u001B[38;5;9m  _               __   _               _   _                              _ \u001B[0m                                            \r\n\u001B[38;5;9m | |       ___   / _| | |_      __ _  | | (_)   __ _   _ __     ___    __| |\u001B[0m                                            \r\n\u001B[38;5;9m | |      / _ \\ | |_  | __|    / _\u0060 | | | | |  / _\u0060 | | \u0027_ \\   / _ \\  / _\u0060 |\u001B[0m                                            \r\n\u001B[38;5;9m | |___  |  __/ |  _| | |_    | (_| | | | | | | (_| | | | | | |  __/ | (_| |\u001B[0m                                            \r\n\u001B[38;5;9m |_____|  \\___| |_|    \\__|    \\__,_| |_| |_|  \\__, | |_| |_|  \\___|  \\__,_|\u001B[0m                                            \r\n\u001B[38;5;9m                                               |___/                        \u001B[0m                                            \r\n"] | [0, "o", "\u001B[38;5;9m  _               __   _               _   _                              _ \u001B[0m                        \r\n\u001B[38;5;9m | |       ___   / _| | |_      __ _  | | (_)   __ _   _ __     ___    __| |\u001B[0m                        \r\n\u001B[38;5;9m | |      / _ \\ | |_  | __|    / _\u0060 | | | | |  / _\u0060 | | \u0027_ \\   / _ \\  / _\u0060 |\u001B[0m                        \r\n\u001B[38;5;9m | |___  |  __/ |  _| | |_    | (_| | | | | | | (_| | | | | | |  __/ | (_| |\u001B[0m                        \r\n\u001B[38;5;9m |_____|  \\___| |_|    \\__|    \\__,_| |_| |_|  \\__, | |_| |_|  \\___|  \\__,_|\u001B[0m                        \r\n\u001B[38;5;9m                                               |___/                        \u001B[0m                        \r\n"] | ||||||
| [0, "o", "                               \u001B[38;5;2m   ____                  _                              _ \u001B[0m                               \r\n                               \u001B[38;5;2m  / ___|   ___   _ __   | |_    ___   _ __    ___    __| |\u001B[0m                               \r\n                               \u001B[38;5;2m | |      / _ \\ | \u0027_ \\  | __|  / _ \\ | \u0027__|  / _ \\  / _\u0060 |\u001B[0m                               \r\n                               \u001B[38;5;2m | |___  |  __/ | | | | | |_  |  __/ | |    |  __/ | (_| |\u001B[0m                               \r\n                               \u001B[38;5;2m  \\____|  \\___| |_| |_|  \\__|  \\___| |_|     \\___|  \\__,_|\u001B[0m                               \r\n                               \u001B[38;5;2m                                                          \u001B[0m                               \r\n"] | [0, "o", "                     \u001B[38;5;2m   ____                  _                              _ \u001B[0m                     \r\n                     \u001B[38;5;2m  / ___|   ___   _ __   | |_    ___   _ __    ___    __| |\u001B[0m                     \r\n                     \u001B[38;5;2m | |      / _ \\ | \u0027_ \\  | __|  / _ \\ | \u0027__|  / _ \\  / _\u0060 |\u001B[0m                     \r\n                     \u001B[38;5;2m | |___  |  __/ | | | | | |_  |  __/ | |    |  __/ | (_| |\u001B[0m                     \r\n                     \u001B[38;5;2m  \\____|  \\___| |_| |_|  \\__|  \\___| |_|     \\___|  \\__,_|\u001B[0m                     \r\n                     \u001B[38;5;2m                                                          \u001B[0m                     \r\n"] | ||||||
| [0, "o", "                                     \u001B[38;5;12m  ____    _           _       _               _   _                              _ \u001B[0m\r\n                                     \u001B[38;5;12m |  _ \\  (_)   __ _  | |__   | |_      __ _  | | (_)   __ _   _ __     ___    __| |\u001B[0m\r\n                                     \u001B[38;5;12m | |_) | | |  / _\u0060 | | \u0027_ \\  | __|    / _\u0060 | | | | |  / _\u0060 | | \u0027_ \\   / _ \\  / _\u0060 |\u001B[0m\r\n                                     \u001B[38;5;12m |  _ \u003C  | | | (_| | | | | | | |_    | (_| | | | | | | (_| | | | | | |  __/ | (_| |\u001B[0m\r\n                                     \u001B[38;5;12m |_| \\_\\ |_|  \\__, | |_| |_|  \\__|    \\__,_| |_| |_|  \\__, | |_| |_|  \\___|  \\__,_|\u001B[0m\r\n                                     \u001B[38;5;12m              |___/                                   |___/                        \u001B[0m\r\n"] | [0, "o", "                 \u001B[38;5;12m  ____    _           _       _               _   _                              _ \u001B[0m\r\n                 \u001B[38;5;12m |  _ \\  (_)   __ _  | |__   | |_      __ _  | | (_)   __ _   _ __     ___    __| |\u001B[0m\r\n                 \u001B[38;5;12m | |_) | | |  / _\u0060 | | \u0027_ \\  | __|    / _\u0060 | | | | |  / _\u0060 | | \u0027_ \\   / _ \\  / _\u0060 |\u001B[0m\r\n                 \u001B[38;5;12m |  _ \u003C  | | | (_| | | | | | | |_    | (_| | | | | | | (_| | | | | | |  __/ | (_| |\u001B[0m\r\n                 \u001B[38;5;12m |_| \\_\\ |_|  \\__, | |_| |_|  \\__|    \\__,_| |_| |_|  \\__, | |_| |_|  \\___|  \\__,_|\u001B[0m\r\n                 \u001B[38;5;12m              |___/                                   |___/                        \u001B[0m\r\n"] | ||||||
|  |  | ||||||
|   | |||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -1,3 +1,3 @@ | |||||||
| {"version": 2, "width": 84, "height": 12, "title": "shortened-exception (plain)", "env": {"TERM": "Spectre.Console"}} | {"version": 2, "width": 102, "height": 12, "title": "shortened-exception (plain)", "env": {"TERM": "Spectre.Console"}} | ||||||
| [0, "o", "\u001B[37mInvalidOperationException\u001B[0m: \u001B[1;31mWhaaat?\u001B[0m\r\n     \u001B[37mInvalidCredentialException\u001B[0m: \u001B[1;31mThe credentials are invalid.\u001B[0m                     \r\n       \u001B[37mat\u001B[0m \u001B[37mCheckCredentials\u001B[0m\u001B[37m(\u001B[0m\u001B[34mInt32\u001B[0m \u001B[37mqux\u001B[0m, \u001B[34mString[,]\u001B[0m \u001B[37mcorgi)\u001B[0m \u001B[37min\u001B[0m \u001B]8;id=410110972;file://desktop-9uf41cc/R:/Projects/phil-scott-78/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[1;37mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[37m:\u001B[0m\u001B[34m75\u001B[0m        \r\n       \u001B[37mat\u001B[0m \u001B[37mDoMagic\u001B[0m\u001B[37m(\u001B[0m\u001B[34mInt32\u001B[0m \u001B[37mfoo\u001B[0m, \u001B[34mString[,]\u001B[0m \u001B[37mbar)\u001B[0m \u001B[37min\u001B[0m \u001B]8;id=789130682;file://desktop-9uf41cc/R:/Projects/phil-scott-78/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[1;37mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[37m:\u001B[0m\u001B[34m65\u001B[0m                   \r\n  \u001B[37mat\u001B[0m \u001B[37mDoMagic\u001B[0m\u001B[37m(\u001B[0m\u001B[34mInt32\u001B[0m \u001B[37mfoo\u001B[0m, \u001B[34mString[,]\u001B[0m \u001B[37mbar)\u001B[0m \u001B[37min\u001B[0m \u001B]8;id=154735692;file://desktop-9uf41cc/R:/Projects/phil-scott-78/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[1;37mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[37m:\u001B[0m\u001B[34m69\u001B[0m                        \r\n  \u001B[37mat\u001B[0m \u001B[37mctor\u001B[0m\u001B[37m()\u001B[0m \u001B[37min\u001B[0m \u001B]8;id=580004342;file://desktop-9uf41cc/R:/Projects/phil-scott-78/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[1;37mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[37m:\u001B[0m\u001B[34m19\u001B[0m                                                   \r\n"] | [0, "o", "\u001B[37mInvalidOperationException\u001B[0m: \u001B[1;31mWhaaat?\u001B[0m\r\n     \u001B[37mInvalidCredentialException\u001B[0m: \u001B[1;31mThe credentials are invalid.\u001B[0m                                       \r\n       \u001B[37mat\u001B[0m \u001B[34mvoid\u001B[0m \u001B[37mCheckCredentials\u001B[0m\u001B[37m(\u001B[0m\u001B[34mint\u001B[0m \u001B[37mqux\u001B[0m, \u001B[34mstring[,]\u001B[0m \u001B[37mcorgi)\u001B[0m \u001B[37min\u001B[0m \u001B]8;id=418863998;file://phil-adler/R:/phil-scott/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[1;37mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[37m:\u001B[0m\u001B[34m76\u001B[0m                       \r\n       \u001B[37mat\u001B[0m \u001B[34mvoid\u001B[0m \u001B[37mDoMagic\u001B[0m\u001B[37m(\u001B[0m\u001B[34mint\u001B[0m \u001B[37mfoo\u001B[0m, \u001B[34mstring[,]\u001B[0m \u001B[37mbar)\u001B[0m \u001B[37min\u001B[0m \u001B]8;id=1618669281;file://phil-adler/R:/phil-scott/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[1;37mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[37m:\u001B[0m\u001B[34m66\u001B[0m                                  \r\n  \u001B[37mat\u001B[0m \u001B[34mvoid\u001B[0m \u001B[37mDoMagic\u001B[0m\u001B[37m(\u001B[0m\u001B[34mint\u001B[0m \u001B[37mfoo\u001B[0m, \u001B[34mstring[,]\u001B[0m \u001B[37mbar)\u001B[0m \u001B[37min\u001B[0m \u001B]8;id=112095567;file://phil-adler/R:/phil-scott/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[1;37mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[37m:\u001B[0m\u001B[34m70\u001B[0m                                       \r\n  \u001B[37mat\u001B[0m \u001B[37mctor\u001B[0m\u001B[37m()\u001B[0m \u001B[37min\u001B[0m \u001B]8;id=1341248185;file://phil-adler/R:/phil-scott/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[1;37mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[37m:\u001B[0m\u001B[34m20\u001B[0m                                                                     \r\n"] | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,3 +1,3 @@ | |||||||
| {"version": 2, "width": 84, "height": 12, "title": "shortened-exception (rich)", "env": {"TERM": "Spectre.Console"}} | {"version": 2, "width": 102, "height": 12, "title": "shortened-exception (rich)", "env": {"TERM": "Spectre.Console"}} | ||||||
| [0, "o", "\u001B[38;5;15mInvalidOperationException\u001B[0m: \u001B[1;38;5;9mWhaaat?\u001B[0m\r\n     \u001B[38;5;15mInvalidCredentialException\u001B[0m: \u001B[1;38;5;9mThe credentials are invalid.\u001B[0m                     \r\n       \u001B[38;5;8mat\u001B[0m \u001B[38;5;11mCheckCredentials\u001B[0m\u001B[38;5;7m(\u001B[0m\u001B[38;5;12mInt32\u001B[0m \u001B[38;5;7mqux\u001B[0m, \u001B[38;5;12mString[,]\u001B[0m \u001B[38;5;7mcorgi)\u001B[0m \u001B[38;5;8min\u001B[0m \u001B]8;id=516251861;file://desktop-9uf41cc/R:/Projects/phil-scott-78/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[1;38;5;11mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[38;5;8m:\u001B[0m\u001B[38;5;12m75\u001B[0m        \r\n       \u001B[38;5;8mat\u001B[0m \u001B[38;5;11mDoMagic\u001B[0m\u001B[38;5;7m(\u001B[0m\u001B[38;5;12mInt32\u001B[0m \u001B[38;5;7mfoo\u001B[0m, \u001B[38;5;12mString[,]\u001B[0m \u001B[38;5;7mbar)\u001B[0m \u001B[38;5;8min\u001B[0m \u001B]8;id=256309505;file://desktop-9uf41cc/R:/Projects/phil-scott-78/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[1;38;5;11mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[38;5;8m:\u001B[0m\u001B[38;5;12m65\u001B[0m                   \r\n  \u001B[38;5;8mat\u001B[0m \u001B[38;5;11mDoMagic\u001B[0m\u001B[38;5;7m(\u001B[0m\u001B[38;5;12mInt32\u001B[0m \u001B[38;5;7mfoo\u001B[0m, \u001B[38;5;12mString[,]\u001B[0m \u001B[38;5;7mbar)\u001B[0m \u001B[38;5;8min\u001B[0m \u001B]8;id=694303097;file://desktop-9uf41cc/R:/Projects/phil-scott-78/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[1;38;5;11mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[38;5;8m:\u001B[0m\u001B[38;5;12m69\u001B[0m                        \r\n  \u001B[38;5;8mat\u001B[0m \u001B[38;5;11mctor\u001B[0m\u001B[38;5;7m()\u001B[0m \u001B[38;5;8min\u001B[0m \u001B]8;id=136029960;file://desktop-9uf41cc/R:/Projects/phil-scott-78/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[1;38;5;11mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[38;5;8m:\u001B[0m\u001B[38;5;12m19\u001B[0m                                                   \r\n"] | [0, "o", "\u001B[38;5;15mInvalidOperationException\u001B[0m: \u001B[1;38;5;9mWhaaat?\u001B[0m\r\n     \u001B[38;5;15mInvalidCredentialException\u001B[0m: \u001B[1;38;5;9mThe credentials are invalid.\u001B[0m                                       \r\n       \u001B[38;5;8mat\u001B[0m \u001B[38;5;12mvoid\u001B[0m \u001B[38;5;11mCheckCredentials\u001B[0m\u001B[38;5;7m(\u001B[0m\u001B[38;5;12mint\u001B[0m \u001B[38;5;7mqux\u001B[0m, \u001B[38;5;12mstring[,]\u001B[0m \u001B[38;5;7mcorgi)\u001B[0m \u001B[38;5;8min\u001B[0m \u001B]8;id=248520178;file://phil-adler/R:/phil-scott/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[1;38;5;11mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[38;5;8m:\u001B[0m\u001B[38;5;12m76\u001B[0m                       \r\n       \u001B[38;5;8mat\u001B[0m \u001B[38;5;12mvoid\u001B[0m \u001B[38;5;11mDoMagic\u001B[0m\u001B[38;5;7m(\u001B[0m\u001B[38;5;12mint\u001B[0m \u001B[38;5;7mfoo\u001B[0m, \u001B[38;5;12mstring[,]\u001B[0m \u001B[38;5;7mbar)\u001B[0m \u001B[38;5;8min\u001B[0m \u001B]8;id=122011838;file://phil-adler/R:/phil-scott/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[1;38;5;11mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[38;5;8m:\u001B[0m\u001B[38;5;12m66\u001B[0m                                  \r\n  \u001B[38;5;8mat\u001B[0m \u001B[38;5;12mvoid\u001B[0m \u001B[38;5;11mDoMagic\u001B[0m\u001B[38;5;7m(\u001B[0m\u001B[38;5;12mint\u001B[0m \u001B[38;5;7mfoo\u001B[0m, \u001B[38;5;12mstring[,]\u001B[0m \u001B[38;5;7mbar)\u001B[0m \u001B[38;5;8min\u001B[0m \u001B]8;id=732431604;file://phil-adler/R:/phil-scott/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[1;38;5;11mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[38;5;8m:\u001B[0m\u001B[38;5;12m70\u001B[0m                                       \r\n  \u001B[38;5;8mat\u001B[0m \u001B[38;5;11mctor\u001B[0m\u001B[38;5;7m()\u001B[0m \u001B[38;5;8min\u001B[0m \u001B]8;id=1471369749;file://phil-adler/R:/phil-scott/spectre.console/resources/scripts/Generator/Commands/AsciiCast/Samples/Exceptions.cs\u001B\\\u001B[1;38;5;11mExceptions.cs\u001B[0m\u001B]8;;\u001B\\\u001B[38;5;8m:\u001B[0m\u001B[38;5;12m20\u001B[0m                                                                     \r\n"] | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										6
									
								
								docs/input/assets/casts/text-path-plain.cast
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								docs/input/assets/casts/text-path-plain.cast
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | |||||||
|  | {"version": 2, "width": 42, "height": 23, "title": "text-path (plain)", "env": {"TERM": "Spectre.Console"}} | ||||||
|  | [0, "o", "\u001B[37m\u250C\u2500Windows path\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u001B[0m\r\n\u001B[37m\u2502\u001B[0m                                      \u001B[37m\u2502\u001B[0m\r\n\u001B[37m\u2502\u001B[0m C:/.../That/Will/Be/Truncated.txt    \u001B[37m\u2502\u001B[0m\r\n\u001B[37m\u2502\u001B[0m                                      \u001B[37m\u2502\u001B[0m\r\n\u001B[37m\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\u001B[0m\r\n"] | ||||||
|  | [0.015, "o", "\u001B[37m\u250C\u2500Unix path\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u001B[0m\r\n\u001B[37m\u2502\u001B[0m                                      \u001B[37m\u2502\u001B[0m\r\n\u001B[37m\u2502\u001B[0m /.../That/Will/Be/Truncated.txt      \u001B[37m\u2502\u001B[0m\r\n\u001B[37m\u2502\u001B[0m                                      \u001B[37m\u2502\u001B[0m\r\n\u001B[37m\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\u001B[0m\r\n"] | ||||||
|  | [0.015, "o", "\u001B[37m\u250C\u2500Styling\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u001B[0m\r\n\u001B[37m\u2502\u001B[0m                                      \u001B[37m\u2502\u001B[0m\r\n\u001B[37m\u2502\u001B[0m \u001B[32m/\u001B[0m\u001B[37m...\u001B[0m\u001B[31m/\u001B[0m\u001B[37mThat\u001B[0m\u001B[31m/\u001B[0m\u001B[37mWill\u001B[0m\u001B[31m/\u001B[0m\u001B[37mBe\u001B[0m\u001B[31m/\u001B[0m\u001B[34mTruncated.txt\u001B[0m      \u001B[37m\u2502\u001B[0m\r\n\u001B[37m\u2502\u001B[0m                                      \u001B[37m\u2502\u001B[0m\r\n\u001B[37m\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\u001B[0m\r\n"] | ||||||
|  | [0.015, "o", "\u001B[37m\u250C\u2500Alignment\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u001B[0m\r\n\u001B[37m\u2502\u001B[0m                                      \u001B[37m\u2502\u001B[0m\r\n\u001B[37m\u2502\u001B[0m /.../That/Will/Be/Truncated.txt      \u001B[37m\u2502\u001B[0m\r\n\u001B[37m\u2502\u001B[0m   /.../That/Will/Be/Truncated.txt    \u001B[37m\u2502\u001B[0m\r\n\u001B[37m\u2502\u001B[0m      /.../That/Will/Be/Truncated.txt \u001B[37m\u2502\u001B[0m\r\n\u001B[37m\u2502\u001B[0m                                      \u001B[37m\u2502\u001B[0m\r\n\u001B[37m\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\u001B[0m\r\n"] | ||||||
|  |  | ||||||
							
								
								
									
										6
									
								
								docs/input/assets/casts/text-path-rich.cast
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								docs/input/assets/casts/text-path-rich.cast
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | |||||||
|  | {"version": 2, "width": 42, "height": 23, "title": "text-path (rich)", "env": {"TERM": "Spectre.Console"}} | ||||||
|  | [0, "o", "\u001B[38;5;8m\u250C\u2500Windows path\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u001B[0m\r\n\u001B[38;5;8m\u2502\u001B[0m                                      \u001B[38;5;8m\u2502\u001B[0m\r\n\u001B[38;5;8m\u2502\u001B[0m C:/\u2026/Path/That/Will/Be/Truncated.txt \u001B[38;5;8m\u2502\u001B[0m\r\n\u001B[38;5;8m\u2502\u001B[0m                                      \u001B[38;5;8m\u2502\u001B[0m\r\n\u001B[38;5;8m\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\u001B[0m\r\n"] | ||||||
|  | [0, "o", "\u001B[38;5;8m\u250C\u2500Unix path\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u001B[0m\r\n\u001B[38;5;8m\u2502\u001B[0m                                      \u001B[38;5;8m\u2502\u001B[0m\r\n\u001B[38;5;8m\u2502\u001B[0m /\u2026/Path/That/Will/Be/Truncated.txt   \u001B[38;5;8m\u2502\u001B[0m\r\n\u001B[38;5;8m\u2502\u001B[0m                                      \u001B[38;5;8m\u2502\u001B[0m\r\n\u001B[38;5;8m\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\u001B[0m\r\n"] | ||||||
|  | [0, "o", "\u001B[38;5;8m\u250C\u2500Styling\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u001B[0m\r\n\u001B[38;5;8m\u2502\u001B[0m                                      \u001B[38;5;8m\u2502\u001B[0m\r\n\u001B[38;5;8m\u2502\u001B[0m \u001B[38;5;2m/\u001B[0m\u001B[38;5;11m\u2026\u001B[0m\u001B[38;5;9m/\u001B[0m\u001B[38;5;11mPath\u001B[0m\u001B[38;5;9m/\u001B[0m\u001B[38;5;11mThat\u001B[0m\u001B[38;5;9m/\u001B[0m\u001B[38;5;11mWill\u001B[0m\u001B[38;5;9m/\u001B[0m\u001B[38;5;11mBe\u001B[0m\u001B[38;5;9m/\u001B[0m\u001B[38;5;12mTruncated.txt\u001B[0m   \u001B[38;5;8m\u2502\u001B[0m\r\n\u001B[38;5;8m\u2502\u001B[0m                                      \u001B[38;5;8m\u2502\u001B[0m\r\n\u001B[38;5;8m\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\u001B[0m\r\n"] | ||||||
|  | [0, "o", "\u001B[38;5;8m\u250C\u2500Alignment\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u001B[0m\r\n\u001B[38;5;8m\u2502\u001B[0m                                      \u001B[38;5;8m\u2502\u001B[0m\r\n\u001B[38;5;8m\u2502\u001B[0m /\u2026/Path/That/Will/Be/Truncated.txt   \u001B[38;5;8m\u2502\u001B[0m\r\n\u001B[38;5;8m\u2502\u001B[0m  /\u2026/Path/That/Will/Be/Truncated.txt  \u001B[38;5;8m\u2502\u001B[0m\r\n\u001B[38;5;8m\u2502\u001B[0m   /\u2026/Path/That/Will/Be/Truncated.txt \u001B[38;5;8m\u2502\u001B[0m\r\n\u001B[38;5;8m\u2502\u001B[0m                                      \u001B[38;5;8m\u2502\u001B[0m\r\n\u001B[38;5;8m\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\u001B[0m\r\n"] | ||||||
|  |  | ||||||
| @@ -7,8 +7,7 @@ | |||||||
| <metadata> | <metadata> | ||||||
| Created by potrace 1.16, written by Peter Selinger 2001-2019 | Created by potrace 1.16, written by Peter Selinger 2001-2019 | ||||||
| </metadata> | </metadata> | ||||||
| <g transform="translate(0.000000,1270.000000) scale(0.100000,-0.100000)" | <g transform="translate(0.000000,1270.000000) scale(0.100000,-0.100000)"> | ||||||
| fill="#000000" stroke="none"> |  | ||||||
| <path d="M799 10610 c-199 -48 -354 -191 -414 -383 l-25 -78 0 -3084 0 -3084 | <path d="M799 10610 c-199 -48 -354 -191 -414 -383 l-25 -78 0 -3084 0 -3084 | ||||||
| 25 -79 c45 -141 155 -270 289 -335 124 -61 -80 -57 2819 -57 l2646 0 5 -43 c3 | 25 -79 c45 -141 155 -270 289 -335 124 -61 -80 -57 2819 -57 l2646 0 5 -43 c3 | ||||||
| -23 8 -71 11 -105 13 -137 88 -334 179 -471 57 -85 187 -219 247 -254 25 -15 | -23 8 -71 11 -105 13 -137 88 -334 179 -471 57 -85 187 -219 247 -254 25 -15 | ||||||
|   | |||||||
| Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.5 KiB | 
							
								
								
									
										122
									
								
								docs/input/best-practices.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										122
									
								
								docs/input/best-practices.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,122 @@ | |||||||
|  | Title: Best Practices | ||||||
|  | Order: 21 | ||||||
|  | Description: Best practices when working with Spectre.Console and how to troubleshoot when things go wrong. | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Spectre.Console works hard to make writing console applications easier for developers. | ||||||
|  | It is designed to be easy to use and to be flexible, but there are some things that can be a bit tricky. | ||||||
|  |  | ||||||
|  | ## Output | ||||||
|  |  | ||||||
|  | Spectre.Console has a number of output methods and functions, but they rely on the user's console to render. | ||||||
|  |  | ||||||
|  | Many things make up what a console can render. | ||||||
|  |  | ||||||
|  | * It's output encoding. | ||||||
|  | * The console font. | ||||||
|  | * The size of the windows. | ||||||
|  | * The codepage. | ||||||
|  | * The terminal itself. | ||||||
|  | * The console's background color. | ||||||
|  |  | ||||||
|  | Many of these items can be auto-detected by Spectre.Console. | ||||||
|  | Some of these items can only be configured by the user and cannot be detected automatically. | ||||||
|  |  | ||||||
|  | Spectre.Console can detect the following items: | ||||||
|  |  | ||||||
|  | * Output encoding: the built-in widgets will use the encoding that is detected to fallback when needed when UTF-8 is not | ||||||
|  |   detected e.g. if a `Table` is configured to use a rounded border, but a | ||||||
|  |   user's output encoding does not support the extended ASCII characters then a fallback set of characters will be used. | ||||||
|  | * Size of the windows: at the time of writing to the screen, Spectre.Console will know the number of characters when | ||||||
|  |   writing full-width widths. | ||||||
|  | * Most terminals: Spectre.Console will try to detect the running Console and match | ||||||
|  |   their [capabilities](xref:T:Spectre.Console.Capabilities). | ||||||
|  |  | ||||||
|  | Things that cannot be detected automatically: | ||||||
|  |  | ||||||
|  | * Console font: Spectre.Console will assume a relatively modern and fixed width font. If a user's console font is not | ||||||
|  |   fixed width, then the output for some items such as `Table` will be incorrect. | ||||||
|  |   The supported characters can also vary between fonts, especially with some modern features like Powerline characters | ||||||
|  |   and NerdFonts. | ||||||
|  | * The background color and configured foreground colors. | ||||||
|  |  | ||||||
|  | ### Output Best Practices | ||||||
|  |  | ||||||
|  | **Do** test your application in multiple terminals. On Windows machines, the built-in `cmd.exe` and `Windows Terminal` | ||||||
|  | both work well for a variety of capabilities. | ||||||
|  |  | ||||||
|  | **Do not** hard-code emojis and extended unicode characters in your code as default output strings. | ||||||
|  | There is no guarantee that the user's console will support them and Spectre.Console will not be able to fall back | ||||||
|  | automatically. | ||||||
|  | To ensure the widest level of support for various terminals, allow users to either opt in to the use of extended unicode | ||||||
|  | characters or, depending on the type of application, | ||||||
|  | allow the user to customize the output and configure those characters by hand. | ||||||
|  |  | ||||||
|  | **Do not** assume a user's background color is black. | ||||||
|  | It can be any color, including white. | ||||||
|  | While Spectre.Console allows you to use up to 24-bit colors, don't assume they'll look good when displayed on the user's | ||||||
|  | console. If you stick to the standard 16 ANSI colors, | ||||||
|  | Spectre.Console will tell your terminal to use the color that is configured in the user's terminal theme. | ||||||
|  | If you are using an 8 or 24-bit color for the foreground text, it is recommended that you also set an appropriate | ||||||
|  | background color to match. | ||||||
|  |  | ||||||
|  | **Do** escape data when outputting any user input or any external data via Markup using the [`EscapeMarkup`](xref:M:Spectre.Console.Markup.Escape(System.String)) method on the data. Any user input containing `[` or `]` will likely cause a runtime error while rendering otherwise. | ||||||
|  |  | ||||||
|  | **Consider** replacing `Markup` and `MarkupLine` with [`MarkupInterpolated`](xref:M:Spectre.Console.AnsiConsole.MarkupInterpolated(System.FormattableString)) and [`MarkupLineInterpolated`](xref:M:Spectre.Console.AnsiConsole.MarkupLineInterpolated(System.FormattableString)). Both these methods will automatically escape all data in the interpolated string holes. When working with widgets such as the Table and Tree, consider using [`Markup.FromInterpolated`](xref:M:Spectre.Console.Markup.FromInterpolated(System.FormattableString,Spectre.Console.Style)) to generate an `IRenderable` from an interpolated string. | ||||||
|  |  | ||||||
|  | ### Live-Rendering Best Practices | ||||||
|  |  | ||||||
|  | Spectre.Console has a variety of [live-rendering capabilities](live) widgets. These widgets can be used to display data | ||||||
|  | that are updated and refreshed on the user's console. | ||||||
|  | To do so, the widget rendering has a render loop that writes to the screen and then erases the previous output before | ||||||
|  | writing again. | ||||||
|  |  | ||||||
|  | **Do** keep your rendering logic as simple as possible on a single thread. Rendering additional content while a live | ||||||
|  | rendering is in progress can cause the rendering to be corrupted. | ||||||
|  |  | ||||||
|  | **Do not** use multiple live-rendering widgets simultaneously. Like the previous tip, displaying a `Status` control and | ||||||
|  | a `Progress` is not supported and can cause rendering corruption. | ||||||
|  |  | ||||||
|  | **Do** create additional work threads within the `Start` method, **but** render on the main thread. | ||||||
|  | For items such as a progress bar, multiple threads or tasks can be created from the `Start` method for concurrent | ||||||
|  | execution. To ensure proper rendering, ensure that calls to update the widgets are done | ||||||
|  | on the main thread. | ||||||
|  |  | ||||||
|  | ### Unit Testing Best Practices | ||||||
|  |  | ||||||
|  | For testing of console output, Spectre.Console has [`IAnsiConsole`](xref:T:Spectre.Console.IAnsiConsole) that can be | ||||||
|  | injected into your application. | ||||||
|  | The [Spectre.Console.Test](https://www.nuget.org/packages/Spectre.Console.Testing/) contains a set of utilities for | ||||||
|  | capturing the output for verification, either manually or via a tool such | ||||||
|  | as [Verify](https://github.com/VerifyTests/Verify). | ||||||
|  |  | ||||||
|  | ### Analyzer for Best Practices | ||||||
|  |  | ||||||
|  | Spectre.Console has an [analyzer](https://www.nuget.org/packages/Spectre.Console.Analyzer) that helps prevent some | ||||||
|  | common errors in writing console output from above such as using multiple live rendering widgets simultaneously, | ||||||
|  | or using the static `AnsiConsole` class when `IAnsiConsole` is available. | ||||||
|  |  | ||||||
|  | ### Configuring the Windows Terminal For Unicode and Emoji Support | ||||||
|  |  | ||||||
|  | Windows Terminal supports Unicode and Emoji. However, the shells such as Powershell and cmd.exe do not. | ||||||
|  | For the difference between the two, | ||||||
|  | see [What's the difference between a console, | ||||||
|  | a terminal and a shell](https://www.hanselman.com/blog/whats-the-difference-between-a-console-a-terminal-and-a-shell). | ||||||
|  |  | ||||||
|  | For PowerShell, the following command will enable Unicode and Emoji support. You can add this to your `profile.ps1` | ||||||
|  | file: | ||||||
|  |  | ||||||
|  | ```powershell | ||||||
|  | [console]::InputEncoding = [console]::OutputEncoding = [System.Text.UTF8Encoding]::new() | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | For cmd.exe, the following steps are required to enable Unicode and Emoji support. | ||||||
|  |  | ||||||
|  | 1. Run `intl.cpl`. | ||||||
|  | 2. Click the Administrative tab | ||||||
|  | 3. Click the Change system locale button. | ||||||
|  | 4. Check the "Use Unicode UTF-8 for worldwide language support" checkbox. | ||||||
|  | 5. Reboot. | ||||||
|  |  | ||||||
|  | You will also need to ensure that your Console application is configured to use a font that supports Unicode and Emoji, | ||||||
|  | such as Cascadia Code.   | ||||||
| @@ -1,9 +1,9 @@ | |||||||
| ArchiveSources: => $"blog/posts/**/*" | ArchiveSources: blog/posts/**/* | ||||||
| ArchiveKey: Category | ArchiveKey: Category | ||||||
| ArchiveKeyComparer: => StringComparer.OrdinalIgnoreCase.ToConvertingEqualityComparer() | ArchiveKeyComparer: => StringComparer.OrdinalIgnoreCase.ToConvertingEqualityComparer() | ||||||
| ArchiveDestination: > | ArchiveDestination: > | ||||||
|   => GetInt("Index") <= 1 ? $"blog/{NormalizedPath.OptimizeFileName(GetString("GroupKey"))}/index.html" : $"blog/{NormalizedPath.OptimizeFileName(GetString("GroupKey"))}/{GetInt("Index")}.html" |   => GetInt("Index") <= 1 ? $"blog/{NormalizedPath.OptimizeFileName(GetString("GroupKey"))}/index.html" : $"blog/{NormalizedPath.OptimizeFileName(GetString("GroupKey"))}/{GetInt("Index")}.html" | ||||||
| ArchivePageSize: => 5 | ArchivePageSize: 5 | ||||||
| ArchiveOrderKey: published | ArchiveOrderKey: published | ||||||
| ArchiveOrderDescending: true | ArchiveOrderDescending: true | ||||||
| Title: Categories | Title: Categories | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| Title: Recent Blog Posts | Title: Recent Blog Posts | ||||||
| ArchiveSources: => $"blog/posts/**/*" | ArchiveSources: blog/posts/**/* | ||||||
| ArchiveDestination: > | ArchiveDestination: > | ||||||
|   => GetInt("Index") <= 1 ? $"blog/index.html" : $"blog/{GetInt("Index")}.html" |   => GetInt("Index") <= 1 ? $"blog/index.html" : $"blog/{GetInt("Index")}.html" | ||||||
| ArchivePageSize: => 5 | ArchivePageSize: 5 | ||||||
| ArchiveOrderKey: Published | ArchiveOrderKey: Published | ||||||
| ArchiveOrderDescending: true | ArchiveOrderDescending: true | ||||||
| Hidden: > | Hidden: > | ||||||
|   | |||||||
| @@ -1,6 +1,4 @@ | |||||||
|  |  | ||||||
| @inherits StatiqRazorPage<IDocument> | @inherits StatiqRazorPage<IDocument> | ||||||
| @model IDocument |  | ||||||
|  |  | ||||||
| @{ | @{ | ||||||
|     var older = Model.GetDocument(Keys.Next); |     var older = Model.GetDocument(Keys.Next); | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| @inherits StatiqRazorPage<IEnumerable<IDocument>> | @inherits StatiqRazorPage<IEnumerable<IDocument>> | ||||||
| @foreach (var post in Model) | @foreach (var post in Model ?? Array.Empty<IDocument>()) | ||||||
| { | { | ||||||
|     <div> |     <div> | ||||||
|         <h3 class="mb-0"><a href="@Context.GetLink(post)">@post.GetString("Title")</a></h3> |         <h3 class="mb-0"><a href="@Context.GetLink(post)">@post.GetString("Title")</a></h3> | ||||||
| @@ -19,7 +19,7 @@ | |||||||
|             @if (category != null) { |             @if (category != null) { | ||||||
|                 var categoryUrl = @Context.GetLink($"blog/{NormalizedPath.OptimizeFileName(category)}/index.html"); |                 var categoryUrl = @Context.GetLink($"blog/{NormalizedPath.OptimizeFileName(category)}/index.html"); | ||||||
|                 <span> |                 <span> | ||||||
|                     to <a class="text-blue-800 underline" href="@categoryUrl"> |                     to <a href="@categoryUrl"> | ||||||
|                         @category |                         @category | ||||||
|                     </a> |                     </a> | ||||||
|                 </span> |                 </span> | ||||||
|   | |||||||
| @@ -0,0 +1,24 @@ | |||||||
|  | Title: Spectre.Console 0.41 released! | ||||||
|  | Description: In this release we (mostly Phil) have been focusing on getting the new fancy Roslyn Analyzers out the door... | ||||||
|  | Published: 20210719 | ||||||
|  | Category: Release Notes | ||||||
|  | Excluded: false | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | In this release, we (mostly [Phil](https://twitter.com/philco78)) have been focusing on getting the new fancy Roslyn Analyzers out the door. | ||||||
|  | If you want to try them out, add a reference to [Spectre.Console.Analyzer](https://www.nuget.org/packages/spectre.console.analyzer) in your project, and you should get some best practice tips in your favorite IDE! | ||||||
|  |  | ||||||
|  | It's summer in the northern hemisphere, so it will probably be a couple of weeks until the next release. | ||||||
|  |  | ||||||
|  | ## Features | ||||||
|  |  | ||||||
|  | * [#417 - Support cancellation in prompts](https://github.com/spectreconsole/spectre.console/issues/417) | ||||||
|  | * [#324 - Remove AsciiTreeGuide as default tree guide](https://github.com/spectreconsole/spectre.console/issues/324) | ||||||
|  | * [#413 - Support custom characters at the end of a TextPrompt](https://github.com/spectreconsole/spectre.console/issues/413) | ||||||
|  | * [#447 - Alternative to the obsolete 'Select' function for selecting default items in SelectionPrompt](https://github.com/spectreconsole/spectre.console/issues/447) | ||||||
|  | * [#460 - Default values for Ask()](https://github.com/spectreconsole/spectre.console/issues/460) | ||||||
|  |  | ||||||
|  | ## Bugs | ||||||
|  |  | ||||||
|  | * [#480 - IAnsiConsole.Confirm extension is missing default value parameter](https://github.com/spectreconsole/spectre.console/issues/480) | ||||||
|  | * [#442 - Allow dynamic Figlet hardblank](https://github.com/spectreconsole/spectre.console/pull/442) | ||||||
| @@ -0,0 +1,59 @@ | |||||||
|  | Title: Spectre.Console 0.43 released! | ||||||
|  | Description: Now with .NET 6 support... and more! | ||||||
|  | Published: 20211216 | ||||||
|  | Category: Release Notes | ||||||
|  | Excluded: false | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | We forgot (😅) to publish the release notes for `0.42`, so we've included them as well. | ||||||
|  | Noteworthy in this release is that `Spectre.Console` now ships with [.NET 6](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) support. | ||||||
|  |  | ||||||
|  | ## New Contributors | ||||||
|  | * [@mgnslndh](https://github.com/mgnslndh) made their first contribution in [#584](https://github.com/spectreconsole/spectre.console/pull/584) | ||||||
|  | * [@LiamSho](https://github.com/LiamSho) made their first contribution in [#509](https://github.com/spectreconsole/spectre.console/pull/509) | ||||||
|  | * [@kzu](https://github.com/kzu) made their first contribution in [#514](https://github.com/spectreconsole/spectre.console/pull/514) | ||||||
|  | * [@GitHubPang](https://github.com/GitHubPang) made their first contribution in [#535](https://github.com/spectreconsole/spectre.console/pull/535) | ||||||
|  | * [@RedEyedDog](https://github.com/RedEyedDog) made their first contribution in [#546](https://github.com/spectreconsole/spectre.console/pull/546) | ||||||
|  | * [@rifatx](https://github.com/rifatx) made their first contribution in [#545](https://github.com/spectreconsole/spectre.console/pull/545) | ||||||
|  |  | ||||||
|  | ## What's Changed | ||||||
|  |  | ||||||
|  | * Update sponsors.md by [@mgnslndh](https://github.com/mgnslndh) in [#584](https://github.com/spectreconsole/spectre.console/pull/584) | ||||||
|  | * Upgrades Statiq and re-enables docs publishing by [@phil-scott-78](https://github.com/phil-scott-78) in [#591](https://github.com/spectreconsole/spectre.console/pull/591) | ||||||
|  | * Internalizes the `WcWidth` package by [@patriksvensson](https://github.com/patriksvensson) in [#593](https://github.com/spectreconsole/spectre.console/pull/593) | ||||||
|  | * Small typos in the `Getting Started` page by [@antoniovalentini](https://github.com/antoniovalentini) in [#597](https://github.com/spectreconsole/spectre.console/pull/597) | ||||||
|  | * Add net6.0 TFM by [@patriksvensson](https://github.com/patriksvensson) in [#603](https://github.com/spectreconsole/spectre.console/pull/603) | ||||||
|  | * Fix a typo in code comment by [@GitHubPang](https://github.com/GitHubPang) in [#579](https://github.com/spectreconsole/spectre.console/pull/579) | ||||||
|  | * Added `GetParent` and `GetParents` to `MultiSelectionPrompt` by [@nils-a](https://github.com/nils-a) in [#590](https://github.com/spectreconsole/spectre.console/pull/590) | ||||||
|  | * Added ExceptionHandler to `ICommandAppSettings` by [@nils-a](https://github.com/nils-a) in [#607](https://github.com/spectreconsole/spectre.console/pull/607) | ||||||
|  | * Fixed documentation for selection and multiselection (#499) by [@nils-a](https://github.com/nils-a) in [#589](https://github.com/spectreconsole/spectre.console/pull/589) | ||||||
|  | * Escape any Markup when displaying selected prompt items by [@nils-a](https://github.com/nils-a) in [#610](https://github.com/spectreconsole/spectre.console/pull/610) | ||||||
|  | * Upgrade .NET SDK to 6.0.100 by [@patriksvensson](https://github.com/patriksvensson) in [#616](https://github.com/spectreconsole/spectre.console/pull/616) | ||||||
|  | * Allow color numbers in markup expressions by [@patriksvensson](https://github.com/patriksvensson) in [#615](https://github.com/spectreconsole/spectre.console/pull/615) | ||||||
|  | * Remove `Render` from docs in favor of `Write` by [@patriksvensson](https://github.com/patriksvensson) in [#613](https://github.com/spectreconsole/spectre.console/pull/613) | ||||||
|  | * Clarify `ITypeResolver` returns `null` by [@nils-a](https://github.com/nils-a) in [#620](https://github.com/spectreconsole/spectre.console/pull/620) | ||||||
|  | * Fix typo in `PairDeconstructor` class name by [@0xced](https://github.com/0xced) in [#619](https://github.com/spectreconsole/spectre.console/pull/619) | ||||||
|  | * Fix type conversion in the default pair deconstructor implementation by [@0xced](https://github.com/0xced) in [#618](https://github.com/spectreconsole/spectre.console/pull/618) | ||||||
|  | * Update examples to net6.0 by [@patriksvensson](https://github.com/patriksvensson) in [#625](https://github.com/spectreconsole/spectre.console/pull/625) | ||||||
|  | * Fix exception formatting for generic methods by [@0xced](https://github.com/0xced) in [#639](https://github.com/spectreconsole/spectre.console/pull/639) | ||||||
|  | * Use browser context for social cards by [@phil-scott-78](https://github.com/phil-scott-78) in [#490](https://github.com/spectreconsole/spectre.console/pull/490) | ||||||
|  | * Adds additional check that analyzer is within a method by [@phil-scott-78](https://github.com/phil-scott-78) in [#488](https://github.com/spectreconsole/spectre.console/pull/488) | ||||||
|  | * Add support for manipulating individual table rows by [@patriksvensson](https://github.com/patriksvensson) in [#503](https://github.com/spectreconsole/spectre.console/pull/503) | ||||||
|  | * Do not share semaphore between consoles by [@patriksvensson](https://github.com/patriksvensson) in [#507](https://github.com/spectreconsole/spectre.console/pull/507) | ||||||
|  | * Fix `ArgumentOutOfRangeExceptio` when rendering a table by [@LiamSho](https://github.com/LiamSho) in [#507](https://github.com/spectreconsole/spectre.console/pull/509) | ||||||
|  | * Make building more flexible by allowing feature bands by [@kzu](https://github.com/kzu) in [#514](https://github.com/spectreconsole/spectre.console/pull/514) | ||||||
|  | * Fix parsing of exceptions on .NET Framework by [@0xced](https://github.com/0xced) in [#513](https://github.com/spectreconsole/spectre.console/pull/513) | ||||||
|  | * Fix the style parameter nullable annotation on `AnsiConsoleExtensions` by [@0xced](https://github.com/0xced) in [#527](https://github.com/spectreconsole/spectre.console/pull/527) | ||||||
|  | * Fix 404 in documentation by [@nils-a](https://github.com/nils-a) in [#530](https://github.com/spectreconsole/spectre.console/pull/530) | ||||||
|  | * Fix typos in code comments by [@GitHubPang](https://github.com/GitHubPang) in [#535](https://github.com/spectreconsole/spectre.console/pull/535) | ||||||
|  | * Remove additional registration of `ICommand` by [@nils-a](https://github.com/nils-a) in [#533](https://github.com/spectreconsole/spectre.console/pull/533) | ||||||
|  | * Add extension methods to get cell width of `char` and `string` by [@patriksvensson](https://github.com/patriksvensson) in [#523](https://github.com/spectreconsole/spectre.console/pull/523) | ||||||
|  | * Disable GH Action workflow for docs by [@patriksvensson](https://github.com/patriksvensson) in [#547](https://github.com/spectreconsole/spectre.console/pull/547) | ||||||
|  | * Fix typos in docs by [@GitHubPang](https://github.com/GitHubPang) in [#542](https://github.com/spectreconsole/spectre.console/pull/542) | ||||||
|  | * Add a segment builder for merging multiple segments by [@phil-scott-78](https://github.com/phil-scott-78) in [#552](https://github.com/spectreconsole/spectre.console/pull/552) | ||||||
|  | * Allow user to update table cell by [@RedEyedDog](https://github.com/RedEyedDog) in [#546](https://github.com/spectreconsole/spectre.console/pull/546) | ||||||
|  | * Fix a minor typo for `Spectre1021` by [@GitHubPang](https://github.com/GitHubPang) in [#557](https://github.com/spectreconsole/spectre.console/pull/557) | ||||||
|  | * Future-proof conditional compilation by [@0xced](https://github.com/0xced) in [#563](https://github.com/spectreconsole/spectre.console/pull/563) | ||||||
|  | * Add support custom max value for barcharts by [@rifatx](https://github.com/rifatx) in [#545](https://github.com/spectreconsole/spectre.console/pull/545) | ||||||
|  | * Improve the error message when acquiring the interactive semaphore fails by [@0xced](https://github.com/0xced) in [#569](https://github.com/spectreconsole/spectre.console/pull/569) | ||||||
|  | * Add `AnsiConsole.Write` method by [@patriksvensson](https://github.com/patriksvensson) in [#577](https://github.com/spectreconsole/spectre.console/pull/577) | ||||||
| @@ -20,7 +20,7 @@ | |||||||
|     } |     } | ||||||
|     @if (category != null) { |     @if (category != null) { | ||||||
|         <span> |         <span> | ||||||
|             to <a class="text-blue-800 underline" href="@Context.GetLink($"blog/{NormalizedPath.OptimizeFileName(@category)}/index.html")"> |             to <a href="@Context.GetLink($"blog/{NormalizedPath.OptimizeFileName(@category)}/index.html")"> | ||||||
|                 @category |                 @category | ||||||
|             </a> |             </a> | ||||||
|         </span> |         </span> | ||||||
|   | |||||||
| @@ -1,6 +1,9 @@ | |||||||
| Title: CommandApp | Title: CommandApp | ||||||
| Order: 2 | Order: 2 | ||||||
| Description: "**CommandApp** is the entry point for a *Spectre.Console.Cli* command line application. It is used to configure the settings and commands used for execution of the application." | Description: "**CommandApp** is the entry point for a *Spectre.Console.Cli* command line application. It is used to configure the settings and commands used for execution of the application." | ||||||
|  | Reference: | ||||||
|  |     - T:Spectre.Console.Cli.CommandApp | ||||||
|  |     - T:Spectre.Console.Cli.CommandApp`1 | ||||||
| --- | --- | ||||||
|  |  | ||||||
| `CommandApp` is the entry point for a `Spectre.Console.Cli` command line application. It is used to configure the settings and commands used for execution of the application. Most `Spectre.Console.Cli` applications will need to specify a custom configuration using the `Configure` method. | `CommandApp` is the entry point for a `Spectre.Console.Cli` command line application. It is used to configure the settings and commands used for execution of the application. Most `Spectre.Console.Cli` applications will need to specify a custom configuration using the `Configure` method. | ||||||
| @@ -20,7 +23,7 @@ app.Configure(config => | |||||||
|  |  | ||||||
| ## Multiple Commands | ## Multiple Commands | ||||||
|  |  | ||||||
| In the previous example we have a single command that is configured. For complex command line applications, it is common for them to have multiple commands (or verbs) defined. Examples of applications like this are `git`, `dotnet` and `gh`. For example, git would have an `commit` command and along with other commits like `add` or `rebase`. Each with their own settings and validation. With `Spectre.Console.Cli` we use the `Configure` method to add these commands. | In the previous example we have a single command that is configured. For complex command line applications, it is common for them to have multiple commands (or verbs) defined. Examples of applications like this are `git`, `dotnet` and `gh`. For example, git would have a `commit` command and along with other commits like `add` or `rebase`. Each with their own settings and validation. With `Spectre.Console.Cli` we use the `Configure` method to add these commands. | ||||||
|  |  | ||||||
| For example, to add three different commands to the application: | For example, to add three different commands to the application: | ||||||
|  |  | ||||||
| @@ -34,7 +37,7 @@ app.Configure(config => | |||||||
| }); | }); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| This configuration would allow users to run `app.exe add`, `app.exe commit`, or `app.exe rebase` and have the settings routed the appropriate command. | This configuration would allow users to run `app.exe add`, `app.exe commit`, or `app.exe rebase` and have the settings routed to the appropriate command. | ||||||
|  |  | ||||||
| For more complex command hierarchical configurations, they can also be composed via inheritance and branching. See [Composing Commands](./composing). | For more complex command hierarchical configurations, they can also be composed via inheritance and branching. See [Composing Commands](./composing). | ||||||
|  |  | ||||||
| @@ -50,7 +53,7 @@ app.Configure(config => | |||||||
|         .IsHidden() |         .IsHidden() | ||||||
|         .WithAlias("file-size") |         .WithAlias("file-size") | ||||||
|         .WithDescription("Gets the file size for a directory.") |         .WithDescription("Gets the file size for a directory.") | ||||||
|         .WithExample(new[] {"c:\\windows", "--pattern", "*.dll"}); |         .WithExample(new[] {"size", "c:\\windows", "--pattern", "*.dll"}); | ||||||
| }); | }); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| @@ -74,9 +77,12 @@ return app.Run(args); | |||||||
|  |  | ||||||
| `TypeRegistrar` is a custom class that must be created by the user. This [example using `Microsoft.Extensions.DependencyInjection` as the container](https://github.com/spectreconsole/spectre.console/tree/main/examples/Cli/Injection) provides an example `TypeRegistrar` and `TypeResolver` that can be added to your application with small adjustments for your DI container. | `TypeRegistrar` is a custom class that must be created by the user. This [example using `Microsoft.Extensions.DependencyInjection` as the container](https://github.com/spectreconsole/spectre.console/tree/main/examples/Cli/Injection) provides an example `TypeRegistrar` and `TypeResolver` that can be added to your application with small adjustments for your DI container. | ||||||
|  |  | ||||||
|  | Hint: If you do write your own implementation of `TypeRegistrar` and `TypeResolver` and you have some form of unit tests in place for your project, | ||||||
|  | there is a utility `TypeRegistrarBaseTests` available that can be used to ensure your implementations adhere to the required implementation. Simply call `TypeRegistrarBaseTests.RunAllTests()` and expect no `TypeRegistrarBaseTests.TestFailedException` to be thrown. | ||||||
|  |  | ||||||
| ## Interception | ## Interception | ||||||
|  |  | ||||||
| `CommandApp` also provides a `SetInterceptor` configuration. An interceptor is ran before all commands are executed. This is typically used for configuring logging or other infrastructure concerns. | `CommandApp` also provides a `SetInterceptor` configuration. An interceptor is run before all commands are executed. This is typically used for configuring logging or other infrastructure concerns. | ||||||
|  |  | ||||||
| All interceptors must implement `ICommandInterceptor`. Upon execution of a command, an instance of your interceptor will be called with the parsed settings. This provides an opportunity for configuring any infrastructure or modifying the settings. | All interceptors must implement `ICommandInterceptor`. Upon execution of a command, an instance of your interceptor will be called with the parsed settings. This provides an opportunity for configuring any infrastructure or modifying the settings. | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,9 +1,12 @@ | |||||||
| Title: Creating Commands | Title: Creating Commands | ||||||
| Order: 6 | Order: 6 | ||||||
| Description: "How to create commands for *Spectre.Console.Cli*" | 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 | ```csharp | ||||||
| public class HelloCommand : Command<HelloCommand.Settings> | public class HelloCommand : Command<HelloCommand.Settings> | ||||||
| @@ -25,7 +28,7 @@ public class HelloCommand : Command<HelloCommand.Settings> | |||||||
|  |  | ||||||
| ## Configuring | ## Configuring | ||||||
|  |  | ||||||
| Commands are configured via the [`CommandApp`](commandApp)'s `Configure` method. | Commands are configured via the [`CommandApp`](commandapp)'s `Configure` method. | ||||||
|  |  | ||||||
| ```csharp | ```csharp | ||||||
| var app = new CommandApp(); | var app = new CommandApp(); | ||||||
| @@ -45,7 +48,7 @@ app.Configure(config => | |||||||
|  |  | ||||||
| ## Dependency Injection | ## Dependency Injection | ||||||
|  |  | ||||||
| Constructor injection is supported on commands. See the [`CommandApp`](commandApp) documentation for further information on configuring `Spectre.Console` for your container. | Constructor injection is supported on commands. See the [`CommandApp`](commandapp) documentation for further information on configuring `Spectre.Console` for your container. | ||||||
|  |  | ||||||
| ## Validation | ## Validation | ||||||
|  |  | ||||||
|   | |||||||
| @@ -111,7 +111,7 @@ Now you might wonder, why do things like this? Well, for starters the different | |||||||
| of the application are separated, while still having the option to share things like options, | of the application are separated, while still having the option to share things like options, | ||||||
| flags and arguments between them. | flags and arguments between them. | ||||||
|  |  | ||||||
| This make the resulting code very clean and easy to navigate, not to mention to unit test. | This makes the resulting code very clean and easy to navigate, not to mention to unit test. | ||||||
| And most importantly at all, the type system guides me to do the right thing. I can't configure  | And most importantly at all, the type system guides me to do the right thing. I can't configure  | ||||||
| commands in non-compatible ways, and if I want to add a new top-level `add-package` command  | commands in non-compatible ways, and if I want to add a new top-level `add-package` command  | ||||||
| (or move the command completely), it's just a single line to change. This makes it easy to  | (or move the command completely), it's just a single line to change. This makes it easy to  | ||||||
|   | |||||||
							
								
								
									
										116
									
								
								docs/input/cli/exceptions.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										116
									
								
								docs/input/cli/exceptions.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,116 @@ | |||||||
|  | Title: Exceptions | ||||||
|  | Order: 12 | ||||||
|  | Description: "Handling exceptions in *Spectre.Console.Cli*" | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Exceptions happen.  | ||||||
|  |  | ||||||
|  | `Spectre.Console.Cli` handles exceptions, writes a user friendly message to the console and sets the exitCode | ||||||
|  | of the application to `-1`. | ||||||
|  | While this might be enough for the needs of most applications, there are some options to customize this behavior. | ||||||
|  |  | ||||||
|  | ## Propagating exceptions | ||||||
|  |  | ||||||
|  | The most basic way is to set `PropagateExceptions()` during configuration and handle everything. | ||||||
|  | While this option grants the most freedom, it also requires the most work: Setting `PropagateExceptions` | ||||||
|  | means that `Spectre.Console.Cli` effectively re-throws exceptions. | ||||||
|  | This means that `app.Run()` should be wrapped in a `try`-`catch`-block which has to handle the exception | ||||||
|  | (i.e. outputting something useful) and also provide the exitCode (or `return` value) for the application. | ||||||
|  |  | ||||||
|  | ```csharp | ||||||
|  | using Spectre.Console.Cli; | ||||||
|  |  | ||||||
|  | namespace MyApp | ||||||
|  | { | ||||||
|  |     public static class Program | ||||||
|  |     { | ||||||
|  |         public static int Main(string[] args) | ||||||
|  |         { | ||||||
|  |             var app = new CommandApp<FileSizeCommand>(); | ||||||
|  |  | ||||||
|  |             app.Configure(config => | ||||||
|  |             { | ||||||
|  |                 config.PropagateExceptions(); | ||||||
|  |             }); | ||||||
|  |  | ||||||
|  |             try | ||||||
|  |             { | ||||||
|  |                 return app.Run(args); | ||||||
|  |             } | ||||||
|  |             catch (Exception ex) | ||||||
|  |             { | ||||||
|  |                 AnsiConsole.WriteException(ex, ExceptionFormats.ShortenEverything); | ||||||
|  |                 return -99; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ## Using a custom ExceptionHandler | ||||||
|  |  | ||||||
|  | Using the `SetErrorHandler()` during configuration it is possible to handle exceptions in a defined way. | ||||||
|  | This method comes in two flavours: One that uses the default exitCode (or `return` value) of `-1` and one | ||||||
|  | where the exitCode needs to be supplied. | ||||||
|  |  | ||||||
|  | ### Using `SetErrorHandler(Func<Exception, int> handler)` | ||||||
|  |  | ||||||
|  | Using this method exceptions can be handled in a custom way. The return value of the handler is used as | ||||||
|  | the exitCode for the application. | ||||||
|  |  | ||||||
|  | ```csharp | ||||||
|  | using Spectre.Console.Cli; | ||||||
|  |  | ||||||
|  | namespace MyApp | ||||||
|  | { | ||||||
|  |     public static class Program | ||||||
|  |     { | ||||||
|  |         public static int Main(string[] args) | ||||||
|  |         { | ||||||
|  |             var app = new CommandApp<FileSizeCommand>(); | ||||||
|  |  | ||||||
|  |             app.Configure(config => | ||||||
|  |             { | ||||||
|  |                 config.SetExceptionHandler(ex => | ||||||
|  |                 { | ||||||
|  |                     AnsiConsole.WriteException(ex, ExceptionFormats.ShortenEverything); | ||||||
|  |                     return -99; | ||||||
|  |                 }); | ||||||
|  |             }); | ||||||
|  |  | ||||||
|  |             return app.Run(args); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Using `SetErrorHandler(Action<Exception> handler)` | ||||||
|  |  | ||||||
|  | Using this method exceptions can be handled in a custom way, much the same as with the `SetErrorHandler(Func<Exception, int> handler)`. | ||||||
|  | Using the `Action` as the handler however, it is not possible (or required) to supply a return value. | ||||||
|  | The exitCode for the application will be `-1`. | ||||||
|  |  | ||||||
|  | ```csharp | ||||||
|  | using Spectre.Console.Cli; | ||||||
|  |  | ||||||
|  | namespace MyApp | ||||||
|  | { | ||||||
|  |     public static class Program | ||||||
|  |     { | ||||||
|  |         public static int Main(string[] args) | ||||||
|  |         { | ||||||
|  |             var app = new CommandApp<FileSizeCommand>(); | ||||||
|  |  | ||||||
|  |             app.Configure(config => | ||||||
|  |             { | ||||||
|  |                 config.SetExceptionHandler(ex => | ||||||
|  |                 { | ||||||
|  |                     AnsiConsole.WriteException(ex, ExceptionFormats.ShortenEverything); | ||||||
|  |                 }); | ||||||
|  |             }); | ||||||
|  |  | ||||||
|  |             return app.Run(args); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | ``` | ||||||
| @@ -61,13 +61,13 @@ In our `Main()` method, an instance of `Spectre.Console.Cli`'s  `CommandApp` is | |||||||
|  |  | ||||||
| This command will have three parameters. | This command will have three parameters. | ||||||
|  |  | ||||||
| * The main parameter for the command will be the path. This is to be passed in as the first argument without needing to specify any command line flags. To configure that setting, use the `CommandArgument` attribute. The `[searchPath]` parameters of `CommandArgument` drives not only how the built in help display will render the help text, but the square brackets tells `Spectre.Console.Cli` that this argument is optional through convention. | * The main parameter for the command will be the path. This is to be passed in as the first argument without needing to specify any command line flags. To configure that setting, use the `CommandArgument` attribute. The `[searchPath]` parameter of `CommandArgument` drives not only how the built in help display will render the help text, but the square brackets tells `Spectre.Console.Cli` that this argument is optional through convention. | ||||||
| * The second will be specified as a parameter option. The `CommandOption` attribute is used to specify this action along with the option command line flag. In the case of `SearchPattern` both `-p` and `--path` are valid. | * The second will be specified as a parameter option. The `CommandOption` attribute is used to specify this action along with the option command line flag. In the case of `SearchPattern` both `-p` and `--pattern` are valid. | ||||||
| * The third will also be a parameter option. Here `DefaultValue` is used to indicate the default value will be `true`. For boolean parameters these will be interpreted as flags which means the user can just specify `--hidden` rather than `-hidden true`. | * The third will also be a parameter option. Here `DefaultValue` is used to indicate the default value will be `true`. For boolean parameters these will be interpreted as flags which means the user can just specify `--hidden` rather than `-hidden true`. | ||||||
|  |  | ||||||
| When `args` is passed into the `CommandApp`'s run method, `Spectre.Console.Cli` will parse those arguments and populate an instance of your settings. Upon success, it will then pass those settings into an instance of the specified command's `Execute` method. | When `args` is passed into the `CommandApp`'s run method, `Spectre.Console.Cli` will parse those arguments and populate an instance of your settings. Upon success, it will then pass those settings into an instance of the specified command's `Execute` method. | ||||||
|  |  | ||||||
| With this in place, we can the following commands will all work | With this in place, the following commands will all work | ||||||
|  |  | ||||||
| ```text | ```text | ||||||
| app.exe | app.exe | ||||||
| @@ -78,6 +78,6 @@ app.exe c:\windows --hidden --pattern *.dll | |||||||
|  |  | ||||||
| Much more is possible. You can have multiple commands per application, settings can be customized and extended and the default behavior of the `CommandApp` can be extended and customized. | Much more is possible. You can have multiple commands per application, settings can be customized and extended and the default behavior of the `CommandApp` can be extended and customized. | ||||||
|  |  | ||||||
| * See [CommandApp](./commandApp) for customizing how Spectre.Console.Cli builds the settings. | * See [CommandApp](./commandapp) for customizing how Spectre.Console.Cli builds the settings. | ||||||
| * See [Create Commands](./commands) for information about different command types and their configurations. | * See [Create Commands](./commands) for information about different command types and their configurations. | ||||||
| * See [Specifying Settings](./settings) for information about defining the settings. | * See [Specifying Settings](./settings) for information about defining the settings. | ||||||
|   | |||||||
| @@ -117,7 +117,7 @@ Now you might wonder, why do things like this? Well, for starters the different | |||||||
| of the application are separated, while still having the option to share things like options, | of the application are separated, while still having the option to share things like options, | ||||||
| flags and arguments between them. | flags and arguments between them. | ||||||
|  |  | ||||||
| This make the resulting code very clean and easy to navigate, not to mention to unit test. | This makes the resulting code very clean and easy to navigate, not to mention to unit test. | ||||||
| And most importantly at all, the type system guides me to do the right thing. I can't configure  | And most importantly at all, the type system guides me to do the right thing. I can't configure  | ||||||
| commands in non-compatible ways, and if I want to add a new top-level `add-package` command  | commands in non-compatible ways, and if I want to add a new top-level `add-package` command  | ||||||
| (or move the command completely), it's just a single line to change. This makes it easy to  | (or move the command completely), it's just a single line to change. This makes it easy to  | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| Title: Migrate from Spectre.Cli | Title: Migrate from Spectre.Cli | ||||||
| Order: 10 | Order: 10 | ||||||
| Description: "Migrating from *Specte.Cli* to *Spectre.Console.Cli*" | Description: "Migrating from *Spectre.Cli* to *Spectre.Console.Cli*" | ||||||
| --- | --- | ||||||
|  |  | ||||||
| The functionality in `Spectre.Cli` has been moved into the `Spectre.Console` | The functionality in `Spectre.Cli` has been moved into the `Spectre.Console` | ||||||
| @@ -26,7 +26,7 @@ Add the [Spectre.Console](https://www.nuget.org/packages/spectre.console) NuGet | |||||||
| ## 3. Change using statements | ## 3. Change using statements | ||||||
|  |  | ||||||
| Change all using statements from `Spectre.Cli`  | Change all using statements from `Spectre.Cli`  | ||||||
| to `Spectre.Console.CLi`. | to `Spectre.Console.Cli`. | ||||||
|  |  | ||||||
| ```diff | ```diff | ||||||
| - using Spectre.Cli; | - using Spectre.Cli; | ||||||
|   | |||||||
| @@ -1,6 +1,10 @@ | |||||||
| Title: Specifying Settings | Title: Specifying Settings | ||||||
| Order: 5 | Order: 5 | ||||||
| Description: "How to define command line argument settings for your *Spectre.Console.Cli* Commands" | Description: "How to define command line argument settings for your *Spectre.Console.Cli* Commands" | ||||||
|  | Reference:  | ||||||
|  |     - T:Spectre.Console.Cli.CommandSettings | ||||||
|  |     - T:Spectre.Console.Cli.CommandArgumentAttribute | ||||||
|  |     - T:Spectre.Console.Cli.CommandOptionAttribute | ||||||
| --- | --- | ||||||
|  |  | ||||||
| Settings for `Spectre.Console.Cli` commands are defined via classes that inherit from `CommandSettings`. Attributes are used to indicate how the parser interprets the command line arguments and create a runtime instance of the settings to be used. | Settings for `Spectre.Console.Cli` commands are defined via classes that inherit from `CommandSettings`. Attributes are used to indicate how the parser interprets the command line arguments and create a runtime instance of the settings to be used. | ||||||
| @@ -11,10 +15,10 @@ Example: | |||||||
| public sealed class MyCommandSettings : CommandSettings | public sealed class MyCommandSettings : CommandSettings | ||||||
| { | { | ||||||
|     [CommandArgument(0, "[name]")] |     [CommandArgument(0, "[name]")] | ||||||
|     public string Name { get; set; } |     public string? Name { get; set; } | ||||||
|  |  | ||||||
|     [CommandOption("-c|--count")] |     [CommandOption("-c|--count")] | ||||||
|     public int Count { get; set; } |     public int? Count { get; set; } | ||||||
| } | } | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| @@ -22,7 +26,7 @@ This setting file tells `Spectre.Console.Cli` that our command has two parameter | |||||||
|  |  | ||||||
| ## CommandArgument | ## CommandArgument | ||||||
|  |  | ||||||
| Arguments have a position and a name. The name is not only used for generating help, but it's formatting is used to determine whether or not the argument is optional. The name must either be surrounded by square brackets (e.g. `[name]`) or angle brackets (e.g. `<name>`). Angle brackets denote required whereas square brackets denote optional. If neither are specified an exception will be thrown. | Arguments have a position and a name. The name is not only used for generating help, but its formatting is used to determine whether or not the argument is optional. The name must either be surrounded by square brackets (e.g. `[name]`) or angle brackets (e.g. `<name>`). Angle brackets denote required whereas square brackets denote optional. If neither are specified an exception will be thrown. | ||||||
|  |  | ||||||
| The position is used for scenarios where there could be more than one argument. | The position is used for scenarios where there could be more than one argument. | ||||||
|  |  | ||||||
| @@ -33,7 +37,7 @@ For example, we could split the above name argument into two values with an opti | |||||||
| public string FirstName { get; set; } | public string FirstName { get; set; } | ||||||
|  |  | ||||||
| [CommandArgument(1, "[lastName]")] | [CommandArgument(1, "[lastName]")] | ||||||
| public string LastName { get; set; } | public string? LastName { get; set; } | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ## CommandOption | ## CommandOption | ||||||
| @@ -50,7 +54,16 @@ There is a special mode for `CommandOptions` on boolean types. Typically all `Co | |||||||
|  |  | ||||||
| ```csharp | ```csharp | ||||||
| [CommandOption("--debug")] | [CommandOption("--debug")] | ||||||
| public bool Debug { get; set; } | public bool? Debug { get; set; } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Hidden options | ||||||
|  |  | ||||||
|  | `CommandOptions` can be hidden from being rendered in help by setting `IsHidden` to `true`. | ||||||
|  |  | ||||||
|  | ```csharp | ||||||
|  | [CommandOption("--hidden-opt", IsHidden = true)] | ||||||
|  | public bool? HiddenOpt { get; set; } | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ## Description | ## Description | ||||||
| @@ -87,7 +100,7 @@ Would allow the user to run `app.exe Dwayne Elizondo "Mountain Dew" Herbert Cama | |||||||
| `Spectre.Console.Cli` supports constructor initialization and init only initialization. For constructor initialization, the parameter name of the constructor must match the name of the property name of the settings class. Order does not matter. | `Spectre.Console.Cli` supports constructor initialization and init only initialization. For constructor initialization, the parameter name of the constructor must match the name of the property name of the settings class. Order does not matter. | ||||||
|  |  | ||||||
| ```csharp | ```csharp | ||||||
| public class Settings | public class Settings : CommandSettings | ||||||
| { | { | ||||||
|     public Settings(string[] name) |     public Settings(string[] name) | ||||||
|     { |     { | ||||||
| @@ -96,18 +109,18 @@ public class Settings | |||||||
|  |  | ||||||
|     [Description("The name to display")] |     [Description("The name to display")] | ||||||
|     [CommandArgument(0, "[Name]")] |     [CommandArgument(0, "[Name]")] | ||||||
|     public string Name { get; } |     public string? Name { get; } | ||||||
| } | } | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| Also supported are init only properties. | Also supported are init only properties. | ||||||
|  |  | ||||||
| ```csharp | ```csharp | ||||||
| public class Settings | public class Settings : CommandSettings | ||||||
| { | { | ||||||
|     [Description("The name to display")] |     [Description("The name to display")] | ||||||
|     [CommandArgument(0, "[Name]")] |     [CommandArgument(0, "[Name]")] | ||||||
|     public string Name { get; init; } |     public string? Name { get; init; } | ||||||
| } | } | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| @@ -116,11 +129,11 @@ public class Settings | |||||||
| Simple type validation is performed automatically, but for scenarios where more complex validation is required, overriding the `Validate` method is supported. This method must return either `ValidationResult.Error` or `ValidationResult.Success`. | Simple type validation is performed automatically, but for scenarios where more complex validation is required, overriding the `Validate` method is supported. This method must return either `ValidationResult.Error` or `ValidationResult.Success`. | ||||||
|  |  | ||||||
| ```csharp | ```csharp | ||||||
| public class Settings | public class Settings : CommandSettings | ||||||
| { | { | ||||||
|     [Description("The name to display")] |     [Description("The name to display")] | ||||||
|     [CommandArgument(0, "[Name]")] |     [CommandArgument(0, "[Name]")] | ||||||
|     public string Name { get; init; } |     public string? Name { get; init; } | ||||||
|  |  | ||||||
|     public override ValidationResult Validate() |     public override ValidationResult Validate() | ||||||
|     { |     { | ||||||
|   | |||||||
| @@ -4,6 +4,10 @@ Description: "Exceptions aren't always readable when viewed in the terminal. You | |||||||
| Highlights: | Highlights: | ||||||
|     - Color coded output. |     - Color coded output. | ||||||
|     - Shorten long identifiers and paths. |     - Shorten long identifiers and paths. | ||||||
|  | Reference: | ||||||
|  |     - M:Spectre.Console.AnsiConsole.WriteException(System.Exception,Spectre.Console.ExceptionFormats) | ||||||
|  |     - M:Spectre.Console.AnsiConsole.WriteException(System.Exception,Spectre.Console.ExceptionSettings) | ||||||
|  |  | ||||||
| --- | --- | ||||||
|  |  | ||||||
| Exceptions aren't always readable when viewed in the terminal.   | Exceptions aren't always readable when viewed in the terminal.   | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| Title: Welcome | Title: Welcome! | ||||||
| Description: Spectre.Console is a .NET Standard 2.0 library that makes it easier to create beautiful console applications. | Description: Spectre.Console is a .NET Standard 2.0 library that makes it easier to create beautiful console applications. | ||||||
| Order: 0 | Order: 0 | ||||||
| --- | --- | ||||||
|   | |||||||
| @@ -4,13 +4,15 @@ Description: "*Spectre.Console* can update arbitrary widgets in-place." | |||||||
| Highlights: | Highlights: | ||||||
|     - Update tables or graphs with new updates. |     - Update tables or graphs with new updates. | ||||||
|     - Create a custom progress bar that extends the existing control. |     - Create a custom progress bar that extends the existing control. | ||||||
|  | Reference:  | ||||||
|  |     - T:Spectre.Console.LiveDisplay | ||||||
|  |     - M:Spectre.Console.AnsiConsole.Live(Spectre.Console.Rendering.IRenderable) | ||||||
| --- | --- | ||||||
|  |  | ||||||
| Spectre.Console can update arbitrary widgets in-place. | Spectre.Console can update arbitrary widgets in-place using the [Live Display](xref:T:Spectre.Console.LiveDisplay) widget. | ||||||
|  |  | ||||||
| <?# AsciiCast cast="live" /?> | <?# AsciiCast cast="live" /?> | ||||||
|  |  | ||||||
|  |  | ||||||
| <?# Alert ?> | <?# Alert ?> | ||||||
|   The live display is not  |   The live display is not  | ||||||
|   thread safe, and using it together with other interactive components such as  |   thread safe, and using it together with other interactive components such as  | ||||||
|   | |||||||
| @@ -6,6 +6,9 @@ Highlights: | |||||||
|     - Custom styling of progress bars. |     - Custom styling of progress bars. | ||||||
|     - Multiple predefined columns such as Throughput, Estimated Time Remaining, and more. |     - Multiple predefined columns such as Throughput, Estimated Time Remaining, and more. | ||||||
|     - Fallback for non-interactive consoles such as CI runners. |     - Fallback for non-interactive consoles such as CI runners. | ||||||
|  | Reference:  | ||||||
|  |     - T:Spectre.Console.Progress | ||||||
|  |     - M:Spectre.Console.AnsiConsole.Progress | ||||||
| --- | --- | ||||||
|  |  | ||||||
| Spectre.Console can display information about long running tasks in the console.  | Spectre.Console can display information about long running tasks in the console.  | ||||||
|   | |||||||
| @@ -5,6 +5,9 @@ Description: "*Spectre.Console* can display information about long running tasks | |||||||
| Highlights:  | Highlights:  | ||||||
|     - Custom spinner control for running tasks. |     - Custom spinner control for running tasks. | ||||||
|     - Fallback for non-interactive consoles such as CI runners. |     - Fallback for non-interactive consoles such as CI runners. | ||||||
|  | Reference: | ||||||
|  |     - T:Spectre.Console.Status | ||||||
|  |     - M:Spectre.Console.AnsiConsole.Status | ||||||
| --- | --- | ||||||
|  |  | ||||||
| Spectre.Console can display information about long running tasks in the console.  | Spectre.Console can display information about long running tasks in the console.  | ||||||
|   | |||||||
| @@ -5,6 +5,10 @@ Highlights: | |||||||
|  - Easily add *color*. |  - Easily add *color*. | ||||||
|  - Add hyperlinks to for supported terminals. |  - Add hyperlinks to for supported terminals. | ||||||
|  - Emoji 🚀 parsing. |  - Emoji 🚀 parsing. | ||||||
|  | Reference: | ||||||
|  |  - M:Spectre.Console.AnsiConsole.Markup(System.String) | ||||||
|  |  - M:Spectre.Console.AnsiConsole.MarkupLine(System.String) | ||||||
|  |  - T:Spectre.Console.Markup | ||||||
| --- | --- | ||||||
|  |  | ||||||
| The `Markup` class allows you to output rich text to the console. | The `Markup` class allows you to output rich text to the console. | ||||||
| @@ -15,7 +19,7 @@ Console markup uses a syntax inspired by bbcode. If you write the style (see [St | |||||||
| in square brackets, e.g. `[bold red]`, that style will apply until it is closed with a `[/]`. | in square brackets, e.g. `[bold red]`, that style will apply until it is closed with a `[/]`. | ||||||
|  |  | ||||||
| ```csharp | ```csharp | ||||||
| AnsiConsole.Render(new Markup("[bold yellow]Hello[/] [red]World![/]")); | AnsiConsole.Write(new Markup("[bold yellow]Hello[/] [red]World![/]")); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| The `Markup` class implements `IRenderable` which means that you  | The `Markup` class implements `IRenderable` which means that you  | ||||||
| @@ -26,7 +30,7 @@ rendering of `IRenderable` also have overloads for rendering rich text. | |||||||
| var table = new Table(); | var table = new Table(); | ||||||
| table.AddColumn(new TableColumn(new Markup("[yellow]Foo[/]"))); | table.AddColumn(new TableColumn(new Markup("[yellow]Foo[/]"))); | ||||||
| table.AddColumn(new TableColumn("[blue]Bar[/]")); | table.AddColumn(new TableColumn("[blue]Bar[/]")); | ||||||
| AnsiConsole.Render(table); | AnsiConsole.Write(table); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ## Convenience methods | ## Convenience methods | ||||||
| @@ -59,6 +63,15 @@ You can also use the `Markup.Escape` method. | |||||||
| ```csharp | ```csharp | ||||||
| AnsiConsole.Markup("[red]{0}[/]", Markup.Escape("Hello [World]")); | AnsiConsole.Markup("[red]{0}[/]", Markup.Escape("Hello [World]")); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
|  | ## Escaping Interpolated Strings | ||||||
|  |  | ||||||
|  | When working with interpolated string, you can use the `MarkupInterpolated` and `MarkupInterpolatedLine` methods to automatically escape the values in the interpolated string holes. | ||||||
|  |  | ||||||
|  | ```csharp | ||||||
|  | AnsiConsole.MarkupInterpolated("[red]{0}[/]", "Hello [World]"); | ||||||
|  | ``` | ||||||
|  |  | ||||||
| ## Setting background color | ## Setting background color | ||||||
|  |  | ||||||
| You can set the background color in markup by prefixing the color with | You can set the background color in markup by prefixing the color with | ||||||
| @@ -81,7 +94,7 @@ For a list of emoji, see the [Emojis](xref:emojis) appendix section. | |||||||
|  |  | ||||||
| ## Colors | ## Colors | ||||||
|  |  | ||||||
| In the examples above, all colors was referenced by their name, | In the examples above, all colors were referenced by their name, | ||||||
| but you can also use the hex or rgb representation for colors in markdown. | but you can also use the hex or rgb representation for colors in markdown. | ||||||
|  |  | ||||||
| ```csharp | ```csharp | ||||||
|   | |||||||
| @@ -12,8 +12,7 @@ one or many items from a provided list. | |||||||
|  |  | ||||||
| <?# AsciiCast cast="multi-selection" /?> | <?# AsciiCast cast="multi-selection" /?> | ||||||
|  |  | ||||||
| <?# Alert ?> The use of prompts  | <?# Alert ?> The use of prompts inside status or progress displays is not supported. | ||||||
|   insides status or progress displays is not supported. |  | ||||||
| <?#/ Alert ?> | <?#/ Alert ?> | ||||||
|  |  | ||||||
| ## Usage | ## Usage | ||||||
| @@ -29,9 +28,8 @@ var fruits = AnsiConsole.Prompt( | |||||||
|         .InstructionsText( |         .InstructionsText( | ||||||
|             "[grey](Press [blue]<space>[/] to toggle a fruit, " +  |             "[grey](Press [blue]<space>[/] to toggle a fruit, " +  | ||||||
|             "[green]<enter>[/] to accept)[/]") |             "[green]<enter>[/] to accept)[/]") | ||||||
|         .AddChoice("Apple") |  | ||||||
|         .AddChoices(new[] { |         .AddChoices(new[] { | ||||||
|             "Apricot", "Avocado",  |             "Apple", "Apricot", "Avocado",  | ||||||
|             "Banana", "Blackcurrant", "Blueberry", |             "Banana", "Blackcurrant", "Blueberry", | ||||||
|             "Cherry", "Cloudberry", "Cocunut", |             "Cherry", "Cloudberry", "Cocunut", | ||||||
|         })); |         })); | ||||||
|   | |||||||
| @@ -1,6 +1,9 @@ | |||||||
| Title: Selection | Title: Selection | ||||||
| Order: 1 | Order: 1 | ||||||
| Description: "The **SelectionPrompt** can be used when you want the user to select a single item from a provided list." | Description: "The **SelectionPrompt** can be used when you want the user to select a single item from a provided list." | ||||||
|  | Reference:  | ||||||
|  |     - T:Spectre.Console.SelectionPrompt`1 | ||||||
|  |     - M:Spectre.Console.AnsiConsole.Prompt``1(Spectre.Console.IPrompt{``0}) | ||||||
| --- | --- | ||||||
|  |  | ||||||
| The `SelectionPrompt` can be used when you want the user to select | The `SelectionPrompt` can be used when you want the user to select | ||||||
| @@ -22,9 +25,8 @@ var fruit = AnsiConsole.Prompt( | |||||||
|         .Title("What's your [green]favorite fruit[/]?") |         .Title("What's your [green]favorite fruit[/]?") | ||||||
|         .PageSize(10) |         .PageSize(10) | ||||||
|         .MoreChoicesText("[grey](Move up and down to reveal more fruits)[/]") |         .MoreChoicesText("[grey](Move up and down to reveal more fruits)[/]") | ||||||
|         .AddChoice("Apple") |  | ||||||
|         .AddChoices(new[] { |         .AddChoices(new[] { | ||||||
|             "Apricot", "Avocado",  |             "Apple", "Apricot", "Avocado",  | ||||||
|             "Banana", "Blackcurrant", "Blueberry", |             "Banana", "Blackcurrant", "Blueberry", | ||||||
|             "Cherry", "Cloudberry", "Cocunut", |             "Cherry", "Cloudberry", "Cocunut", | ||||||
|         })); |         })); | ||||||
|   | |||||||
| @@ -21,26 +21,15 @@ you can use the `Prompt<TResult>`. | |||||||
|  |  | ||||||
| ## Confirmation | ## Confirmation | ||||||
|  |  | ||||||
| ```csharp | <?# Example symbol="M:Prompt.Program.AskConfirmation" project="Prompt" /?> | ||||||
| if (!AnsiConsole.Confirm("Run example?")) |  | ||||||
| { |  | ||||||
|     return; |  | ||||||
| } |  | ||||||
| ``` |  | ||||||
|  |  | ||||||
| ```text | ```text | ||||||
| Run example? [y/n] (y): _ | Run prompt example? [y/n] (y): _ | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ## Simple | ## Simple | ||||||
|  |  | ||||||
| ```csharp | <?# Example symbol="M:Prompt.Program.AskName" project="Prompt" /?> | ||||||
| // Ask for the user's name |  | ||||||
| string name = AnsiConsole.Ask<string>("What's your [green]name[/]?"); |  | ||||||
|  |  | ||||||
| // Ask for the user's age |  | ||||||
| int age = AnsiConsole.Ask<int>("What's your [green]age[/]?"); |  | ||||||
| ``` |  | ||||||
|  |  | ||||||
| ```text | ```text | ||||||
| What's your name? Patrik | What's your name? Patrik | ||||||
| @@ -49,15 +38,7 @@ What's your age? 37 | |||||||
|  |  | ||||||
| ## Choices | ## Choices | ||||||
|  |  | ||||||
| ```csharp | <?# Example symbol="M:Prompt.Program.AskFruit" project="Prompt" /?> | ||||||
| var fruit = AnsiConsole.Prompt( |  | ||||||
|     new TextPrompt<string>("What's your [green]favorite fruit[/]?") |  | ||||||
|         .InvalidChoiceMessage("[red]That's not a valid fruit[/]") |  | ||||||
|         .DefaultValue("Orange") |  | ||||||
|         .AddChoice("Apple") |  | ||||||
|         .AddChoice("Banana") |  | ||||||
|         .AddChoice("Orange")); |  | ||||||
| ``` |  | ||||||
|  |  | ||||||
| ```text | ```text | ||||||
| What's your favorite fruit? [Apple/Banana/Orange] (Orange): _ | What's your favorite fruit? [Apple/Banana/Orange] (Orange): _ | ||||||
| @@ -65,19 +46,7 @@ What's your favorite fruit? [Apple/Banana/Orange] (Orange): _ | |||||||
|  |  | ||||||
| ## Validation | ## Validation | ||||||
|  |  | ||||||
| ```csharp | <?# Example symbol="M:Prompt.Program.AskAge" project="Prompt" /?> | ||||||
| var age = AnsiConsole.Prompt( |  | ||||||
|     new TextPrompt<int>("What's the secret number?") |  | ||||||
|         .Validate(age => |  | ||||||
|         { |  | ||||||
|             return age switch |  | ||||||
|             { |  | ||||||
|                 < 99 => ValidationResult.Error("[red]Too low[/]"), |  | ||||||
|                 > 99 => ValidationResult.Error("[red]Too high[/]"), |  | ||||||
|                 _ => ValidationResult.Success(), |  | ||||||
|             }; |  | ||||||
|         })); |  | ||||||
| ``` |  | ||||||
|  |  | ||||||
| ```text | ```text | ||||||
| What's the secret number? 32 | What's the secret number? 32 | ||||||
| @@ -89,12 +58,8 @@ What's the secret number? _ | |||||||
|  |  | ||||||
| ## Secrets | ## Secrets | ||||||
|  |  | ||||||
| ```csharp | <?# Example symbol="M:Prompt.Program.AskPassword" project="Prompt" /?> | ||||||
| var password = AnsiConsole.Prompt( |  | ||||||
|     new TextPrompt<string>("Enter [green]password[/]") |  | ||||||
|         .PromptStyle("red") |  | ||||||
|         .Secret()); |  | ||||||
| ``` |  | ||||||
|  |  | ||||||
| ```text | ```text | ||||||
| Enter password: ************_ | Enter password: ************_ | ||||||
| @@ -102,11 +67,7 @@ Enter password: ************_ | |||||||
|  |  | ||||||
| ## Optional | ## Optional | ||||||
|  |  | ||||||
| ```csharp | <?# Example symbol="M:Prompt.Program.AskColor" project="Prompt" /?> | ||||||
| var color = AnsiConsole.Prompt( |  | ||||||
|     new TextPrompt<string>("[grey][[Optional]][/] [green]Favorite color[/]?") |  | ||||||
|         .AllowEmpty()); |  | ||||||
| ``` |  | ||||||
|  |  | ||||||
| ```text | ```text | ||||||
| [Optional] Favorite color? _ | [Optional] Favorite color? _ | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ Spectre.Console to show their support and to ensure the longevity of the project | |||||||
| * [Rodney Littles II](https://github.com/RLittlesII) | * [Rodney Littles II](https://github.com/RLittlesII) | ||||||
| * [Martin Björkström](https://github.com/bjorkstromm) | * [Martin Björkström](https://github.com/bjorkstromm) | ||||||
| * [Dave Glick](https://github.com/daveaglick) | * [Dave Glick](https://github.com/daveaglick) | ||||||
| * [Kim Gunanrsson](https://github.com/kimgunnarsson) | * [Kim Gunnarsson](https://github.com/kimgunnarsson) | ||||||
| * [Andrew McClenaghan](https://github.com/andymac4182) | * [Andrew McClenaghan](https://github.com/andymac4182) | ||||||
| * [C. Augusto Proiete](https://github.com/augustoproiete) | * [C. Augusto Proiete](https://github.com/augustoproiete) | ||||||
| * [Viktor Elofsson](https://github.com/vktr) | * [Viktor Elofsson](https://github.com/vktr) | ||||||
| @@ -18,4 +18,4 @@ Spectre.Console to show their support and to ensure the longevity of the project | |||||||
| * [Elmah.io](https://github.com/elmahio) | * [Elmah.io](https://github.com/elmahio) | ||||||
|  |  | ||||||
| I really appreciate it.   | I really appreciate it.   | ||||||
| **Thank you very much!** | **Thank you very much!** | ||||||
|   | |||||||
| @@ -1,17 +1,25 @@ | |||||||
| const defaultTheme = require("tailwindcss/defaultTheme"); | const defaultTheme = require("tailwindcss/defaultTheme"); | ||||||
| const colors = require("tailwindcss/colors"); |  | ||||||
|  |  | ||||||
| module.exports = { | module.exports = { | ||||||
|     purge: ["./output/**/*.html"], |     /* | ||||||
|     mode: 'jit', |      we don't need to scan all the doc files because they all share the same layout. so we can exclude all but one of the namespace (Spectre.Console.Advanced) from the scan  | ||||||
|     darkMode: false, // or 'media' or 'class' |      we'll get all the css classes that we need to build up the styles for the rest. | ||||||
|  |      */ | ||||||
|  |     content: [ | ||||||
|  |         "./output/**/*.html",  | ||||||
|  |         "!./output/api/Spectre.Console/**/*.html",  | ||||||
|  |         "!./output/api/Spectre.Console.Cli/**/*.html",  | ||||||
|  |         "!./output/api/Spectre.Console/Spectre.Console.Cli.Unsafe/**/*.html",  | ||||||
|  |         "!./output/api/Spectre.Console/Spectre.Console.Rendering/**/*.html" | ||||||
|  |     ], | ||||||
|  |     darkMode: "class", | ||||||
|     theme: { |     theme: { | ||||||
|         extend: { |         extend: { | ||||||
|             fontFamily: { |             fontFamily: { | ||||||
|                 sans: ["Poppins", ...defaultTheme.fontFamily.sans], |                 sans: ["Poppins", ...defaultTheme.fontFamily.sans], | ||||||
|                 mono: ["ui-monospace", "Cascadia Mono", "Cascadia Code", "Menlo", "Consolas", "Liberation Mono", "Lucida Console", "WebCascadiaMonoPL", "monospace"], |                 mono: ["ui-monospace", "Cascadia Mono", "Cascadia Code", "Menlo", "Consolas", "Liberation Mono", "Lucida Console", "WebCascadiaMonoPL", "monospace"], | ||||||
|             }, |             }, | ||||||
|             container: { |             container: ({theme}) => ({ | ||||||
|                 center: true, |                 center: true, | ||||||
|                 padding: { |                 padding: { | ||||||
|                     DEFAULT: "2rem", |                     DEFAULT: "2rem", | ||||||
| @@ -20,24 +28,39 @@ module.exports = { | |||||||
|                     xl: "5rem", |                     xl: "5rem", | ||||||
|                     "2xl": "6rem", |                     "2xl": "6rem", | ||||||
|                 }, |                 }, | ||||||
|             }, |                 screens: { | ||||||
|  |                     sm: theme("spacing.full"), | ||||||
|  |                     md: theme("spacing.full"), | ||||||
|  |                     lg: "1280px", | ||||||
|  |                     xl: "1400px", | ||||||
|  |                 }, | ||||||
|  |             }), | ||||||
|             typography: (theme) => ({ |             typography: (theme) => ({ | ||||||
|                 DEFAULT: { |                 DEFAULT: { | ||||||
|                     css: { |                     css: { | ||||||
|                         color: defaultTheme.colors.gray[900], |                         h2: { | ||||||
|                         a: { |                             marginTop: '1.4em', | ||||||
|                             color: defaultTheme.colors.blue[700], |                             marginBottom: `.2em`, | ||||||
|                             fontWeight: defaultTheme.fontWeight.normal, |  | ||||||
|                             "&:hover": { |  | ||||||
|                                 color: defaultTheme.colors.blue[600], |  | ||||||
|                             }, |  | ||||||
|                         }, |                         }, | ||||||
|                         "pre code": { |                         h3: { | ||||||
|                             fontWeight: defaultTheme.fontWeight.light, |                             marginTop: '2.4em', | ||||||
|  |                             lineHeight: '1.4', | ||||||
|  |                         }, | ||||||
|  |                         pre: { | ||||||
|  |                             borderRadius: theme('borderRadius.xl'), | ||||||
|  |                             borderWidth: '1px', | ||||||
|  |                             borderColor: theme('colors.slate.700'), | ||||||
|  |                             color: theme('colors.slate.50'), | ||||||
|  |                             boxShadow: theme('boxShadow.md'), | ||||||
|  |                         }, | ||||||
|  |                         'p + pre, p + asciinema-player pre': { | ||||||
|  |                             marginTop: `${-4 / 14}em`, | ||||||
|  |                         }, | ||||||
|  |                         'pre + pre': { | ||||||
|  |                             marginTop: `${-16 / 14}em`, | ||||||
|                         }, |                         }, | ||||||
|                         code: { |                         code: { | ||||||
|                             color: defaultTheme.colors.blue[900], |                             fontWeight: theme("fontWeight.normal"), | ||||||
|                             fontWeight: defaultTheme.fontWeight.normal, |  | ||||||
|                         }, |                         }, | ||||||
|                         "code::before": { |                         "code::before": { | ||||||
|                             content: " ", |                             content: " ", | ||||||
| @@ -45,12 +68,42 @@ module.exports = { | |||||||
|                         "code::after": { |                         "code::after": { | ||||||
|                             content: " ", |                             content: " ", | ||||||
|                         }, |                         }, | ||||||
|                         h2: { |                         td: { | ||||||
|                             marginTop: "1em", |                             overflowWrap: "anywhere", | ||||||
|                             marginBottom: ".5em" |                         }, | ||||||
|                         } |                         a: { | ||||||
|  |                             fontWeight: theme('fontWeight.light'), | ||||||
|  |                             textDecoration: 'none', | ||||||
|  |                             borderBottom: `1px solid ${theme('colors.teal.600')}`, | ||||||
|  |                         }, | ||||||
|  |                         'a:hover': { | ||||||
|  |                             borderBottomWidth: '2px', | ||||||
|  |                         }, | ||||||
|                     }, |                     }, | ||||||
|                 }, |                 }, | ||||||
|  |                 base: { | ||||||
|  |                     css: { | ||||||
|  |                         pre: { | ||||||
|  |                             fontWeight: theme("fontWeight.light"), | ||||||
|  |                             fontSize:'.9rem', | ||||||
|  |                             lineHeight: '1.35' | ||||||
|  |                         }, | ||||||
|  |                         code: { | ||||||
|  |                             fontSize:'inherit' | ||||||
|  |                         }, | ||||||
|  |                     } | ||||||
|  |                 }, | ||||||
|  |                 sm: { | ||||||
|  |                     css: { | ||||||
|  |                         pre: { | ||||||
|  |                             fontSize:'.8rem', | ||||||
|  |                             lineHeight: '1.4', | ||||||
|  |                         }, | ||||||
|  |                         code:{ | ||||||
|  |                             fontSize:'inherit' | ||||||
|  |                         }, | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|             }), |             }), | ||||||
|         }, |         }, | ||||||
|     }, |     }, | ||||||
|   | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -5,6 +5,8 @@ Highlights: | |||||||
|     - Custom colors |     - Custom colors | ||||||
|     - Labels |     - Labels | ||||||
|     - Use your own data with a converter. |     - Use your own data with a converter. | ||||||
|  | Reference: T:Spectre.Console.BarChart | ||||||
|  |      | ||||||
| --- | --- | ||||||
|  |  | ||||||
| Use `BarChart` to render bar charts to the console. | Use `BarChart` to render bar charts to the console. | ||||||
| @@ -17,7 +19,7 @@ Use `BarChart` to render bar charts to the console. | |||||||
| ### Basic usage | ### Basic usage | ||||||
|  |  | ||||||
| ```csharp | ```csharp | ||||||
| AnsiConsole.Render(new BarChart() | AnsiConsole.Write(new BarChart() | ||||||
|     .Width(60) |     .Width(60) | ||||||
|     .Label("[green bold underline]Number of fruits[/]") |     .Label("[green bold underline]Number of fruits[/]") | ||||||
|     .CenterLabel() |     .CenterLabel() | ||||||
| @@ -38,7 +40,7 @@ var items = new List<(string Label, double Value)> | |||||||
| }; | }; | ||||||
|  |  | ||||||
| // Render bar chart | // Render bar chart | ||||||
| AnsiConsole.Render(new BarChart() | AnsiConsole.Write(new BarChart() | ||||||
|     .Width(60) |     .Width(60) | ||||||
|     .Label("[green bold underline]Number of fruits[/]") |     .Label("[green bold underline]Number of fruits[/]") | ||||||
|     .CenterLabel() |     .CenterLabel() | ||||||
| @@ -72,7 +74,7 @@ var items = new List<Fruit> | |||||||
| }; | }; | ||||||
|  |  | ||||||
| // Render bar chart | // Render bar chart | ||||||
| AnsiConsole.Render(new BarChart() | AnsiConsole.Write(new BarChart() | ||||||
|     .Width(60) |     .Width(60) | ||||||
|     .Label("[green bold underline]Number of fruits[/]") |     .Label("[green bold underline]Number of fruits[/]") | ||||||
|     .CenterLabel() |     .CenterLabel() | ||||||
|   | |||||||
| @@ -6,6 +6,8 @@ Highlights: | |||||||
|     - Include highlighted events. |     - Include highlighted events. | ||||||
|     - Culture aware. |     - Culture aware. | ||||||
|     - Custom headers. |     - Custom headers. | ||||||
|  | Reference: T:Spectre.Console.Calendar | ||||||
|  |  | ||||||
| --- | --- | ||||||
|  |  | ||||||
| The `Calendar` is used to render a calendar to the terminal. | The `Calendar` is used to render a calendar to the terminal. | ||||||
| @@ -16,7 +18,7 @@ To render a calendar, create a `Calendar` instance with a target date. | |||||||
|  |  | ||||||
| ```csharp | ```csharp | ||||||
| var calendar = new Calendar(2020,10); | var calendar = new Calendar(2020,10); | ||||||
| AnsiConsole.Render(calendar); | AnsiConsole.Write(calendar); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| <?# AsciiCast cast="calendar" /?> | <?# AsciiCast cast="calendar" /?> | ||||||
| @@ -27,8 +29,8 @@ You can set the calendar's culture to show localized weekdays. | |||||||
|  |  | ||||||
| ```csharp | ```csharp | ||||||
| var calendar = new Calendar(2020,10); | var calendar = new Calendar(2020,10); | ||||||
| calendar.Culture("ja-JP"); | calendar.Culture("sv-SE"); | ||||||
| AnsiConsole.Render(calendar); | AnsiConsole.Write(calendar); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| <?# AsciiCast cast="calendar-culture" /?> | <?# AsciiCast cast="calendar-culture" /?> | ||||||
| @@ -40,7 +42,7 @@ You can hide the calendar header. | |||||||
| ```csharp | ```csharp | ||||||
| var calendar = new Calendar(2020,10); | var calendar = new Calendar(2020,10); | ||||||
| calendar.HideHeader(); | calendar.HideHeader(); | ||||||
| AnsiConsole.Render(calendar); | AnsiConsole.Write(calendar); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| You can set the header style of the calendar. | You can set the header style of the calendar. | ||||||
| @@ -48,7 +50,7 @@ You can set the header style of the calendar. | |||||||
| ```csharp | ```csharp | ||||||
| var calendar = new Calendar(2020, 10); | var calendar = new Calendar(2020, 10); | ||||||
| calendar.HeaderStyle(Style.Parse("blue bold")); | calendar.HeaderStyle(Style.Parse("blue bold")); | ||||||
| AnsiConsole.Render(calendar); | AnsiConsole.Write(calendar); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| <?# AsciiCast cast="calendar-header" /?> | <?# AsciiCast cast="calendar-header" /?> | ||||||
|   | |||||||
| @@ -1,6 +1,7 @@ | |||||||
| Title: Canvas Image | Title: Canvas Image | ||||||
| Order: 70 | Order: 70 | ||||||
| Description: "Use *ImageSharp* to parse images and render them as Ascii art to the console." | Description: "Use *ImageSharp* to parse images and render them as Ascii art to the console." | ||||||
|  | Reference: T:Spectre.Console.CanvasImage | ||||||
| --- | --- | ||||||
|  |  | ||||||
| To add [ImageSharp](https://github.com/SixLabors/ImageSharp) superpowers to  | To add [ImageSharp](https://github.com/SixLabors/ImageSharp) superpowers to  | ||||||
| @@ -26,7 +27,7 @@ var image = new CanvasImage("cake.png"); | |||||||
| image.MaxWidth(16); | image.MaxWidth(16); | ||||||
|  |  | ||||||
| // Render the image to the console | // Render the image to the console | ||||||
| AnsiConsole.Render(image); | AnsiConsole.Write(image); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ## Result | ## Result | ||||||
| @@ -36,7 +37,7 @@ AnsiConsole.Render(image); | |||||||
| ## Manipulating images | ## Manipulating images | ||||||
|  |  | ||||||
| You can take full advantage of [ImageSharp](https://github.com/SixLabors/ImageSharp) | You can take full advantage of [ImageSharp](https://github.com/SixLabors/ImageSharp) | ||||||
| and manipulate images directly via it's [Processing API](https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.html). | and manipulate images directly via its [Processing API](https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.html). | ||||||
|  |  | ||||||
| ```csharp | ```csharp | ||||||
| // Load an image | // Load an image | ||||||
| @@ -50,7 +51,7 @@ image.BilinearResampler(); | |||||||
| image.Mutate(ctx => ctx.Grayscale().Rotate(-45).EntropyCrop()); | image.Mutate(ctx => ctx.Grayscale().Rotate(-45).EntropyCrop()); | ||||||
|  |  | ||||||
| // Render the image to the console | // Render the image to the console | ||||||
| AnsiConsole.Render(image); | AnsiConsole.Write(image); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ## Result | ## Result | ||||||
|   | |||||||
| @@ -1,6 +1,7 @@ | |||||||
| Title: Canvas | Title: Canvas | ||||||
| Order: 60 | Order: 60 | ||||||
| Description: "**Canvas** is a widget that allows you to render arbitrary pixels to the console." | Description: "**Canvas** is a widget that allows you to render arbitrary pixels to the console." | ||||||
|  | Reference: T:Spectre.Console.Canvas | ||||||
| --- | --- | ||||||
|  |  | ||||||
| `Canvas` is a widget that allows you to render arbitrary "pixels"  | `Canvas` is a widget that allows you to render arbitrary "pixels"  | ||||||
| @@ -28,7 +29,7 @@ for(var i = 0; i < canvas.Width; i++) | |||||||
| } | } | ||||||
|  |  | ||||||
| // Render the canvas | // Render the canvas | ||||||
| AnsiConsole.Render(canvas); | AnsiConsole.Write(canvas); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ## Result | ## Result | ||||||
|   | |||||||
| @@ -2,6 +2,7 @@ Title: Figlet | |||||||
| Order: 50 | Order: 50 | ||||||
| RedirectFrom: figlet | RedirectFrom: figlet | ||||||
| Description: "*Spectre.Console* can render FIGlet text by using the **FigletText** class." | Description: "*Spectre.Console* can render FIGlet text by using the **FigletText** class." | ||||||
|  | Reference: T:Spectre.Console.FigletText | ||||||
| --- | --- | ||||||
|  |  | ||||||
| Spectre.Console can render [FIGlet](http://www.figlet.org/) text by using the `FigletText` class. | Spectre.Console can render [FIGlet](http://www.figlet.org/) text by using the `FigletText` class. | ||||||
| @@ -9,7 +10,7 @@ Spectre.Console can render [FIGlet](http://www.figlet.org/) text by using the `F | |||||||
| ## Default font | ## Default font | ||||||
|  |  | ||||||
| ```csharp | ```csharp | ||||||
| AnsiConsole.Render( | AnsiConsole.Write( | ||||||
|     new FigletText("Hello") |     new FigletText("Hello") | ||||||
|         .LeftAligned() |         .LeftAligned() | ||||||
|         .Color(Color.Red)); |         .Color(Color.Red)); | ||||||
| @@ -23,7 +24,7 @@ AnsiConsole.Render( | |||||||
| ```csharp | ```csharp | ||||||
| var font = FigletFont.Load("starwars.flf"); | var font = FigletFont.Load("starwars.flf"); | ||||||
|  |  | ||||||
| AnsiConsole.Render( | AnsiConsole.Write( | ||||||
|     new FigletText(font, "Hello") |     new FigletText(font, "Hello") | ||||||
|         .LeftAligned() |         .LeftAligned() | ||||||
|         .Color(Color.Red)); |         .Color(Color.Red)); | ||||||
|   | |||||||
| @@ -5,6 +5,7 @@ Description: "The **Rule** class is used to render a horizontal rule (line) to t | |||||||
| Highlights: | Highlights: | ||||||
|     - Custom colors for line and title. |     - Custom colors for line and title. | ||||||
|     - Specify left, center or right aligned title. |     - Specify left, center or right aligned title. | ||||||
|  | Reference: T:Spectre.Console.Rule | ||||||
|  |  | ||||||
| --- | --- | ||||||
|  |  | ||||||
| @@ -18,7 +19,7 @@ To render a rule without a title: | |||||||
|  |  | ||||||
| ```csharp | ```csharp | ||||||
| var rule = new Rule(); | var rule = new Rule(); | ||||||
| AnsiConsole.Render(rule); | AnsiConsole.Write(rule); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ## Title | ## Title | ||||||
| @@ -27,7 +28,7 @@ You can set the rule title markup text. | |||||||
|  |  | ||||||
| ```csharp | ```csharp | ||||||
| var rule = new Rule("[red]Hello[/]"); | var rule = new Rule("[red]Hello[/]"); | ||||||
| AnsiConsole.Render(rule); | AnsiConsole.Write(rule); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ```text | ```text | ||||||
| @@ -41,7 +42,7 @@ You can set the rule's title alignment. | |||||||
| ```csharp | ```csharp | ||||||
| var rule = new Rule("[red]Hello[/]"); | var rule = new Rule("[red]Hello[/]"); | ||||||
| rule.Alignment = Justify.Left; | rule.Alignment = Justify.Left; | ||||||
| AnsiConsole.Render(rule); | AnsiConsole.Write(rule); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ```text | ```text | ||||||
| @@ -53,7 +54,7 @@ You can also specify it via an extension method: | |||||||
| ```csharp | ```csharp | ||||||
| var rule = new Rule("[red]Hello[/]"); | var rule = new Rule("[red]Hello[/]"); | ||||||
| rule.LeftAligned(); | rule.LeftAligned(); | ||||||
| AnsiConsole.Render(rule); | AnsiConsole.Write(rule); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ```text | ```text | ||||||
| @@ -66,12 +67,12 @@ AnsiConsole.Render(rule); | |||||||
| ```csharp | ```csharp | ||||||
| var rule = new Rule("[red]Hello[/]"); | var rule = new Rule("[red]Hello[/]"); | ||||||
| rule.Style = Style.Parse("red dim"); | rule.Style = Style.Parse("red dim"); | ||||||
| AnsiConsole.Render(rule); | AnsiConsole.Write(rule); | ||||||
| ``` | ``` | ||||||
| You can also specify it via an extension method | You can also specify it via an extension method | ||||||
|  |  | ||||||
| ```csharp | ```csharp | ||||||
| var rule = new Rule("[red]Hello[/]"); | var rule = new Rule("[red]Hello[/]"); | ||||||
| rule.RuleStyle("red dim"); | rule.RuleStyle("red dim"); | ||||||
| AnsiConsole.Render(rule); | AnsiConsole.Write(rule); | ||||||
| ``` | ``` | ||||||
|   | |||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user