Sometimes we need to create some console application (maybe not very often ;-)). I don’t know what are your experiences in that area but I always wondered how to nicely display data. I found great tool for it.
It’s MarkdownLog. You can read about markdown’s syntax here. But in my opinion it’s very useful for console applications. I’m going to prove it by short example 😉
First of all we have to import MarkdownLog by nuget:
Now, we can use MarkdownLog:
[csharp]
using System;
using MarkdownLog;
namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{
var countries = new []
{
“Poland”,
“Germany”,
“Czech Republic”,
“Croatia”,
“Norawy”
};
var countryDetails = new[]
{
new {Name = “Poland”, Capital = “Warsaw”, Population = “38 186 860”},
new {Name = “Germany”, Capital = “Berlin”, Population = “80 716 000”},
new {Name = “Czech Republic”, Capital = “Prague”, Population = “10 513 209”},
new {Name = “Croatia”, Capital = “Zagreb”, Population = “4 284 889”}
};
Console.WriteLine(countries.ToMarkdownBulletedList());
Console.WriteLine(countryDetails.ToMarkdownTable());
Console.ReadKey();
}
}
}
[/csharp]
And the result:
I don’t know what is your opinion but it’s enough for me 🙂 You can find more here.