stuff-from-scratch/apps/website-generator/MarkdownContentParser.h

23 lines
480 B
C
Raw Normal View History

2022-10-03 07:46:41 +00:00
#pragma once
2023-12-21 09:18:44 +00:00
#include "String.h"
2022-10-03 07:46:41 +00:00
#include <optional>
2023-12-27 12:20:02 +00:00
#include Map.h
#include <filesystem>
2023-12-21 09:18:44 +00:00
#include "Vector.h"
using Path = std::filesystem::path;
class MarkdownDocument;
2022-10-03 07:46:41 +00:00
class MarkdownContentParser
{
public:
2023-12-21 09:18:44 +00:00
using FileMetadataItem = std::pair<String, String>;
2023-12-27 12:20:02 +00:00
using FileMetadata = Map<String, String>;
2022-10-03 07:46:41 +00:00
2023-12-21 09:18:44 +00:00
std::pair<FileMetadata, Ptr<MarkdownDocument>> run(const Path& path);
2022-10-03 07:46:41 +00:00
private:
2024-01-02 16:14:23 +00:00
Optional<FileMetadataItem> checkForMetadataItem(const String& line) const;
2022-10-03 07:46:41 +00:00
};