@promptbook/utils
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
21 lines (20 loc) • 864 B
TypeScript
/**
* Prefix of the CSS class names emitted for highlighted Book source.
*
* @private internal constant of `BookEditor`
*/
export declare const BOOK_SYNTAX_TOKEN_CLASS_NAME_PREFIX = "book-syntax-";
/**
* Highlights Book source into static HTML using the `<BookEditor/>` token colors.
*
* `<BookEditor/>` itself is a Monaco-based browser component and cannot run
* where a book has to be rendered as plain markup (server-side exports such as
* the Book language manual PDF). This function reuses the very same
* tokenization patterns and token names, so both surfaces stay in sync.
*
* @param bookSource - Raw Book source to highlight.
* @returns HTML with one `<span>` per highlighted token, safe to place into `<pre>`.
*
* @private internal utility of `BookEditor`
*/
export declare function highlightBookSourceToHtml(bookSource: string): string;