SiMarkdownHighlightJsOptions Type documentation¶
TypeScript declaration¶
Configuration for the Highlight.js highlighter Should language be auto-detected? This only works with already loaded languages options passed to highlight.js highlightJs ? : Language loader to load languages lazily. Example:import type { SiMarkdownHighlightJsOptions } from '@siemens/element-ng/markdown/hightlighter/highlightjs';
Partial<HighlightOptions> ¶ const hljsLanguageLoader = async (lang: string): HighlightJSLanguageImport => {
switch (lang) {
case 'c':
return import('highlight.js/lib/languages/c');
case 'cmake':
return import('highlight.js/lib/languages/cmake');
case 'cpp':
return import('highlight.js/lib/languages/cpp');
}
return undefined;
};
Types Documentation¶
Language loaderimport type { HighlightJSLanguageLoader } from '@siemens/element-ng/markdown/hightlighter/highlightjs';
type of a language importimport type { HighlightJSLanguageImport } from '@siemens/element-ng/markdown/hightlighter/highlightjs';
Except where otherwise noted, content on this site is licensed under MIT License.