using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using ConsoleTableExt;
using Markdig.Extensions.Tables;
namespace MfGames.Markdown.Gemtext.Renderers.Gemtext.Blocks
{
public class TableRenderer : GemtextObjectRenderer
{
private readonly Action? configureTableBuilder;
private readonly bool omitPreformat;
public TableRenderer(
bool omitPreformat,
Action? configureTableBuilder)
{
this.omitPreformat = omitPreformat;
this.configureTableBuilder = configureTableBuilder;
}
protected override void Write(GemtextRenderer renderer, Table table)
{
// Since Gemtext doesn't have a table format per-se, we are going
// to use ConsoleTableEx to make a nicely-formatted table and emit
// the lines directly. That should produce the desired result.
// Gather up information about the data since that is where the
// builder starts with.
bool hasHeader = false;
List