コード例 #1
0
 protected override void When()
 {
     try
     {
         _sut.Parse(_frontMatter);
     }
     catch (ParsingException exception)
     {
         _exception = exception;
     }
 }
コード例 #2
0
        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));
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
 protected override void When()
 {
     _result = _sut.Parse(_frontMatter);
 }