You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
821 B
36 lines
821 B
#include <fmt/core.h>
|
|
#include <numeric>
|
|
#include <cassert>
|
|
#include <fstream>
|
|
#include <iostream>
|
|
#include "parser.hpp"
|
|
#include "dbc.hpp"
|
|
#include <nlohmann/json.hpp>
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
using std::string, nlohmann::json, std::shared_ptr, std::make_shared;
|
|
|
|
string load_file(const string& md_file) {
|
|
std::ifstream in_file{md_file, std::ios::binary};
|
|
dbc::check(bool(in_file), fmt::format("failed to load {}", md_file));
|
|
|
|
return string(std::istreambuf_iterator<char>(in_file), std::istreambuf_iterator<char>());
|
|
}
|
|
|
|
std::shared_ptr<SlideDeck> parse_slides(const std::string& md_file) {
|
|
auto contents = load_file(md_file);
|
|
Parser rp;
|
|
rp.parse(contents);
|
|
return rp.results();
|
|
}
|
|
|
|
Parser::Parser()
|
|
{
|
|
deck = make_shared<SlideDeck>();
|
|
}
|
|
|
|
void Parser::finalize() {
|
|
}
|
|
|
|
#include "./md_parser.cpp"
|
|
|