Merge pull request #1143 from wbaldoumas/alignment-vs-justification-docs-fixes

This commit is contained in:
Patrik Svensson 2023-01-26 03:38:25 +01:00 committed by GitHub
commit e042fe15e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 11 deletions

View File

@ -12,7 +12,7 @@ Spectre.Console can render [FIGlet](http://www.figlet.org/) text by using the `F
```csharp ```csharp
AnsiConsole.Write( AnsiConsole.Write(
new FigletText("Hello") new FigletText("Hello")
.LeftAligned() .LeftJustified()
.Color(Color.Red)); .Color(Color.Red));
``` ```
@ -26,6 +26,6 @@ var font = FigletFont.Load("starwars.flf");
AnsiConsole.Write( AnsiConsole.Write(
new FigletText(font, "Hello") new FigletText(font, "Hello")
.LeftAligned() .LeftJustified()
.Color(Color.Red)); .Color(Color.Red));
``` ```

View File

@ -45,16 +45,16 @@ grid.AddColumn();
// Add header row // Add header row
grid.AddRow(new Text[]{ grid.AddRow(new Text[]{
new Text("Header 1", new Style(Color.Red, Color.Black)).LeftAligned(), new Text("Header 1", new Style(Color.Red, Color.Black)).LeftJustified(),
new Text("Header 2", new Style(Color.Green, Color.Black)).Centered(), new Text("Header 2", new Style(Color.Green, Color.Black)).Centered(),
new Text("Header 3", new Style(Color.Blue, Color.Black)).RightAligned() new Text("Header 3", new Style(Color.Blue, Color.Black)).RightJustified()
}); });
// Add content row // Add content row
grid.AddRow(new Text[]{ grid.AddRow(new Text[]{
new Text("Row 1").LeftAligned(), new Text("Row 1").LeftJustified(),
new Text("Row 2").Centered(), new Text("Row 2").Centered(),
new Text("Row 3").RightAligned() new Text("Row 3").RightJustified()
}); });
// Write centered cell grid contents to Console // Write centered cell grid contents to Console
@ -73,9 +73,9 @@ grid.AddColumn();
// Add header row // Add header row
grid.AddRow(new Text[]{ grid.AddRow(new Text[]{
new Text("Header 1", new Style(Color.Red, Color.Black)).LeftAligned(), new Text("Header 1", new Style(Color.Red, Color.Black)).LeftJustified(),
new Text("Header 2", new Style(Color.Green, Color.Black)).Centered(), new Text("Header 2", new Style(Color.Green, Color.Black)).Centered(),
new Text("Header 3", new Style(Color.Blue, Color.Black)).RightAligned() new Text("Header 3", new Style(Color.Blue, Color.Black)).RightJustified()
}); });
var embedded = new Grid(); var embedded = new Grid();
@ -88,7 +88,7 @@ embedded.AddRow(new Text("Embedded III"), new Text("Embedded IV"));
// Add content row // Add content row
grid.AddRow( grid.AddRow(
new Text("Row 1").LeftAligned(), new Text("Row 1").LeftJustified(),
new Text("Row 2").Centered(), new Text("Row 2").Centered(),
embedded embedded
); );

View File

@ -53,7 +53,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.LeftJustified();
AnsiConsole.Write(rule); AnsiConsole.Write(rule);
``` ```

View File

@ -34,7 +34,7 @@ You can also specify styles via extension methods:
```csharp ```csharp
var path = new TextPath("C:/This/Path/Is/Too/Long/To/Fit/In/The/Area.txt") var path = new TextPath("C:/This/Path/Is/Too/Long/To/Fit/In/The/Area.txt")
.RightAligned(); .RightJustified();
``` ```
## Styling ## Styling