xonecas.io
7814
Ta

tiny-c-agent / files

tiny-c-agent / src / tui / highlight.h

793 bytes
1// tiny TUI syntax highlighting, over a committed block, once.
2//
3// Grammars are compiled in: some come from pkg-config, the rest are vendored
4// and built from source. The highlights queries live in vendor/queries and are
5// compiled into the binary (src/queries.generated.c). Only a capture name
6// reaches the palette. When no grammar is available for a language, the text
7// passes through unchanged.
8
9#ifndef TINY_TUI_HIGHLIGHT_H
10#define TINY_TUI_HIGHLIGHT_H
11
12// Colors a committed block of Markdown. Returns malloc'd text.
13char *tiny_highlight_markdown(const char *text);
14
15// Colors a fenced code block's body by its fence info string; returns the input
16// unchanged (a malloc'd copy) when the language is unknown.
17char *tiny_highlight_code(const char *info, const char *text);
18
19#endif