Add support for styling segments

This commit is contained in:
Patrik Svensson
2022-02-21 14:38:43 +01:00
committed by Phil Scott
parent 921d595269
commit 5e41a2f505
9 changed files with 293 additions and 50 deletions

View File

@ -8,13 +8,22 @@ public static class Program
{
public static void Main()
{
AnsiConsole.WriteLine();
AnsiConsole.Write(new TextPath(@"C:\Users\Patrik\Source\github\patriksvensson-forks\spectre.console\examples\Console\Paths"));
AnsiConsole.WriteLine();
var windowsPath = @"C:\This is\A\Super Long\Windows\Path\That\Goes\On And On\And\Never\Seems\To\Stop\But\At\Some\Point\It\Must\I\Guess.txt";
var unixPath = @"//This is/A/Super Long/Unix/Path/That/Goes/On And On/And/Never/Seems/To/Stop/But/At/Some/Point/It/Must/I/Guess.txt";
var table = new Table().BorderColor(Color.Grey);
table.AddColumns("[grey]Index[/]", "[yellow]Path[/]");
table.AddRow(new Text("1"), new TextPath(@"C:\Users\Patrik\Source\github\patriksvensson-forks\spectre.console\examples\Console\Paths"));
table.AddColumns("[grey]OS[/]", "[grey]Path[/]");
table.AddRow(new Text("Windows"),
new TextPath(windowsPath));
table.AddRow(new Text("Unix"),
new TextPath(unixPath)
.RootColor(Color.Blue)
.SeparatorColor(Color.Yellow)
.StemStyle(Color.Red)
.LeafStyle(Color.Green));
AnsiConsole.Write(table);
}
}