create modules

This commit is contained in:
2026-01-11 20:59:50 +01:00
parent dd2c6ca810
commit fe02a16416
9 changed files with 0 additions and 14 deletions

24
src/markdown/markdown.hpp Normal file
View File

@@ -0,0 +1,24 @@
#include <ctime>
#include <optional>
#include <string>
#include <toml++/toml.hpp>
#include <vector>
struct Metadata {
std::string author;
time_t date;
std::string title;
std::vector<std::string> tags;
};
// Reads the metadata of the markdown file
// Metadata are in yaml format at the top of the file
// They are separated from the rest of the file with `---` at the beginning and
// at the end.
//
// Returns nullopt when no metadata is found in the file
std::optional<Metadata> get_metadata(const std::string &FILE_PATH);
// Reads the markdown file and converts it to html.
// Return everything in one string
std::string get_html(const std::string &FILE_PATH);