From 9c00965a149b2f9697f5c07a390cf2b0bc675d4d Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Tue, 28 Oct 2025 01:46:22 -0700 Subject: create helper functions for creating header and footer --- src/markdown_translator.cpp | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'src') diff --git a/src/markdown_translator.cpp b/src/markdown_translator.cpp index 9ec37a6..3c97874 100644 --- a/src/markdown_translator.cpp +++ b/src/markdown_translator.cpp @@ -62,22 +62,10 @@ std::string MarkdownTranslator::translate(const std::string& markdownContent, co } } } - markdownStream.clear(); markdownStream.str(markdownContent); - // Start with basic HTML structure - htmlOutput << R"( - - - - - )" << title << R"( - - - -)"; - + htmlOutput << buildHTMLHeader(title, cssPath); // Add navigation sidebar generateSideBar(htmlOutput, headers); @@ -111,15 +99,7 @@ std::string MarkdownTranslator::translate(const std::string& markdownContent, co htmlOutput << " " << processLine(line); } - // Add article meta information section - htmlOutput << "
\n"; - htmlOutput << "

Last updated: " << getCurrentDateTime() << "

\n"; - htmlOutput << "
\n"; - htmlOutput << " \n"; - htmlOutput << " \n"; - htmlOutput << "\n"; - htmlOutput << "\n"; return htmlOutput.str(); } @@ -182,16 +162,6 @@ std::string MarkdownTranslator::createAnchorId(const std::string& text) { return id; } -std::string MarkdownTranslator::getCurrentDateTime() { - std::time_t now = std::time(nullptr); - std::tm* localTime = std::localtime(&now); - - char buffer[80]; - std::strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", localTime); - - return std::string(buffer); -} - std::string MarkdownTranslator::processLine(const std::string& line) { std::string processed = line; processed = processHeaders(processed); -- cgit v1.2.3