From 21ac952307220cff6951c1a840506582e3ef7268 Mon Sep 17 00:00:00 2001 From: Patrik Svensson Date: Tue, 9 Nov 2021 21:22:18 +0100 Subject: [PATCH] Remove `Render` from docs in favor of `Write` (#613) The `Render` method has been obsoleted. --- docs/input/markup.md | 4 ++-- docs/input/widgets/barchart.md | 6 +++--- docs/input/widgets/calendar.md | 10 +++++----- docs/input/widgets/canvas-image.md | 4 ++-- docs/input/widgets/canvas.md | 2 +- docs/input/widgets/figlet.md | 4 ++-- docs/input/widgets/rule.md | 12 ++++++------ docs/input/widgets/table.md | 2 +- docs/input/widgets/tree.md | 2 +- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/input/markup.md b/docs/input/markup.md index 1c378a5..c9d5333 100644 --- a/docs/input/markup.md +++ b/docs/input/markup.md @@ -15,7 +15,7 @@ Console markup uses a syntax inspired by bbcode. If you write the style (see [St in square brackets, e.g. `[bold red]`, that style will apply until it is closed with a `[/]`. ```csharp -AnsiConsole.Render(new Markup("[bold yellow]Hello[/] [red]World![/]")); +AnsiConsole.Write(new Markup("[bold yellow]Hello[/] [red]World![/]")); ``` The `Markup` class implements `IRenderable` which means that you @@ -26,7 +26,7 @@ rendering of `IRenderable` also have overloads for rendering rich text. var table = new Table(); table.AddColumn(new TableColumn(new Markup("[yellow]Foo[/]"))); table.AddColumn(new TableColumn("[blue]Bar[/]")); -AnsiConsole.Render(table); +AnsiConsole.Write(table); ``` ## Convenience methods diff --git a/docs/input/widgets/barchart.md b/docs/input/widgets/barchart.md index d1de4cd..05ea392 100644 --- a/docs/input/widgets/barchart.md +++ b/docs/input/widgets/barchart.md @@ -17,7 +17,7 @@ Use `BarChart` to render bar charts to the console. ### Basic usage ```csharp -AnsiConsole.Render(new BarChart() +AnsiConsole.Write(new BarChart() .Width(60) .Label("[green bold underline]Number of fruits[/]") .CenterLabel() @@ -38,7 +38,7 @@ var items = new List<(string Label, double Value)> }; // Render bar chart -AnsiConsole.Render(new BarChart() +AnsiConsole.Write(new BarChart() .Width(60) .Label("[green bold underline]Number of fruits[/]") .CenterLabel() @@ -72,7 +72,7 @@ var items = new List }; // Render bar chart -AnsiConsole.Render(new BarChart() +AnsiConsole.Write(new BarChart() .Width(60) .Label("[green bold underline]Number of fruits[/]") .CenterLabel() diff --git a/docs/input/widgets/calendar.md b/docs/input/widgets/calendar.md index 7decf7c..3c829b4 100644 --- a/docs/input/widgets/calendar.md +++ b/docs/input/widgets/calendar.md @@ -16,7 +16,7 @@ To render a calendar, create a `Calendar` instance with a target date. ```csharp var calendar = new Calendar(2020,10); -AnsiConsole.Render(calendar); +AnsiConsole.Write(calendar); ``` @@ -27,8 +27,8 @@ You can set the calendar's culture to show localized weekdays. ```csharp var calendar = new Calendar(2020,10); -calendar.Culture("ja-JP"); -AnsiConsole.Render(calendar); +calendar.Culture("sv-SE"); +AnsiConsole.Write(calendar); ``` @@ -40,7 +40,7 @@ You can hide the calendar header. ```csharp var calendar = new Calendar(2020,10); calendar.HideHeader(); -AnsiConsole.Render(calendar); +AnsiConsole.Write(calendar); ``` You can set the header style of the calendar. @@ -48,7 +48,7 @@ You can set the header style of the calendar. ```csharp var calendar = new Calendar(2020, 10); calendar.HeaderStyle(Style.Parse("blue bold")); -AnsiConsole.Render(calendar); +AnsiConsole.Write(calendar); ``` diff --git a/docs/input/widgets/canvas-image.md b/docs/input/widgets/canvas-image.md index c25726e..c7568b2 100644 --- a/docs/input/widgets/canvas-image.md +++ b/docs/input/widgets/canvas-image.md @@ -26,7 +26,7 @@ var image = new CanvasImage("cake.png"); image.MaxWidth(16); // Render the image to the console -AnsiConsole.Render(image); +AnsiConsole.Write(image); ``` ## Result @@ -50,7 +50,7 @@ image.BilinearResampler(); image.Mutate(ctx => ctx.Grayscale().Rotate(-45).EntropyCrop()); // Render the image to the console -AnsiConsole.Render(image); +AnsiConsole.Write(image); ``` ## Result diff --git a/docs/input/widgets/canvas.md b/docs/input/widgets/canvas.md index ee11548..6716951 100644 --- a/docs/input/widgets/canvas.md +++ b/docs/input/widgets/canvas.md @@ -28,7 +28,7 @@ for(var i = 0; i < canvas.Width; i++) } // Render the canvas -AnsiConsole.Render(canvas); +AnsiConsole.Write(canvas); ``` ## Result diff --git a/docs/input/widgets/figlet.md b/docs/input/widgets/figlet.md index c8fc881..1e23799 100644 --- a/docs/input/widgets/figlet.md +++ b/docs/input/widgets/figlet.md @@ -9,7 +9,7 @@ Spectre.Console can render [FIGlet](http://www.figlet.org/) text by using the `F ## Default font ```csharp -AnsiConsole.Render( +AnsiConsole.Write( new FigletText("Hello") .LeftAligned() .Color(Color.Red)); @@ -23,7 +23,7 @@ AnsiConsole.Render( ```csharp var font = FigletFont.Load("starwars.flf"); -AnsiConsole.Render( +AnsiConsole.Write( new FigletText(font, "Hello") .LeftAligned() .Color(Color.Red)); diff --git a/docs/input/widgets/rule.md b/docs/input/widgets/rule.md index 49edae8..aaccf01 100644 --- a/docs/input/widgets/rule.md +++ b/docs/input/widgets/rule.md @@ -18,7 +18,7 @@ To render a rule without a title: ```csharp var rule = new Rule(); -AnsiConsole.Render(rule); +AnsiConsole.Write(rule); ``` ## Title @@ -27,7 +27,7 @@ You can set the rule title markup text. ```csharp var rule = new Rule("[red]Hello[/]"); -AnsiConsole.Render(rule); +AnsiConsole.Write(rule); ``` ```text @@ -41,7 +41,7 @@ You can set the rule's title alignment. ```csharp var rule = new Rule("[red]Hello[/]"); rule.Alignment = Justify.Left; -AnsiConsole.Render(rule); +AnsiConsole.Write(rule); ``` ```text @@ -53,7 +53,7 @@ You can also specify it via an extension method: ```csharp var rule = new Rule("[red]Hello[/]"); rule.LeftAligned(); -AnsiConsole.Render(rule); +AnsiConsole.Write(rule); ``` ```text @@ -66,12 +66,12 @@ AnsiConsole.Render(rule); ```csharp var rule = new Rule("[red]Hello[/]"); rule.Style = Style.Parse("red dim"); -AnsiConsole.Render(rule); +AnsiConsole.Write(rule); ``` You can also specify it via an extension method ```csharp var rule = new Rule("[red]Hello[/]"); rule.RuleStyle("red dim"); -AnsiConsole.Render(rule); +AnsiConsole.Write(rule); ``` diff --git a/docs/input/widgets/table.md b/docs/input/widgets/table.md index 2481dcd..60fd6de 100644 --- a/docs/input/widgets/table.md +++ b/docs/input/widgets/table.md @@ -35,7 +35,7 @@ table.AddRow("Baz", "[green]Qux[/]"); table.AddRow(new Markup("[blue]Corgi[/]"), new Panel("Waldo")); // Render the table to the console -AnsiConsole.Render(table); +AnsiConsole.Write(table); ``` This will render the following output: diff --git a/docs/input/widgets/tree.md b/docs/input/widgets/tree.md index 0fab485..99e58cc 100644 --- a/docs/input/widgets/tree.md +++ b/docs/input/widgets/tree.md @@ -35,7 +35,7 @@ bar.AddNode(new Calendar(2020, 12) .HideHeader()); // Render the tree -AnsiConsole.Render(root); +AnsiConsole.Write(root); ``` ## Collapsing nodes