Add word wrapping for text

Closes #18
This commit is contained in:
Patrik Svensson
2020-08-13 21:12:45 +02:00
committed by Patrik Svensson
parent 0119364728
commit d7bbaf4a85
31 changed files with 646 additions and 643 deletions

View File

@ -7,10 +7,10 @@ namespace PanelExample
{
static void Main(string[] args)
{
var content = Text.New(
var content = Text.Markup(
"[underline]I[/] heard [underline on blue]you[/] like 📦\n\n\n\n" +
"So I put a 📦 in a 📦\n\n" +
"😅", foreground: Color.White);
"😅");
AnsiConsole.Render(
new Panel(
@ -22,7 +22,7 @@ namespace PanelExample
// Left adjusted panel with text
AnsiConsole.Render(new Panel(
Text.New("Left adjusted\nLeft"))
new Text("Left adjusted\nLeft"))
{
Expand = true,
Alignment = Justify.Left,
@ -30,7 +30,7 @@ namespace PanelExample
// Centered ASCII panel with text
AnsiConsole.Render(new Panel(
Text.New("Centered\nCenter"))
new Text("Centered\nCenter"))
{
Expand = true,
Alignment = Justify.Center,
@ -39,7 +39,7 @@ namespace PanelExample
// Right adjusted, rounded panel with text
AnsiConsole.Render(new Panel(
Text.New("Right adjusted\nRight"))
new Text("Right adjusted\nRight"))
{
Expand = true,
Alignment = Justify.Right,

View File

@ -39,7 +39,7 @@ namespace TableExample
// Add some rows
table.AddRow("[blue][underline]Hell[/]o[/]", "World 🌍");
table.AddRow("[yellow]Patrik [green]\"Hello World[/]\" Svensson[/]", "Was [underline]here[/]!");
table.AddRow("[yellow]Patrik [green]\"Hello World\"[/] Svensson[/]", "Was [underline]here[/]!");
table.AddEmptyRow();
table.AddRow(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit,sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. " +