public HomeController(MarkdownLoader markdownLoader) { markdownBundle = markdownLoader.TryGetBundle("root"); if (markdownBundle == null) { throw new ArgumentException("Couldn't get root bundle", nameof(markdownLoader)); } }
private MarkdownPage LoadPage(string directory, string id, MarkdownBundle bundle) { var file = fileProvider.GetFileInfo($"{directory}/{id}.md"); using (var reader = file.CreateReader()) { return(MarkdownPage.Load(id, bundle, reader, commonMarkSettings)); } }
public HomeController(MarkdownLoader markdownLoader, ITzdbRepository repository) { markdownBundle = markdownLoader.TryGetBundle("root"); if (markdownBundle == null) { throw new ArgumentException("Couldn't get root bundle", nameof(markdownLoader)); } this.repository = repository; }
private MarkdownPage LoadPage(string directory, string id, MarkdownBundle bundle) { var filename = $"{directory}/{id}.md"; try { var file = fileProvider.GetFileInfo(filename); using (var reader = file.CreateReader()) { return(MarkdownPage.Load(id, bundle, reader, commonMarkSettings)); } } catch (Exception e) { throw new Exception($"Unable to parse markdown content from {filename}", e); } }