Phil Scott 1d8154f9b0
Introduce MarkupInterpolated and MarkupLineInterpolated extensions (#761)
* Introduce MarkupInterpolated and MarkupLineInterpolated extensions

These new methods enable easily writing markup with a nice and intuitive syntax without having to worry about escaping the markup.

```csharp
string input = args[0];
string output = Process(input);
AnsiConsole.MarkupLineInterpolated($"[blue]{input}[/] -> [green]{output}[/]");

```

The `Interpolated` suffix was inspired by the Entity Framework Core [FromSqlInterpolated][1] method.

[1]: https://docs.microsoft.com/en-us/ef/core/querying/raw-sql#passing-parameters

* Fixing whitespace to match file scoped namespaces

* Adding FromInterpolated helper to Markup widget

Allows automatic handling of interpolated strings to be used on the Markup widget. This would be helpful for people working with Tables and the Tree control who would not be using the MarkupInterpolated methods.

* Documentation for markup interpolated methods.

Co-authored-by: Cédric Luthi <cedric.luthi@gmail.com>
2022-03-22 22:34:25 +01:00
2022-02-15 18:02:25 +01:00
2021-04-24 22:20:59 +02:00
2021-11-09 08:19:36 +01:00
2020-07-21 12:03:41 +02:00
2021-11-09 08:19:36 +01:00
2022-02-16 00:35:10 +01:00
2021-04-09 08:45:30 -04:00
2021-04-05 17:54:32 +02:00
2021-02-15 13:01:30 +01:00
2022-02-16 00:44:52 +01:00
2022-02-16 00:35:10 +01:00
2022-02-16 00:35:10 +01:00

Spectre.Console

Spectre.Console NuGet Version Netlify Status

A .NET 5/.NET Standard 2.0 library that makes it easier to create beautiful, cross platform, console applications.
It is heavily inspired by the excellent Rich library for Python.

Table of Contents

  1. Features
  2. Installing
  3. Documentation
  4. Examples
  5. Sponsors
  6. License

Features

  • Written with unit testing in mind.
  • Supports tables, grids, panels, and a rich inspired markup language.
  • Supports the most common SRG parameters when it comes to text styling such as bold, dim, italic, underline, strikethrough, and blinking text.
  • Supports 3/4/8/24-bit colors in the terminal.
    The library will detect the capabilities of the current terminal and downgrade colors as needed.

Example

Installing

The fastest way of getting started using Spectre.Console is to install the NuGet package.

dotnet add package Spectre.Console

Documentation

The documentation for Spectre.Console can be found at https://spectreconsole.net/

Examples

To see Spectre.Console in action, install the dotnet-example global tool.

> dotnet tool restore

Now you can list available examples in this repository:

> dotnet example

And to run an example:

> dotnet example tables

Sponsors

The following people are sponsoring Spectre.Console to show their support and to ensure the longevity of the project.

I really appreciate it.
Thank you very much!

License

Copyright © Patrik Svensson, Phil Scott, Nils Andresen

Spectre.Console is provided as-is under the MIT license. For more information see LICENSE.

Description
A .NET library that makes it easier to create beautiful console applications.
Readme 11 MiB
Languages
C# 99.9%
PowerShell 0.1%