Archived
1
0

remove mustache

This commit is contained in:
Jeff Becker
2018-05-06 09:42:31 -04:00
parent 8263a92432
commit ac91e309d9
26 changed files with 96 additions and 1057 deletions

View File

@@ -26,7 +26,13 @@ typedef std::tuple<PostHeader, PostBody, Attachments> Post;
// a thread (many posts in post order)
typedef std::vector<Post> Thread;
// a board page is many threads in bump order
typedef std::vector<Thread> BoardPage;
struct BoardPage
{
std::vector<Thread> threads = {};
std::string name = "";
uint32_t pageno = 0;
};
static inline const std::string &GetFilename(const PostAttachment &att) { return std::get<0>(att); }

View File

@@ -12,13 +12,16 @@ namespace nntpchan
struct TemplateEngine
{
typedef std::map<std::string, std::variant<nntpchan::model::Model, std::string>> Args_t;
virtual bool WriteTemplate(const fs::path &template_fpath, const Args_t &args, const FileHandle_ptr &out) = 0;
virtual ~TemplateEngine() {};
virtual bool WriteBoardPage(const nntpchan::model::BoardPage & page, const FileHandle_ptr &out) = 0;
virtual bool WriteThreadPage(const nntpchan::model::Thread & thread, const FileHandle_ptr &out) = 0;
};
TemplateEngine *CreateTemplateEngine(const std::string &dialect);
typedef std::unique_ptr<TemplateEngine> TemplateEngine_ptr;
TemplateEngine * CreateTemplateEngine(const std::string &dialect);
}
#endif