added template editor

This commit is contained in:
2023-07-26 15:51:44 -06:00
parent 9c547b3435
commit 87fc062dfb
14 changed files with 435 additions and 97 deletions

View File

@@ -0,0 +1,18 @@
using System.Text.RegularExpressions;
namespace LocalModels;
public record AssignmentTemplate
{
public string Id { get; set; } = String.Empty;
public string Name { get; set; } = String.Empty;
public string Markdown { get; set; } = String.Empty;
public static IEnumerable<string> GetVariables(string markdown)
{
string pattern = "{{(.*?)}}";
MatchCollection matches = Regex.Matches(markdown, pattern);
return matches.Select(match => match.Groups[1].Value);
}
}