mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 13:28:16 +08:00
Add support for styling segments
This commit is contained in:

committed by
Phil Scott

parent
921d595269
commit
5e41a2f505
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user