Skip to content

crwsolutions/NTokenizers.Extensions.Spectre.Console

Repository files navigation

NTokenizers.Extensions.Spectre.Console

Stream-capable Spectre.Console rendering extensions for NTokenizers (XML, JSON, Markdown, Java-/TypeScript, CSS, HTML, C# and SQL), Style-rich console syntax highlighting

This library builds on:

Together, they enable expressive syntax highlighting directly in the console.

await AnsiConsole.Console.WriteMarkdownAsync(stream);

Warning

All references to Markup were renamed to Markdown. And so WriteMarkupText was renamed to WriteMarkdown in v2.

Especially suitable for parsing AI chat streams, NTokenizers excels at processing real-time tokenized data from AI models, enabling efficient handling of streaming responses and chat conversations without buffering entire responses.

Check out the AI Example to learn more about that.

Example: Writing a 'simple' string

var help = """"
           #### Some extra instructions to accomodate multiline input:
           |Command|Description|
           |**Shift-Enter**|to place a soft new line|
           |**Ctrl-B**|to paste multiline, do not use **Ctrl-V**, because that will input a _<Enter>_'s|
           |**bye**|type bye to end the chat session|
           |**clear**|type clear to clear the chat history|
           """";

AnsiConsole.Console.WriteMarkdown(help);

Check out the documentation Here.

About

Stream-capable Spectre.Console rendering extensions for NTokenizers, Style-rich console syntax highlighting

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors 3

  •  
  •  
  •  

Languages