guillemets-playground

CSharp · Console

/Program.cs

using Guillemets;
using System;
using System.IO;
using System.Text.Json;

public class Program
{
	public static void Main()
	{
		var template = Template.Create(File.ReadAllText("Playground.template.md"));
		using var json = JsonDocument.Parse(File.ReadAllText("Playground.json"));

		Console.WriteLine(template.Render(json.RootElement));	
	}
}

/Playground.template.md

Hello «name»!

««list

«««first

- The first one is `«name»` for you «..: name»

~

- No #«no» is `«name»`

»»»

»»

/Playground.json

{
	"Name": "Alice",
	"List": [
		{"No": 1, "Name": "Eggs"},
		{"No": 2, "Name": "Bread"},
		{"No": 3, "Name": "Ham"},
		{"No": 4, "Name": "Donuts"}
	]
}
;