|
|
@ -10,7 +10,7 @@ using std::shared_ptr, std::string, nlohmann::json; |
|
|
|
namespace fs = std::filesystem; |
|
|
|
namespace fs = std::filesystem; |
|
|
|
|
|
|
|
|
|
|
|
shared_ptr<SlideDeck> parse_slides(const string& md_file) { |
|
|
|
shared_ptr<SlideDeck> parse_slides(const string& md_file) { |
|
|
|
shared_ptr<SlideDeck> slides = std::make_shared<SlideDeck>(); |
|
|
|
shared_ptr<SlideDeck> deck = std::make_shared<SlideDeck>(); |
|
|
|
|
|
|
|
|
|
|
|
dbc::check(fs::exists(md_file), "md file missing"); |
|
|
|
dbc::check(fs::exists(md_file), "md file missing"); |
|
|
|
|
|
|
|
|
|
|
@ -33,6 +33,7 @@ shared_ptr<SlideDeck> parse_slides(const string& md_file) { |
|
|
|
config = json::parse(json_data); |
|
|
|
config = json::parse(json_data); |
|
|
|
std::cout << "JSON: " << config << '\n'; |
|
|
|
std::cout << "JSON: " << config << '\n'; |
|
|
|
} else if(line == "===") { |
|
|
|
} else if(line == "===") { |
|
|
|
|
|
|
|
deck->config = config; |
|
|
|
fmt::println("START"); |
|
|
|
fmt::println("START"); |
|
|
|
started = true; |
|
|
|
started = true; |
|
|
|
} else if(line == "---") { |
|
|
|
} else if(line == "---") { |
|
|
@ -46,7 +47,7 @@ shared_ptr<SlideDeck> parse_slides(const string& md_file) { |
|
|
|
content += line + "\n"; |
|
|
|
content += line + "\n"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
slides->emplace_back(title, content, config); |
|
|
|
deck->slides.emplace_back(title, content, config); |
|
|
|
config = json::parse("{}"); |
|
|
|
config = json::parse("{}"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
fmt::println("JUNK: {}", line); |
|
|
|
fmt::println("JUNK: {}", line); |
|
|
@ -55,5 +56,5 @@ shared_ptr<SlideDeck> parse_slides(const string& md_file) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return slides; |
|
|
|
return deck; |
|
|
|
} |
|
|
|
} |
|
|
|