Adds prototype for mapping out pages for navigation sections

This commit is contained in:
Rosia E Evans 2023-10-09 13:53:09 +01:00
parent dc03e239d5
commit 2fbec8869d
14 changed files with 69 additions and 9 deletions

View file

@ -20,6 +20,7 @@
<li><a href=/inputfile.html>Hello world!</a></li> <li><a href=/inputfile.html>Hello world!</a></li>
<li><a href=/EPQProject.html>EPQ Project</a></li> <li><a href=/EPQProject.html>EPQ Project</a></li>
<li><a href=/RoboticsSociety.html>Aber Robotics Soc</a></li> <li><a href=/RoboticsSociety.html>Aber Robotics Soc</a></li>
<li><a href=/ThisSite.html>This Site</a></li>
<li><a href=/Aardvark.html>AardvarkXR</a></li> <li><a href=/Aardvark.html>AardvarkXR</a></li>
<li><a href=/MindMap.html>Mind Map Maker</a></li> <li><a href=/MindMap.html>Mind Map Maker</a></li>
<li><a href=/aberCompSoc.html>aberCompSoc</a></li> <li><a href=/aberCompSoc.html>aberCompSoc</a></li>

View file

@ -20,6 +20,7 @@
<li><a href=/inputfile.html>Hello world!</a></li> <li><a href=/inputfile.html>Hello world!</a></li>
<li><a href=/EPQProject.html>EPQ Project</a></li> <li><a href=/EPQProject.html>EPQ Project</a></li>
<li><a href=/RoboticsSociety.html>Aber Robotics Soc</a></li> <li><a href=/RoboticsSociety.html>Aber Robotics Soc</a></li>
<li><a href=/ThisSite.html>This Site</a></li>
<li><a href=/Aardvark.html>AardvarkXR</a></li> <li><a href=/Aardvark.html>AardvarkXR</a></li>
<li><a href=/MindMap.html>Mind Map Maker</a></li> <li><a href=/MindMap.html>Mind Map Maker</a></li>
<li><a href=/aberCompSoc.html>aberCompSoc</a></li> <li><a href=/aberCompSoc.html>aberCompSoc</a></li>

View file

@ -20,6 +20,7 @@
<li><a href=/inputfile.html>Hello world!</a></li> <li><a href=/inputfile.html>Hello world!</a></li>
<li><a href=/EPQProject.html>EPQ Project</a></li> <li><a href=/EPQProject.html>EPQ Project</a></li>
<li><a href=/RoboticsSociety.html>Aber Robotics Soc</a></li> <li><a href=/RoboticsSociety.html>Aber Robotics Soc</a></li>
<li><a href=/ThisSite.html>This Site</a></li>
<li><a href=/Aardvark.html>AardvarkXR</a></li> <li><a href=/Aardvark.html>AardvarkXR</a></li>
<li><a href=/MindMap.html>Mind Map Maker</a></li> <li><a href=/MindMap.html>Mind Map Maker</a></li>
<li><a href=/aberCompSoc.html>aberCompSoc</a></li> <li><a href=/aberCompSoc.html>aberCompSoc</a></li>

View file

@ -20,6 +20,7 @@
<li><a href=/inputfile.html>Hello world!</a></li> <li><a href=/inputfile.html>Hello world!</a></li>
<li><a href=/EPQProject.html>EPQ Project</a></li> <li><a href=/EPQProject.html>EPQ Project</a></li>
<li><a href=/RoboticsSociety.html>Aber Robotics Soc</a></li> <li><a href=/RoboticsSociety.html>Aber Robotics Soc</a></li>
<li><a href=/ThisSite.html>This Site</a></li>
<li><a href=/Aardvark.html>AardvarkXR</a></li> <li><a href=/Aardvark.html>AardvarkXR</a></li>
<li><a href=/MindMap.html>Mind Map Maker</a></li> <li><a href=/MindMap.html>Mind Map Maker</a></li>
<li><a href=/aberCompSoc.html>aberCompSoc</a></li> <li><a href=/aberCompSoc.html>aberCompSoc</a></li>

View file

@ -20,6 +20,7 @@
<li><a href=/inputfile.html>Hello world!</a></li> <li><a href=/inputfile.html>Hello world!</a></li>
<li><a href=/EPQProject.html>EPQ Project</a></li> <li><a href=/EPQProject.html>EPQ Project</a></li>
<li><a href=/RoboticsSociety.html>Aber Robotics Soc</a></li> <li><a href=/RoboticsSociety.html>Aber Robotics Soc</a></li>
<li><a href=/ThisSite.html>This Site</a></li>
<li><a href=/Aardvark.html>AardvarkXR</a></li> <li><a href=/Aardvark.html>AardvarkXR</a></li>
<li><a href=/MindMap.html>Mind Map Maker</a></li> <li><a href=/MindMap.html>Mind Map Maker</a></li>
<li><a href=/aberCompSoc.html>aberCompSoc</a></li> <li><a href=/aberCompSoc.html>aberCompSoc</a></li>

View file

@ -20,6 +20,7 @@
<li><a href=/inputfile.html>Hello world!</a></li> <li><a href=/inputfile.html>Hello world!</a></li>
<li><a href=/EPQProject.html>EPQ Project</a></li> <li><a href=/EPQProject.html>EPQ Project</a></li>
<li><a href=/RoboticsSociety.html>Aber Robotics Soc</a></li> <li><a href=/RoboticsSociety.html>Aber Robotics Soc</a></li>
<li><a href=/ThisSite.html>This Site</a></li>
<li><a href=/Aardvark.html>AardvarkXR</a></li> <li><a href=/Aardvark.html>AardvarkXR</a></li>
<li><a href=/MindMap.html>Mind Map Maker</a></li> <li><a href=/MindMap.html>Mind Map Maker</a></li>
<li><a href=/aberCompSoc.html>aberCompSoc</a></li> <li><a href=/aberCompSoc.html>aberCompSoc</a></li>

View file

@ -41,6 +41,6 @@ pre
} }
img{ img{
width: 50%; width: 100%;
margin-top: 10px; margin-top: 10px;
} }

View file

@ -20,6 +20,7 @@
<li><a href=/inputfile.html>Hello world!</a></li> <li><a href=/inputfile.html>Hello world!</a></li>
<li><a href=/EPQProject.html>EPQ Project</a></li> <li><a href=/EPQProject.html>EPQ Project</a></li>
<li><a href=/RoboticsSociety.html>Aber Robotics Soc</a></li> <li><a href=/RoboticsSociety.html>Aber Robotics Soc</a></li>
<li><a href=/ThisSite.html>This Site</a></li>
<li><a href=/Aardvark.html>AardvarkXR</a></li> <li><a href=/Aardvark.html>AardvarkXR</a></li>
<li><a href=/MindMap.html>Mind Map Maker</a></li> <li><a href=/MindMap.html>Mind Map Maker</a></li>
<li><a href=/aberCompSoc.html>aberCompSoc</a></li> <li><a href=/aberCompSoc.html>aberCompSoc</a></li>
@ -28,9 +29,17 @@
</nav> </nav>
<article><h1>Welcome!</h1> <article><h1>Welcome!</h1>
<p>I'm Rosia Evans, this is my site where I log my work for myself and for me to show to others.</p> <p>I'm Rosia Evans, this is my site where I log my work for myself and for me to show to others.</p>
<p>I'm currently studying at a small university in wales where I'm doing a BEng in software engineering whilst working on robotics and exploring my own interests on the side through various societies. I've previously had interests in VR and XR and UI design, spending a lot of my secondary school years experimenting with both concepts.</p> <p>This site is generated procedurally from markdown though C++ code I've written and hosted using <a href="https://www.lighttpd.net/">lighttpd</a> on an old laptop through my router. You can find the code for it <a href="https://github.com/Wil-Ro/Blog">here</a> and a more indepth talk about it on <a href="/ThisSite.html">this blog post</a>.</p>
<hr>
<p>I'm currently studying at a small university in wales where I'm doing a BEng in software engineering whilst working on robotics and exploring my own interests on the side through various societies and personal projects.</p>
<p><img src="/profile.jpeg" alt="image of me"></p>
<p>Nowadays my interests lie mostly in low-power computing and electronics, experimenting with how computers can work in a more environmentally friendly manner. I find the environment is something I think about a lot and finding overlaps between it and my interests in computing has lead me to some really intersting communities.</p>
<p>On the side of this I also enjoy using code to create music through programming using <a href="https://sonic-pi.net/">Sonic-Pi</a> and just creating programs in general with friends and colleagues. Most of my work can either be found in blog-posts here or on my <a href="https://github.com/Wil-Ro">github</a>.</p>
<p>I've previously had interests in VR and XR and UI design, spending a lot of my secondary school years experimenting with both concepts so both websites also have a few probjects relating to those concepts.</p>
<p>To see my work, check the navbox to the side</p> <p>To see my work, check the navbox to the side</p>
<p>&lt;-</p> <p>&lt;-</p>
<h2>DISCLAMER! SITE STILL IN PROGRESS</h2>
<p>This is all a bit everywhere rn, the css will be given some frills at somepoint soon</p>
</article> </article>
</main> </main>

View file

@ -20,6 +20,7 @@
<li><a href=/inputfile.html>Hello world!</a></li> <li><a href=/inputfile.html>Hello world!</a></li>
<li><a href=/EPQProject.html>EPQ Project</a></li> <li><a href=/EPQProject.html>EPQ Project</a></li>
<li><a href=/RoboticsSociety.html>Aber Robotics Soc</a></li> <li><a href=/RoboticsSociety.html>Aber Robotics Soc</a></li>
<li><a href=/ThisSite.html>This Site</a></li>
<li><a href=/Aardvark.html>AardvarkXR</a></li> <li><a href=/Aardvark.html>AardvarkXR</a></li>
<li><a href=/MindMap.html>Mind Map Maker</a></li> <li><a href=/MindMap.html>Mind Map Maker</a></li>
<li><a href=/aberCompSoc.html>aberCompSoc</a></li> <li><a href=/aberCompSoc.html>aberCompSoc</a></li>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 MiB

View file

@ -41,6 +41,6 @@ pre
} }
img{ img{
width: 50%; width: 100%;
margin-top: 10px; margin-top: 10px;
} }

View file

@ -73,7 +73,7 @@ std::string BlogPageBuilder::generateNavSection()
isOptionEnabled(OptionFlags::HIDE_PRIVATE)) isOptionEnabled(OptionFlags::HIDE_PRIVATE))
continue; continue;
buffer buffer
<< "<li><a href=" << page->getRelativeUrl() << ">" << "<li><a href=" << page->getRelativeOutUrl() << ">"
<< page->getPageTitle() << page->getPageTitle()
<< "</a></li>\n"; << "</a></li>\n";
} }

View file

@ -32,7 +32,7 @@ Page::Page(std::string sourceFileUrl, std::string outFolderUrl)
calculatePageFlags(); calculatePageFlags();
calculatePageTitle(); calculatePageTitle();
this->outFileUrl = outFolderUrl + getRelativeUrl(); this->outFileUrl = outFolderUrl + getRelativeOutUrl();
} }
std::string Page::getSourceFileContents() std::string Page::getSourceFileContents()
@ -40,12 +40,13 @@ std::string Page::getSourceFileContents()
return sourceFileContents; return sourceFileContents;
} }
std::string Page::getOutFileUrl() std::string Page::getOutUrl()
{ {
return outFileUrl; return outFileUrl;
} }
std::string Page::getRelativeUrl() // includes first /
std::string Page::getRelativeOutUrl()
{ {
int start = sourceFileUrl.find_last_of("/"); int start = sourceFileUrl.find_last_of("/");
std::string relativeUrl = std::string(sourceFileUrl).substr(start, sourceFileUrl.length()-start); std::string relativeUrl = std::string(sourceFileUrl).substr(start, sourceFileUrl.length()-start);
@ -53,6 +54,20 @@ std::string Page::getRelativeUrl()
return relativeUrl; return relativeUrl;
} }
std::string Page::getInUrl()
{
return sourceFileUrl;
}
// includes first /
std::string Page::getRelativeInUrl()
{
int start = strlen(SOURCE_FILE_FOLDER)+1;
std::string relativeUrl = std::string(sourceFileUrl).substr(start, sourceFileUrl.length()-start);
relativeUrl.replace(relativeUrl.length()-3, 3, ".html");
return relativeUrl;
}
FileFlags Page::getPageFlags() FileFlags Page::getPageFlags()
{ {
return flags; return flags;

View file

@ -3,6 +3,10 @@
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <cstring>
#include <vector>
#include "MacroDefinitions.h"
struct FileFlags struct FileFlags
@ -43,8 +47,13 @@ public:
Page(std::string sourceFileUrl, std::string outFolderUrl); Page(std::string sourceFileUrl, std::string outFolderUrl);
std::string getSourceFileContents(); std::string getSourceFileContents();
std::string getOutFileUrl();
std::string getRelativeUrl(); std::string getInUrl();
std::string getRelativeInUrl();
std::string getOutUrl();
std::string getRelativeOutUrl();
std::string getPageTitle(); std::string getPageTitle();
FileFlags getPageFlags(); FileFlags getPageFlags();
@ -53,3 +62,23 @@ public:
void writePageToFile(); void writePageToFile();
}; };
/*
* Class to represent the structure of the nav menu, the categories of the pages
*/
// A node can either be a file or a folder, value for each possibility.
struct PageTreeNode
{
std::vector<PageTreeNode> branches;
Page* pageValue;
std::string folderValue;
};
class PageTree
{
private:
PageTreeNode* rootNode;
public:
PageTreeNode* getNodeLinear(int x);
std::vector<PageTreeNode> getTreeAsList();
};