markdown library Markdown

Markdown-to-ANSI rendering for terminal applications.

This focused entrypoint exposes the Markdown renderer and its options without loading CLI I/O, charting, or other unrelated Artisanal features. Image downloading and SVG rasterization are available on native platforms; browser builds retain text rendering and image placeholders.

Classes

AdaptiveChromaTheme
An adaptive syntax highlighting theme that selects between light and dark variants based on terminal background.
AnsiRenderer
Renders markdown AST nodes to ANSI-styled terminal output.
AnsiRendererOptions
Configuration options for ANSI markdown rendering.
ChromaTheme
Configuration for syntax highlighting colors.
FenceLanguageResolver
MarkdownBlockContext
MarkdownElementStyle
Fine-grained style for a markdown element.
MarkdownRenderer
Renders markdown to ANSI-styled terminal output using standalone functions.
SyntaxHighlighter

Enums

ImageProtocol
Terminal image protocol for rendering images inline.

Functions

detectImageProtocol() → ImageProtocol
Auto-detect the best available terminal image protocol.
highlightCodeString(String code, {String? language, ChromaTheme? theme}) → String
Highlights code and returns ANSI-styled output.
imageCellDimensions(Image image, {int? maxColumns, int? maxRows}) → (int, int)
Determines the approximate cell dimensions for displaying an image.
markdownToAnsi(String markdown, {AnsiRendererOptions? options}) → String
Converts a markdown string to ANSI-styled terminal text.
renderImageToAnsi(Image image, ImageProtocol protocol, {int? columns, int? rows}) → String?
Renders an image to ANSI terminal escape sequences using the best available image protocol.

Typedefs

MarkdownBlockHandler = String? Function(MarkdownBlockContext context)