add markdown parsing + latex + tree-sitter highlighting for codeblocks in llm responses

This commit is contained in:
2026-08-24 23:55:51 +02:00
parent aae3757daf
commit e18875a752
53 changed files with 5043 additions and 618 deletions
+25
View File
@@ -0,0 +1,25 @@
#pragma once
#include <QString>
#include <QVariantList>
namespace ZShell::llm {
// Splits a markdown document into top-level blocks for QML rendering
// (cmark-gfm AST walk). Inline structure is not flattened; Text and
// Heading blocks carry markdown source that QML renders with
// Text.MarkdownText.
//
// Block map keys:
// "type" int (LlmMarkdown::Type)
// "level" int (Heading)
// "language" QString (Code, lowercased, empty when unknown)
// "code" QString (Code)
// "text" QString (Text/Heading, markdown source)
// "latex" QString (Math, without the $$ delimiters)
class MarkdownParser {
public:
[[nodiscard]] static QVariantList parse(const QString& source);
};
} // namespace ZShell::llm