typedoc-theme-yaf
Version:
A fresh, opinionated and standalone front-end documentation application consuming Typedoc generated data.
27 lines (26 loc) • 1.25 kB
TypeScript
import { highlighter } from '../types/backendTypes';
/**
* The highlighter and tooling [starry-night](https://github.com/wooorm/starry-night)
* and [hast-util-to-html](https://github.com/syntax-tree/hast-util-to-html) is only available as ES modules,
* which TypeDoc is not compatible with.
*
* This function creates dynamic imports to work around the problem.
*
* It then constructs the various functions required to return HTML markup from text.
*
* @returns A collection of functions to convert a string into highlighted HTML.
*/
export declare const loadHighlighter: () => Promise<highlighter>;
/**
* `typedoc-theme-yaf` aims to be visually compatible and consistent with `GitHub` as far as practical.
*
* This is not practical with the TypeDoc default `shiki` highlighter module, so this is replaced with the
* [starry-night](https://github.com/wooorm/starry-night) highlighter. This provides compatibility with
* [github-markdown-css](https://github.com/sindresorhus/github-markdown-css).
*
* @param highlighter
* @param text
* @param lang
* @returns An HTML string with `github-markdown-css` compatible markup.
*/
export declare const getHighlighted: (highlighter: highlighter, text: string, lang?: string) => string;