error NU1504: Duplicate 'PackageReference' items
found. Remove the duplicate items or use the Update
functionality to ensure a consistent restore behavior. The duplicate
'PackageReference' items are: System.Memory 4.5.5, System.Memory 4.5.5.
This commit fixes#833.
`Spectre.Console.Cli` was moved into its own project, and the path to the new project was not added to the list of source files when building the documentation.
* Add renovate.json
* Added a bit more configuration
also moved the config into .github subfolder so not to clutter
the root folder.
* ignore npm updates in docs
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Nils Andresen <nils@nils-andresen.de>
* Allow setting the style of the default value in TextPrompt
Add property "DefaultValueStyle" to TextPrompt which allows setting the style in which the default value is rendered.
When no style is set, the value is displayed as green text, keeping the existing behavior.
* Allow setting the style in which a TextPrompt's choices are displayed
Add property "ChoicesStyle" to TextPrompt which allows setting the style in the prompt's choices are rendered.
When no style is set, choices are displayed as blue text, keeping the existing behavior.
`AnsiConsoleFactory` should be an internal static class. Creating an `IAnsiConsole` can be achieved through `Spectre.Console.AnsiConsole.Create(AnsiConsoleSettings)`
Since `AnsiConsoleFactory` is public, it can't be changed from a non static class to a static class so obsoleting it is the second best thing to do.
Eventually, when `AnsiConsoleFactory` becomes internal and static, `AnsiConsole.Create` can be simplified to this (and the private static field `_factory` can be removed)
```
public static IAnsiConsole Create(AnsiConsoleSettings settings)
{
return AnsiConsoleFactory.Create(settings);
}
```
* 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>