stuff-from-scratch/test/web/TestMarkdownParser.cpp

26 lines
582 B
C++
Raw Normal View History

2022-01-01 18:46:31 +00:00
#include "MarkdownParser.h"
#include "File.h"
#include "HtmlWriter.h"
int main()
{
File md_file("/home/jmsgrogan/code/MediaTool/test/data/sample_markdown.md");
md_file.Open();
const auto md_content = md_file.ReadText();
MarkdownParser parser;
parser.Run(md_content);
auto html = parser.GetHtml();
HtmlWriter writer;
const auto html_string = writer.ToString(html);
File html_file("TestMarkdownParserOut.html");
html_file.SetAccessMode(File::AccessMode::Write);
html_file.Open();
html_file.WriteText(html_string);
return 0;
}