diff --git a/BlogParser.aps b/BlogParser.aps deleted file mode 100644 index 43c304f..0000000 Binary files a/BlogParser.aps and /dev/null differ diff --git a/BlogParser.cpp b/BlogParser.cpp deleted file mode 100644 index ad40aca..0000000 --- a/BlogParser.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include "PageFactory.h" - -int main() -{ - PageFactory* pageFactory = new PageFactory(); - - pageFactory->buildPage("#Hello world"); - - std::cout << pageFactory->getPage(); -} - -/** -* ####### The Plan ####### -* We have a factory, this contains a dictionary with a reference to a load of static objects(?) -* This dictionary is built on startup, each object has a start and end tag and the dictionary holds both -* (its given these on build) -* The factory goes through a given text fileand for each character, checks if its in the dictionary, -* if it is we call that object and pass it all the text until its end char. It will then produce -* output html that is stored in the factory as that page. -* -* Main issues with this: -* We cant have components of a page inside each other :( -* We'll deal with this later -* -* Also, are we building this page on each request? if so how does the user request a file that doesnt exist? -* I guess these are questions for oat++ to answer -*/ - -/* -BIG ISSUE: -we need our identifiers to be char[]'s since we have things like ## which is more than one char. -*/ \ No newline at end of file diff --git a/BlogParser.sln b/BlogParser.sln deleted file mode 100644 index ab50e0c..0000000 --- a/BlogParser.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.3.32901.215 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BlogParser", "BlogParser.vcxproj", "{8691FEF7-3635-4958-8DE1-70B3A0D439E5}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8691FEF7-3635-4958-8DE1-70B3A0D439E5}.Debug|x64.ActiveCfg = Debug|x64 - {8691FEF7-3635-4958-8DE1-70B3A0D439E5}.Debug|x64.Build.0 = Debug|x64 - {8691FEF7-3635-4958-8DE1-70B3A0D439E5}.Debug|x86.ActiveCfg = Debug|Win32 - {8691FEF7-3635-4958-8DE1-70B3A0D439E5}.Debug|x86.Build.0 = Debug|Win32 - {8691FEF7-3635-4958-8DE1-70B3A0D439E5}.Release|x64.ActiveCfg = Release|x64 - {8691FEF7-3635-4958-8DE1-70B3A0D439E5}.Release|x64.Build.0 = Release|x64 - {8691FEF7-3635-4958-8DE1-70B3A0D439E5}.Release|x86.ActiveCfg = Release|Win32 - {8691FEF7-3635-4958-8DE1-70B3A0D439E5}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {70669855-DF9B-4D65-9364-ED1AFEACF708} - EndGlobalSection -EndGlobal diff --git a/BlogParser.vcxproj b/BlogParser.vcxproj deleted file mode 100644 index bfaca51..0000000 --- a/BlogParser.vcxproj +++ /dev/null @@ -1,144 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {8691fef7-3635-4958-8de1-70b3a0d439e5} - BlogParser - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/BlogParser.vcxproj.filters b/BlogParser.vcxproj.filters deleted file mode 100644 index 9bfcd86..0000000 --- a/BlogParser.vcxproj.filters +++ /dev/null @@ -1,51 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {99991709-bfaf-4089-ba9a-66292f776f3e} - - - {c445922c-4e2c-45ee-91eb-0f1d01e4d42c} - - - - - Source Files - - - Source Files - - - Source Files\Components - - - Source Files\Components - - - - - Header Files - - - Header Files - - - Header Files\Components - - - Header Files - - - \ No newline at end of file diff --git a/BlogParser.vcxproj.user b/BlogParser.vcxproj.user deleted file mode 100644 index 88a5509..0000000 --- a/BlogParser.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Component.cpp b/Component.cpp deleted file mode 100644 index 0cc69a8..0000000 --- a/Component.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "Component.h" diff --git a/Component.h b/Component.h deleted file mode 100644 index a918e0c..0000000 --- a/Component.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once -class Component -{ -public: - char startIdentifier; - char endIdentifier; - - virtual std::string generateHTML(std::string markDown); -}; - diff --git a/ComponentList.h b/ComponentList.h deleted file mode 100644 index a6d6128..0000000 --- a/ComponentList.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once -#include -#include "Component.h" - -std::vector componentList = { - -}; \ No newline at end of file diff --git a/Header.cpp b/Header.cpp deleted file mode 100644 index 488141f..0000000 --- a/Header.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "Header.h" - -std::string Header::generateHTML(std::string markDown) -{ - return "

" + markDown + "

"; -} \ No newline at end of file diff --git a/Header.h b/Header.h deleted file mode 100644 index 895021f..0000000 --- a/Header.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once -#include -#include "Component.h" -class Header : public Component -{ - std::string generateHTML(std::string markDown); -}; - diff --git a/MacroDefinitions.h b/MacroDefinitions.h deleted file mode 100644 index a63e1ca..0000000 --- a/MacroDefinitions.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#define TEST_RESOURCE_FOLDER "/home/rosia/Programming/Cpp/BlogParser/Resources/Tests" -#define RESOURCE_FOLDER "/home/rosia/Programming/Cpp/BlogParser/Resources" - -#define SOURCE_FILE_FOLDER "/home/rosia/Programming/Cpp/BlogParser/Resources/Input" -#define OUTPUT_FILE_FOLDER "/home/rosia/Programming/Cpp/BlogParser/Resources/Output" - diff --git a/PageFactory.cpp b/PageFactory.cpp deleted file mode 100644 index 9055ac5..0000000 --- a/PageFactory.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "PageFactory.h" - -PageFactory::PageFactory() -{ - // generate component dictionary - for (Component component : componentList) - { - componentDictionary.push_back({ component.startIdentifier, &component }); - } -} - -void PageFactory::buildPage(std::string markDown) -{ - Component* currentComponent; - - bool readingChunk = false; - std::string currentChunk; - /* - Something worth noting here is that we dont pass the start - and end identifier into the component. - */ - for (char character : markDown) - { - if (readingChunk) - { - if (character == currentComponent->endIdentifier) - { - finalPage = currentComponent->generateHTML(currentChunk); - readingChunk = false; - currentChunk = ""; - } - else - { - currentChunk.push_back(character); - } - } - else - { - // search dictionary to find a component - // if found, get component, set readingChunk to true - } - } -} - -std::string PageFactory::getPage() -{ - return finalPage; -} \ No newline at end of file diff --git a/PageFactory.h b/PageFactory.h deleted file mode 100644 index 7494bb4..0000000 --- a/PageFactory.h +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once -#include -#include -#include "Component.h" -#include "ComponentList.h" -#include - -class PageFactory -{ - struct ComponentDictItem - { - char identifier; - Component* component; - }; - - std::vector componentDictionary; - - std::string finalPage; - -public: - PageFactory(); - void buildPage(std::string markDown); - std::string getPage(); -}; - diff --git a/inputfile.md b/inputfile.md deleted file mode 100644 index b0780ad..0000000 --- a/inputfile.md +++ /dev/null @@ -1,20 +0,0 @@ -# hello world! -this is a test of the cool markdown parser written by -some random guy online who made a cool thing but seems kind -of cringe - -## The guy -whats his name? minty or some shit idk - -## Lets run a tests -test* -``` - print("oogyboogyman") -``` - -that should be formatted as code - -## One more test -- a list -- wow -- truly amazing diff --git a/outputfile.html b/outputfile.html deleted file mode 100644 index 440ee2c..0000000 --- a/outputfile.html +++ /dev/null @@ -1,17 +0,0 @@ -

hello world!

-

this is a test of the cool markdown parser written by -some random guy online who made a cool thing but seems kind -of cringe

-

The guy

-

whats his name? minty or some shit idk

-

Lets run a tests

-

test*

-
  print("oogyboogyman")
-
-

that should be formatted as code

-

One more test

-
    -
  • a list
  • -
  • wow
  • -
  • truly amazing
  • -