Adds beginnings of BlogPageBuilder and associated classes
This commit is contained in:
parent
65aefe46ce
commit
1506f661c9
114 changed files with 4740 additions and 518 deletions
35
Src/BlogPageBuilder.h
Normal file
35
Src/BlogPageBuilder.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
#include "BlogParser.h"
|
||||
#include "Page.h"
|
||||
|
||||
/*
|
||||
* Class that builds blog pages, takes a template page to plut the blog-post in
|
||||
* along with an optional artifleIdentifier. The template is searched for this
|
||||
* and the blog is placed after it.
|
||||
*/
|
||||
|
||||
class BlogPageBuilder
|
||||
{
|
||||
private:
|
||||
std::string pageTemplate;
|
||||
std::string articleIdentifier;
|
||||
|
||||
std::vector<Page> pages;
|
||||
|
||||
std::string navSection;
|
||||
|
||||
std::string readFile(std::string fileUrl);
|
||||
int calculateArticleIdentifierLocation(std::string text);
|
||||
|
||||
public:
|
||||
std::string createPage(std::string mdFileUrl);
|
||||
std::string generateNavSection();
|
||||
BlogPageBuilder(std::string templateFileUrl, std::string articleIdentifier = "<article>");
|
||||
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue