SiMarkdownOptions Type documentation¶
TypeScript declaration¶
Options for the markdown renderer. This holds all configuration and allows installing extensions. A number of extensions are already ready to use and shipped with Element. Example: getCodeTypeHandlers Returns: All code type handlers getHighlighter Returns: The highlighter getTypeHandlers Returns: All type handlers installExtension Installs a extension which can contain plugins, type handlers Returns: self for chaining • The extension definition installUnifiedPlugin Installs a plugin into the Returns: self for chaining makeProcessor Creates the Returns: registerDirective Registers a component used to render a named Markdown directive. Returns: self for chaining directives : setCodeHighlighter Sets the code highlighter • The highlighterimport { SiMarkdownOptions } from '@siemens/element-ng/markdown';import { siMarkdownMathKaTeX } from '@siemens/element-ng/markdown/extensions/math';
import remarkGemoji from 'remark-gemoji';
protected markdownOptions = new SiMarkdownOptions()
.installExtension(siMarkdownMathKaTeX())
.installUnifiedPlugin(remarkGemoji);
<si-markdown [markdown]="markdownText()" [options]="markdownOptions" />
() => SiMarkdownOptions ¶
() => Map<string, TypeHandler> ¶ () => SiMarkdownHighlighter | undefined ¶ () => TypeHandler[] ¶ (extension: SiMarkdownExtension) => SiMarkdownOptions ¶
(plugin: UnifiedPlugin, options?: any) => SiMarkdownOptions ¶ unified chain(meta: SiMarkdownMetadata) => Processor<Root, Root, SiMarkdownRoot, undefined, undefined> ¶ unified processor with all plugins and optionsunified processor(directives: TypeHandler | TypeHandler[]) => SiMarkdownOptions ¶
TypeHandler | TypeHandler[] ¶ (highlighter?: SiMarkdownHighlighter) => SiMarkdownOptions ¶
Types Documentation¶
An extension to the si-markdown component Special code type handlers to install codeTypes ? : Directives directives ? : plugins ? : Type handlers to install types ? : import type { SiMarkdownExtension } from '@siemens/element-ng/markdown';
TypeHandler[] ¶ TypeHandler[] ¶ unified plugins to installPluginWithOptions[] ¶ TypeHandler[] ¶
import type { SiMarkdownHighlighter } from '@siemens/element-ng/markdown';
Options passed to makeProcessor() citations ? : import type { SiMarkdownMetadata } from '@siemens/element-ng/markdown';
SiMarkdownCitation[] ¶
Extended root with references SiMarkdownRoot
Omit<Root, 'children'> & { children: ExtendedRootContent[]; references?: { footnoteDefinitions?: Map<string, FootnoteDefinition>; definitions?: Map<string, Definition>; }; } ¶ import type { SiMarkdownRoot } from '@siemens/element-ng/markdown';
Type handler for a named type. This can be an AST node type, a code type, a directive name The component used to render the node component : Options passed to the component options ? : Type nameimport type { TypeHandler } from '@siemens/element-ng/markdown';
Type<SiMarkdownExtensionComponent> Inherited from ComponentWithOptions<SiMarkdownExtensionComponent> ¶ any Inherited from ComponentWithOptions<SiMarkdownExtensionComponent> ¶
import type { UnifiedPlugin } from '@siemens/element-ng/markdown';
Interface an extension component must implement Node to be rendered node : Options passed to the component options : The parent node parent : import type { SiMarkdownExtensionComponent } from '@siemens/element-ng/markdown';
InputSignal<Node> ¶ InputSignal<any> ¶ InputSignal<Parent> ¶
Interface a code highlighter component must implement The code to be highlighted code : The language Options passed to the component options : Function the highlighter can call to updated the displayed language updateLanguage : import type { SiMarkdownHighlighterComponent } from '@siemens/element-ng/markdown';
InputSignal<string> ¶ InputSignal<any> ¶ InputSignal<(lang?: string) => void> ¶
import type { ExtendedRootContent } from '@siemens/element-ng/markdown';
Citation metadata associated with a markdown response. Optional source description. description ? : Identifier referenced by bracket notation, such as identifier ? : Source name displayed to the user. name : Zero-based, end-exclusive source range of the citation reference in the markdown source. Optional source quote. Takes precedence over description. quote ? : Source URL. url : import type { SiMarkdownCitation } from '@siemens/element-ng/markdown';
string Inherited from SourceReference ¶ [source-1].string ¶ string Inherited from SourceReference ¶ string Inherited from SourceReference ¶ string Inherited from SourceReference ¶
Extra node for collecting all footnotes List of children. children : Info from the ecosystem. Position of a node in a source document. Nodes that are generated (not in the original source document) must not have a position. Node type.import type { Footnotes } from '@siemens/element-ng/markdown';
FootnoteDefinition[] Inherited from Parent ¶
Container for one or more adjacent citation nodes. Info from the ecosystem. Position of a node in a source document. Nodes that are generated (not in the original source document) must not have a position. Node type.import type { Citations } from '@siemens/element-ng/markdown';
AST node created by Attributes declared on the directive. attributes : List of children. children : Info from the ecosystem. The directive name without its leading colons. Position of a node in a source document. Nodes that are generated (not in the original source document) must not have a position. Node type. type : import type { DirectiveNode } from '@siemens/element-ng/markdown';remark-directive.
Record<string, string | undefined> ¶ RootContent[] Inherited from Parent ¶ "containerDirective" | "leafDirective" | "textDirective" Inherited from Node ¶
Definition of a single sourceimport type { SourceReference } from '@siemens/element-ng/source-chip';
Inline node that references an item in the source citation array. Info from the ecosystem. Position of a node in a source document. Nodes that are generated (not in the original source document) must not have a position. Text replaced by a position-based citation. Node type.import type { Citation } from '@siemens/element-ng/markdown';
Except where otherwise noted, content on this site is licensed under MIT License.