public void TestHtml() { var code = @" # Person things Now this is a story all about how my life got flipped turned upside down and I'd like to take a minute just sit right there I'll tell you how I become the prince of a town called Bel Air. alias Name = String & min 5 & max 28 alias Names = List Name type Person = @ The First Name of the Person FirstName: Name; LastName: Maybe String; Age: Number; Tags: List String & min 3 & max 30 ; Names: Names; Points to look out for: * Item 1 * Item 2 * Other 1 * Other 2 * Item 3 "; var tokens = new Lexer().Lex(code); var parser = new Parser(tokens); var parseTree = parser.Parse().ToList(); HtmlMapper mapper = new HtmlMapper(parseTree); _ = mapper.Start().ToList(); var document = mapper.ToString(); Assert.True(document.Count() > 0); }
public void TestList() { var code = @" * Item 1 * Item 2 * Other 1 * Other 2 * Item 3 "; var generator = new ASTGenerator(code); var mapper = new HtmlMapper(generator); _ = mapper.Start().ToList(); var document = mapper.ToString(); Assert.True(document.Any()); }
public void ConvertToHTML() { var code = @" # This is a chapter And another chapter! ## This is a subChapter And a few paragraphs to see how things are coming along! > NOTE: a simple note! ``` function foo() { return 12; } ``` type Person = FirstName: String; * One * Two * Three * Four "; var g = new ASTGenerator(code); var mapper = new HtmlMapper(g.AST); _ = mapper.Start().ToList(); //var html = mapper.ToHtmlString(new Dictionary<string, string>()).Trim(); //var txt = File.ReadAllText("./HTML/Example01.html"); //Assert.Equal(txt, html); Assert.True(true); }
public void TestList() { var code = @" * Item 1 * Item 2 * Other 1 * Other 2 * Item 3 "; var tokens = new Lexer().Lex(code); var parser = new Parser(tokens); var parseTree = parser.Parse().ToList(); HtmlMapper mapper = new HtmlMapper(parseTree); _ = mapper.Start().ToList(); var document = mapper.ToString(); Assert.True(document.Count() > 0); }
public void ConvertToHTML() { var code = @" # This is a chapter And another chapter! ## This is a subChapter And a few paragraphs to see how things are coming along! > NOTE: a simple note! ``` function foo() { return 12; } ``` type Person = FirstName: String; * One * Two * Three * Four "; var g = new ASTGenerator(code); var mapper = new HtmlMapper(g); _ = mapper.Start().ToList(); Assert.True(true); }