using Markdig; using OliverBooth.Extensions.Markdig.Markdown.Template; using OliverBooth.Extensions.Markdig.Services; namespace OliverBooth.Extensions.Markdig; /// /// Extension methods for . /// public static class MarkdownPipelineExtensions { /// /// Enables the use of Wiki-style templates in this pipeline. /// /// The Markdig markdown pipeline builder. /// The template service responsible for fetching and rendering templates. /// The modified Markdig markdown pipeline builder. /// /// is . /// -or- /// is . /// public static MarkdownPipelineBuilder UseTemplates(this MarkdownPipelineBuilder builder, ITemplateService templateService) { if (builder is null) { throw new ArgumentNullException(nameof(builder)); } if (templateService is null) { throw new ArgumentNullException(nameof(templateService)); } builder.Use(new TemplateExtension(templateService)); return builder; } }