diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-10-07 13:47:34 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-10-07 13:49:40 -0700 |
| commit | 539ef6568697c9dc1712fc7a2a379d4e3fb9235c (patch) | |
| tree | 7335354113834d9db965fb60d41d81c36ec09d42 /src/markdown_translator.h | |
Initial commit
Diffstat (limited to 'src/markdown_translator.h')
| -rw-r--r-- | src/markdown_translator.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/markdown_translator.h b/src/markdown_translator.h new file mode 100644 index 0000000..6d24ac7 --- /dev/null +++ b/src/markdown_translator.h @@ -0,0 +1,35 @@ +#ifndef MARKDOWN_TRANSLATOR_H +#define MARKDOWN_TRANSLATOR_H + +#include <string> +#include <vector> +#include <sstream> +#include <ctime> + +class MarkdownTranslator { +public: + // Constructor + MarkdownTranslator(); + // Destructor + ~MarkdownTranslator(); + // Main translation function - takes markdown content and returns HTML + std::string translate(const std::string& markdownContent, const std::string& cssPath = "styles/ffxiv-style.css", const std::string& title = "Title"); + std::string processLine(const std::string& line); + +private: + // Helper functions for different markdown elements + std::string processHeaders(const std::string& line); + std::string processBold(const std::string& text); + std::string processItalic(const std::string& text); + std::string processLinks(const std::string& text); + std::string processParagraph(const std::string& text); + std::string processSingleFigure(const std::string& text); + std::string processFigureBlock(const std::vector<std::string>& lines); + // Navigation and table of contents + void generateSideBar(std::stringstream& output, const std::vector<std::string>& headers, const std::string& title); + std::string createAnchorId(const std::string& text); + // Utility functions + std::string getCurrentDateTime(); +}; + +#endif // MARKDOWN_TRANSLATOR_H |
