Fix outdated documentation

This commit is contained in:
Patrik Svensson 2020-10-26 12:13:21 +01:00 committed by Patrik Svensson
parent 03334f693d
commit 10daf727e9
8 changed files with 62 additions and 52 deletions

View File

@ -31,8 +31,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Statiq.Web" Version="1.0.0-beta.5" /> <PackageReference Include="Statiq.Web" Version="1.0.0-beta.11" />
<PackageReference Include="MinVer" PrivateAssets="All" Version="2.3.0" /> <PackageReference Include="MinVer" PrivateAssets="All" Version="2.3.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@ -36,15 +36,15 @@ AnsiConsole.WriteException(ex, new ExceptionSettings
Format = ExceptionFormats.ShortenEverything | ExceptionFormats.ShowLinks, Format = ExceptionFormats.ShortenEverything | ExceptionFormats.ShowLinks,
Style = new ExceptionStyle Style = new ExceptionStyle
{ {
Exception = Style.WithForeground(Color.Grey), Exception = new Style().Foreground(Color.Grey),
Message = Style.WithForeground(Color.White), Message = new Style().Foreground(Color.White),
NonEmphasized = Style.WithForeground(Color.Cornsilk1), NonEmphasized = new Style().Foreground(Color.Cornsilk1),
Parenthesis = Style.WithForeground(Color.Cornsilk1), Parenthesis = new Style().Foreground(Color.Cornsilk1),
Method = Style.WithForeground(Color.Red), Method = new Style().Foreground(Color.Red),
ParameterName = Style.WithForeground(Color.Cornsilk1), ParameterName = new Style().Foreground(Color.Cornsilk1),
ParameterType = Style.WithForeground(Color.Red), ParameterType = new Style().Foreground(Color.Red),
Path = Style.WithForeground(Color.Red), Path = new Style().Foreground(Color.Red),
LineNumber = Style.WithForeground(Color.Cornsilk1), LineNumber = new Style().Foreground(Color.Cornsilk1),
} }
}); });
``` ```

View File

@ -1,4 +1,4 @@
Title: Welcome Title: Welcome
Order: 0 Order: 0
--- ---

View File

@ -43,10 +43,10 @@ AnsiConsole.Markup("[[Hello]] "); // [Hello]
AnsiConsole.Markup("[red][[World]][/]"); // [World] AnsiConsole.Markup("[red][[World]][/]"); // [World]
``` ```
You can also use the `SafeMarkup` extension method. You can also use the `EscapeMarkup` extension method.
```csharp ```csharp
AnsiConsole.Markup("[red]{0}[/]", "Hello [World]".SafeMarkup()); AnsiConsole.Markup("[red]{0}[/]", "Hello [World]".EscapeMarkup());
``` ```
# Setting background color # Setting background color
@ -64,7 +64,7 @@ You can set the background color in markup by prefixing the color with
To output an emoji as part of markup, you can use emoji shortcodes. To output an emoji as part of markup, you can use emoji shortcodes.
```csharp ```csharp
AnsiConsole.MarkupLine("Hello :globe_showing_europe_africa:!"); AnsiConsole.Markup("Hello :globe_showing_europe_africa:!");
``` ```
For a list of emoji, see the [Emojis](xref:emojis) appendix section. For a list of emoji, see the [Emojis](xref:emojis) appendix section.

View File

@ -1,4 +1,4 @@
Title: Calendar Title: Calendar
Order: 4 Order: 4
RedirectFrom: calendar RedirectFrom: calendar
--- ---
@ -12,7 +12,9 @@ To render a calendar, create a `Calendar` instance with a target date.
```csharp ```csharp
var calendar = new Calendar(2020,10); var calendar = new Calendar(2020,10);
AnsiConsole.Render(calendar); AnsiConsole.Render(calendar);
```
```text
2020 October 2020 October
┌─────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┐
│ Sun │ Mon │ Tue │ Wed │ Thu │ Fri │ Sat │ │ Sun │ Mon │ Tue │ Wed │ Thu │ Fri │ Sat │
@ -32,20 +34,22 @@ You can set the calendar's culture to show localized weekdays.
```csharp ```csharp
var calendar = new Calendar(2020,10); var calendar = new Calendar(2020,10);
calendar.SetCulture("ja-JP"); calendar.Culture("ja-JP");
AnsiConsole.Render(calendar); AnsiConsole.Render(calendar);
```
2020年10月 ```text
┌────┬────┬────┬────┬────┬────┬────┐ Oktober 2020
│ 日 │ 月 │ 火 │ 水 │ 木 │ 金 │ 土 │ ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┐
├────┼────┼────┼────┼────┼────┼────┤ │ Mån │ Tis │ Ons │ Tor │ Fre │ Lör │ Sön │
│ │ │ │ │ 1 │ 2 │ 3 │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 10 │ │ │ │ │ 1 │ 2 │ 3 │ 4 │
│ 11 │ 12 │ 13 │ 14 │ 15 │ 16 │ 17 │ │ 5 │ 6 │ 7 │ 8 │ 9 │ 10 │ 11* │
│ 18 │ 19 │ 20 │ 21 │ 22 │ 23 │ 24 │ │ 12 │ 13 │ 14 │ 15 │ 16 │ 17 │ 18 │
│ 25 │ 26 │ 27 │ 28 │ 29 │ 30 │ 31 │ │ 19 │ 20 │ 21 │ 22 │ 23 │ 24 │ 25 │
│ 26 │ 27 │ 28 │ 29 │ 30 │ 31 │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
└────┴────┴────┴────┴────┴────┴────┘ └────────┴────────┴────────┴────┘
``` ```
## Header ## Header
@ -56,7 +60,9 @@ You can hide the calendar header.
var calendar = new Calendar(2020,10); var calendar = new Calendar(2020,10);
calendar.ShowHeader = false; calendar.ShowHeader = false;
AnsiConsole.Render(calendar); AnsiConsole.Render(calendar);
```
```text
┌─────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┐
│ Sun │ Mon │ Tue │ Wed │ Thu │ Fri │ Sat │ │ Sun │ Mon │ Tue │ Wed │ Thu │ Fri │ Sat │
├─────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┤
@ -72,13 +78,13 @@ AnsiConsole.Render(calendar);
You can set the header style of the calendar. You can set the header style of the calendar.
```csharp ```csharp
var calendar = new Calendar(2020,10); var calendar = new Calendar(2020, 10);
calendar.SetHeaderStyle(Style.Parse("blue bold")); calendar.HeaderStyle(Style.Parse("blue bold"));
AnsiConsole.Render(calendar); AnsiConsole.Render(calendar);
``` ```
## Calendar Event ## Calendar Events
You can add an event to the calendar. You can add an event to the calendar.
If a date has an event associated with it, the date gets highlighted in the calendar. If a date has an event associated with it, the date gets highlighted in the calendar.
@ -87,7 +93,9 @@ If a date has an event associated with it, the date gets highlighted in the cale
var calendar = new Calendar(2020,10); var calendar = new Calendar(2020,10);
calendar.AddCalendarEvent(2020, 10, 11); calendar.AddCalendarEvent(2020, 10, 11);
AnsiConsole.Render(calendar); AnsiConsole.Render(calendar);
```
```text
2020 October 2020 October
┌─────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┐
│ Sun │ Mon │ Tue │ Wed │ Thu │ Fri │ Sat │ │ Sun │ Mon │ Tue │ Wed │ Thu │ Fri │ Sat │
@ -106,9 +114,8 @@ AnsiConsole.Render(calendar);
You can set the highlight style for a calendar event via `SetHighlightStyle`. You can set the highlight style for a calendar event via `SetHighlightStyle`.
```csharp ```csharp
var calendar = new Calendar(2020,10); var calendar = new Calendar(2020, 10);
calendar.AddCalendarEvent(2020, 10, 11); calendar.AddCalendarEvent(2020, 10, 11);
calendar.SetHighlightStyle(Style.Parse("yellow bold")); calendar.HighlightStyle(Style.Parse("yellow bold"));
AnsiConsole.Render(calendar); AnsiConsole.Render(calendar);
``` ```

View File

@ -1,4 +1,4 @@
Title: Rule Title: Rule
Order: 5 Order: 5
RedirectFrom: rule RedirectFrom: rule
--- ---
@ -23,8 +23,9 @@ You can set the rule title markup text.
```csharp ```csharp
var rule = new Rule("[red]Hello[/]"); var rule = new Rule("[red]Hello[/]");
AnsiConsole.Render(rule); AnsiConsole.Render(rule);
```
// output ```text
───────────────────────────────── Hello ───────────────────────────────── ───────────────────────────────── Hello ─────────────────────────────────
``` ```
@ -36,36 +37,36 @@ You can set the rule's title alignment.
var rule = new Rule("[red]Hello[/]"); var rule = new Rule("[red]Hello[/]");
rule.Alignment = Justify.Left; rule.Alignment = Justify.Left;
AnsiConsole.Render(rule); AnsiConsole.Render(rule);
```
//output ```text
── Hello ──────────────────────────────────────────────────────────────── ── Hello ────────────────────────────────────────────────────────────────
``` ```
You can also specify it with a method 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.LeftAligned();
AnsiConsole.Render(rule); AnsiConsole.Render(rule);
```
//output ```text
── Hello ──────────────────────────────────────────────────────────────── ── Hello ────────────────────────────────────────────────────────────────
``` ```
## Style ## Styling
You can set the rule style.
```csharp ```csharp
var rule = new Rule("[red]Hello[/]"); var rule = new Rule("[red]Hello[/]");
rule.Style = Style.Parse("red dim"); rule.Style = Style.Parse("red dim");
AnsiConsole.Render(rule); AnsiConsole.Render(rule);
``` ```
You can also specify it with a method You can also specify it via an extension method
```csharp ```csharp
var rule = new Rule("[red]Hello[/]"); var rule = new Rule("[red]Hello[/]");
rule.SetStyle("red dim"); rule.RuleStyle("red dim");
AnsiConsole.Render(rule); AnsiConsole.Render(rule);
``` ```

View File

@ -51,10 +51,10 @@ For a list of borders, see the [Borders](xref:borders) appendix section.
```csharp ```csharp
// Sets the border // Sets the border
table.SetBorder(Border.None); table.Border(TableBorder.None);
table.SetBorder(Border.Ascii); table.Border(TableBorder.Ascii);
table.SetBorder(Border.Square); table.Border(TableBorder.Square);
table.SetBorder(Border.Rounded); table.Border(TableBorder.Rounded);
``` ```
## Expand / Collapse ## Expand / Collapse
@ -79,7 +79,7 @@ table.HideHeaders();
```csharp ```csharp
// Sets the table width to 50 cells // Sets the table width to 50 cells
table.SetWidth(50); table.Width(50);
``` ```
# Column appearance # Column appearance
@ -91,15 +91,17 @@ table.SetWidth(50);
## Alignment ## Alignment
```csharp ```csharp
// Set the alignment explicitly column.Alignment(Justify.Right);
column.SetAlignment(Justify.Right); column.LeftAligned();
column.Centered();
column.RightAligned();
``` ```
## Padding ## Padding
```csharp ```csharp
// Set left and right padding // Set left and right padding
column.SetPadding(left: 3, right: 5); column.Padding(left: 3, right: 5);
// Set padding individually. // Set padding individually.
column.PadLeft(3); column.PadLeft(3);