protected override void When() { try { _sut.Parse(_frontMatter); } catch (ParsingException exception) { _exception = exception; } }
private void LoadInclude(string includeRelPath, Site site) { IMetadata data; string rawContent; var path = GetPath(includeRelPath); FrontMatterParser.Parse(System.IO.File.ReadAllText(path), out rawContent, out data); var name = Path.GetFileNameWithoutExtension(path); site.Includes.Add(new TemplateMock(name, rawContent, data)); }
private void ParseTextFile(IFile src, out string rawContent, out IMetadata data, out string layoutName) { try { FrontMatterParser.Parse(src.AsTextContent(), out rawContent, out data); layoutName = data.GetRemoveParameterOrDefault <string>(LAYOUT_VAR_NAME); } catch (Exception ex) { throw new UserMessageException($"Failed to deserialize the metadata from the '{src.Location.ToPath()}'", ex); } }
protected override void When() { _result = _sut.Parse(_frontMatter); }