Ejemplo n.º 1
0
 public static Specification ReadFromText(string text)
 {
     using (var reader = new MarkdownReader(new StringReader(text)))
     {
         return(reader.Read());
     }
 }
Ejemplo n.º 2
0
        public static Specification ReadFromFile(string file)
        {
            using (var stream = new FileStream(file, FileMode.Open, FileAccess.Read))
            {
                using (var reader = new StreamReader(stream))
                {
                    var spec = new MarkdownReader(reader).Read();
                    spec.Filename = file;

                    if (spec.name.IsEmpty())
                    {
                        spec.name = Path.GetFileNameWithoutExtension(file);
                        Console.WriteLine($"The spec file at {file} appears to be empty");
                    }

                    return(spec);
                }
            }
        }