This commit is contained in:
thepra 2017-05-25 22:35:59 +02:00
parent 2ba9bf7ebc
commit 74c8a857e4
3 changed files with 83 additions and 85 deletions

View File

@ -93,12 +93,12 @@ void GeneralBuilder::BuildThePraSite(Sites site)
}
}
void GeneralBuilder::Head(Document &file,
string canonicalURL,
string title,
Levels level,
string description,
list<string> cssStyles)
void GeneralBuilder::Head( Document &file,
string canonicalURL,
string title,
Levels level,
string description,
list<string> cssStyles)
{
string whichLevel = ChooseLevel(level);
// ESSENTIAL
@ -164,6 +164,7 @@ void GeneralBuilder::Body(Document &file, string cPath, Sites site, Col color, P
void GeneralBuilder::WriteToFile(Document doc, string p)
{
//cout << doc.ToString(Readability::MULTILINE) << endl;
path PathToCheck = path(p);
if (exists(PathToCheck))
{

View File

@ -16,7 +16,7 @@ using namespace CTML;
int main()
{
GeneralBuilder dev;
dev.BuildThePraSite(Utilities::ART);
dev.BuildThePraSite(Utilities::DEV);
cout << "DONE";
getchar();
return 0;

View File

@ -26,7 +26,7 @@ public:
contentFolder + "about.txt",
contentFolder + "contact.txt"
};
string outputPath{current_path().append("output_thepradev\\").string()};
string outputPath{ current_path().append("output_thepradev\\").string() };
string outputLinks[5]{
outputPath + "index.html",
outputPath + "code.html",
@ -40,7 +40,7 @@ public:
private:
static list<Node> NavigationBar(Levels level, DeskOrMob mtype);
static list<Node> SingleMainContent(Levels level, string cPath, DeskOrMob mtype, list<string> content = {""});
static list<Node> SingleMainContent(Levels level, string cPath, DeskOrMob mtype, list<string> content = { "" });
static Node Extra(Levels level);
static Node Player(Levels level);
};
@ -82,71 +82,71 @@ inline list<Node> ThePraDev::NavigationBar(Levels level, DeskOrMob mtype)
string whichLevel = ChooseLevel(level);
switch (mtype)
{
case D:
{
Node elem0 = Node("div#header");
Node elem05 = Node("div.navigation_bar");
Node elem1 = Node("img").SetAttribute(a.src, whichLevel + "icon/up.png").SetAttribute(a.alt, "Upper Decoration").UseClosingTag(false);
Node elem2 = Node("ul.bortrr.borbrr");
Node elem3 = Node("li.bortrr").AppendChild(Node(a.a, a.Home).SetAttribute(a.href, whichLevel + a.index));
Node elem4 = Node(a.li).AppendChild(Node(a.a, a.Code).SetAttribute(a.href, whichLevel + a.code));
Node elem5 = Node(a.li).AppendChild(Node(a.a, a.Blog).SetAttribute(a.href, whichLevel + a.blog));
Node elem6 = Node(a.li).AppendChild(Node(a.a, a.About).SetAttribute(a.href, whichLevel + a.about));
Node elem7 = Node(a.li).AppendChild(Node(a.a, a.Contact).SetAttribute(a.href, whichLevel + a.contact));
Node elem8 = Extra(level);
Node elem9 = Node("img").SetAttribute(a.src, whichLevel + "icon/down.png").SetAttribute(a.alt, "Down Decoration").UseClosingTag(false);
case D:
{
Node elem0 = Node("div#header");
Node elem05 = Node("div.navigation_bar");
Node elem1 = Node("img").SetAttribute(a.src, whichLevel + "icon/up.png").SetAttribute(a.alt, "Upper Decoration").UseClosingTag(false);
Node elem2 = Node("ul.bortrr.borbrr");
Node elem3 = Node("li.bortrr").AppendChild(Node(a.a, a.Home).SetAttribute(a.href, whichLevel + a.index));
Node elem4 = Node(a.li).AppendChild(Node(a.a, a.Code).SetAttribute(a.href, whichLevel + a.code));
Node elem5 = Node(a.li).AppendChild(Node(a.a, a.Blog).SetAttribute(a.href, whichLevel + a.blog));
Node elem6 = Node(a.li).AppendChild(Node(a.a, a.About).SetAttribute(a.href, whichLevel + a.about));
Node elem7 = Node(a.li).AppendChild(Node(a.a, a.Contact).SetAttribute(a.href, whichLevel + a.contact));
Node elem8 = Extra(level);
Node elem9 = Node("img").SetAttribute(a.src, whichLevel + "icon/down.png").SetAttribute(a.alt, "Down Decoration").UseClosingTag(false);
elem05.AppendChild(elem1)
.AppendChild(elem2
.AppendChild(elem3)
.AppendChild(elem4)
.AppendChild(elem5)
.AppendChild(elem6)
.AppendChild(elem7)
.AppendChild(elem8))
.AppendChild(elem9);
elem0.AppendChild(elem05);
elem05.AppendChild(elem1)
.AppendChild(elem2
.AppendChild(elem3)
.AppendChild(elem4)
.AppendChild(elem5)
.AppendChild(elem6)
.AppendChild(elem7)
.AppendChild(elem8))
.AppendChild(elem9);
elem0.AppendChild(elem05);
return{{elem0}};
}
break;
case M:
{
Node elem0 = Node("div#headerm");
Node elem05 = Node("div.navigation_barm");
Node elem1 = Node("img.immagini_laterali").SetAttribute(a.src, whichLevel + "icon/left.png").SetAttribute(a.alt, "Upper Left Decoration").UseClosingTag(false);
Node elem2 = Node("div.navigation_barminner");
return{ {elem0} };
}
break;
case M:
{
Node elem0 = Node("div#headerm");
Node elem05 = Node("div.navigation_barm");
Node elem1 = Node("img.immagini_laterali").SetAttribute(a.src, whichLevel + "icon/left.png").SetAttribute(a.alt, "Upper Left Decoration").UseClosingTag(false);
Node elem2 = Node("div.navigation_barminner");
Node elem3 = Node("nav._nav");
Node elem4 = Node("label.toggle").SetAttribute("for", "drop").SetContent(a.Menu);
Node elem5 = Node("input#drop").SetAttribute("type", "checkbox").UseClosingTag(false);
Node elem6 = Node("ul.menu");
Node elem7 = Node(a.li).AppendChild(Node(a.a, a.Home).SetAttribute(a.href, whichLevel + a.index));
Node elem8 = Node(a.li).AppendChild(Node(a.a, a.Code).SetAttribute(a.href, whichLevel + a.code));
Node elem9 = Node(a.li).AppendChild(Node(a.a, a.Blog).SetAttribute(a.href, whichLevel + a.blog));
Node elem10 = Node(a.li).AppendChild(Node(a.a, a.About).SetAttribute(a.href, whichLevel + a.about));
Node elem11 = Node(a.li).AppendChild(Node(a.a, a.Contact).SetAttribute(a.href, whichLevel + a.contact));
Node elem3 = Node("nav._nav");
Node elem4 = Node("label.toggle").SetAttribute("for", "drop").SetContent(a.Menu);
Node elem5 = Node("input#drop").SetAttribute("type", "checkbox").UseClosingTag(false);
Node elem6 = Node("ul.menu");
Node elem7 = Node(a.li).AppendChild(Node(a.a, a.Home).SetAttribute(a.href, whichLevel + a.index));
Node elem8 = Node(a.li).AppendChild(Node(a.a, a.Code).SetAttribute(a.href, whichLevel + a.code));
Node elem9 = Node(a.li).AppendChild(Node(a.a, a.Blog).SetAttribute(a.href, whichLevel + a.blog));
Node elem10 = Node(a.li).AppendChild(Node(a.a, a.About).SetAttribute(a.href, whichLevel + a.about));
Node elem11 = Node(a.li).AppendChild(Node(a.a, a.Contact).SetAttribute(a.href, whichLevel + a.contact));
Node elem12 = Node("img.immagini_laterali").SetAttribute(a.src, whichLevel + "icon/right.png").SetAttribute(a.alt, "Upper Right Decoration").UseClosingTag(false);
Node elem12 = Node("img.immagini_laterali").SetAttribute(a.src, whichLevel + "icon/right.png").SetAttribute(a.alt, "Upper Right Decoration").UseClosingTag(false);
elem05.AppendChild(elem2
.AppendChild(elem3
.AppendChild(elem4)
.AppendChild(elem5)
.AppendChild(elem6
.AppendChild(elem7)
.AppendChild(elem8)
.AppendChild(elem9)
.AppendChild(elem10)
.AppendChild(elem11))));
elem0.AppendChild(elem1).AppendChild(elem05).AppendChild(elem12);
//cout << elem0.ToString(Readability::MULTILINE, 5) << endl;
elem05.AppendChild(elem2
.AppendChild(elem3
.AppendChild(elem4)
.AppendChild(elem5)
.AppendChild(elem6
.AppendChild(elem7)
.AppendChild(elem8)
.AppendChild(elem9)
.AppendChild(elem10)
.AppendChild(elem11))));
elem0.AppendChild(elem1).AppendChild(elem05).AppendChild(elem12);
//cout << elem0.ToString(Readability::MULTILINE, 5) << endl;
return{{elem0}};
}
break;
default: return{{}};
break;
return{ {elem0} };
}
break;
default: return{ {} };
break;
}
}
@ -155,7 +155,7 @@ inline list<Node> ThePraDev::SingleMainContent(Levels level, string cPath, DeskO
{
ThePraDev a;
string whichLevel = ChooseLevel(level);
Node mainC = Node("div#main");
Node mainC = Node("div.main");
Node mainMC = mainC;
string STRING;
string contentDesktop = "";
@ -170,8 +170,8 @@ inline list<Node> ThePraDev::SingleMainContent(Levels level, string cPath, DeskO
mainC.SetContent(item+"\n");
}*/
if (mtype == D)
return{mainC};
else return{mainMC};
return{ mainC };
else return{ mainMC };
}
inline Node ThePraDev::Extra(Levels level)
{
@ -180,10 +180,10 @@ inline Node ThePraDev::Extra(Levels level)
Node extra = Node("li.borbrr")
.AppendChild(Node(a.a, "+ Extra +"))
.AppendChild(Node("ul.borbrr")
.AppendChild(Node("li.colbk")
.AppendChild(Node("img.fiximgmenu").SetAttribute(a.src, whichLevel + "icon/signbot.gif").SetAttribute(a.alt, "MotD").UseClosingTag(false)))
.AppendChild(Node(a.li)
.AppendChild(Player(level))));
.AppendChild(Node("li.colbk")
.AppendChild(Node("img.fiximgmenu").SetAttribute(a.src, whichLevel + "icon/signbot.gif").SetAttribute(a.alt, "MotD").UseClosingTag(false)))
.AppendChild(Node(a.li)
.AppendChild(Player(level))));
return extra;
}
@ -193,13 +193,10 @@ inline Node ThePraDev::Player(Levels level)
string whichLevel = ChooseLevel(level);
Node player = Node("div.player")
.AppendChild(Node("audio")
.SetAttribute("controls", "controls")
.SetAttribute("preload", "auto")
.SetContent("Your browser does not support the audio element.")
.AppendChild(Node("source")
.SetAttribute(a.src, whichLevel + "videoplayback.ogg")
.SetAttribute("type", "audio/ogg")
.UseClosingTag(false)));
return player;
.SetAttribute("controls", "controls")
.SetAttribute("preload", "auto")
.SetAttribute(a.src, whichLevel + "videoplayback.ogg")
.SetContent("Your browser does not support the <code>audio</code> element."));
return player;
}