public static async Task WriteRootReadMeAsync(this IStorage storage, RootReadMeContext context, CancellationToken token) { storage.AssertNotNull(nameof(storage)); context.AssertNotNull(nameof(context)); var template = await GetOrCreateConfigurationTemplateAsync( storage, ReadMeTemplateFileName, DotLiquidTemplate.GetRootReadMeTemplate, token); var readMe = DotLiquidTemplate.Render(template, context); await storage.WriteRootFileAsync(ReadMeFileName, readMe, token); }
public static async Task WriteLibraryReadMeAsync(this IStorage storage, LibraryId id, object context, CancellationToken token) { storage.AssertNotNull(nameof(storage)); context.AssertNotNull(nameof(context)); var templateFileName = LibraryReadMeTemplateFileName.FormatWith(id.SourceCode.ToLowerInvariant()); var template = await GetOrCreateConfigurationTemplateAsync( storage, templateFileName, () => DotLiquidTemplate.GetLibraryReadMeTemplate(id.SourceCode), token); var readMe = DotLiquidTemplate.Render(template, context); await storage.WriteLibraryFileAsync(id, ReadMeFileName, readMe, token); }