Update rule example and docs

This commit is contained in:
Patrik Svensson 2020-10-27 17:30:50 +01:00
parent bca1c889d1
commit 93d1971f48
3 changed files with 5 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -5,7 +5,7 @@ RedirectFrom: rule
The `Rule` class is used to render a horizontal rule (line) to the terminal.
![Rule](../assets/images/rule.png)
<img src="../assets/images/rule.png" style="width: 100%;" />
# Usage

View File

@ -14,26 +14,26 @@ namespace EmojiExample
// Left aligned title
WrapInPanel(
new Rule("[white]Left aligned[/]")
new Rule("[blue]Left aligned[/]")
.RuleStyle(Style.Parse("red"))
.LeftAligned());
// Centered title
WrapInPanel(
new Rule("[silver]Centered[/]")
new Rule("[green]Centered[/]")
.RuleStyle(Style.Parse("green"))
.Centered());
// Right aligned title
WrapInPanel(
new Rule("[grey]Right aligned[/]")
new Rule("[red]Right aligned[/]")
.RuleStyle(Style.Parse("blue"))
.RightAligned());
}
private static void WrapInPanel(Rule rule)
{
AnsiConsole.Render(new Panel(rule).Expand().BorderStyle(Style.Parse("grey")));
AnsiConsole.Render(rule);
AnsiConsole.WriteLine();
}
}