makeSiMarkdownOptions Type documentation¶
TypeScript declaration¶
import { makeSiMarkdownOptions } from '@siemens/element-ng/markdown'; makeSiMarkdownOptions(): SiMarkdownOptions
Types Documentation¶
import { SiMarkdownOptions } from '@siemens/element-ng/markdown';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:
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¶
-
getCodeTypeHandlers
() => Map<string, TypeHandler>¶Returns: All code type handlers
-
getHighlighter
() => SiMarkdownHighlighter | undefined¶Returns: The highlighter
-
getTypeHandlers
() => TypeHandler[]¶Returns: All type handlers
-
installExtension
(extension: SiMarkdownExtension) => SiMarkdownOptions¶Installs a extension which can contain plugins, type handlers
Returns: self for chaining
Parameters-
• The extension definition
-
-
installUnifiedPlugin
(plugin: UnifiedPlugin, options?: any) => SiMarkdownOptions¶Installs a plugin into the
unifiedchainReturns: self for chaining
-
makeProcessor
(meta: SiMarkdownMetadata) => Processor<Root, Root, SiMarkdownRoot, undefined, undefined>¶Creates the
unifiedprocessor with all plugins and optionsReturns:
unifiedprocessorParameters -
registerDirective
(directives: TypeHandler | TypeHandler[]) => SiMarkdownOptions¶Registers a component used to render a named Markdown directive.
Returns: self for chaining
Parameters -
setCodeHighlighter
(highlighter?: SiMarkdownHighlighter) => SiMarkdownOptions¶Sets the code highlighter
Parameters-
• The highlighter
-
import type { UnifiedPlugin } from '@siemens/element-ng/markdown'; import type { TypeHandler } 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:
Type<SiMarkdownExtensionComponent>Inherited from ComponentWithOptions<SiMarkdownExtensionComponent>¶ -
Options passed to the component
options?:
anyInherited from ComponentWithOptions<SiMarkdownExtensionComponent>¶ -
Type name
import type { SiMarkdownExtension } from '@siemens/element-ng/markdown';An extension to the si-markdown component
-
Special code type handlers to install
-
Directives
-
unifiedplugins to install -
Type handlers to install
types?:
TypeHandler[]¶
import type { SiMarkdownHighlighter } from '@siemens/element-ng/markdown'; SiMarkdownRoot
Omit<Root, 'children'> & { children: ExtendedRootContent[]; references?: { footnoteDefinitions?: Map<string, FootnoteDefinition>; definitions?: Map<string, Definition>; }; } ¶import type { SiMarkdownRoot } from '@siemens/element-ng/markdown';Extended root with references
import type { SiMarkdownMetadata } from '@siemens/element-ng/markdown';Options passed to makeProcessor()
import type { SiMarkdownExtensionComponent } from '@siemens/element-ng/markdown';Interface an extension component must implement
-
Node to be rendered
-
Options passed to the component
-
The parent node
import type { SiMarkdownHighlighterComponent } from '@siemens/element-ng/markdown';Interface a code highlighter component must implement
-
The code to be highlighted
-
The language
-
Options passed to the component
-
Function the highlighter can call to updated the displayed language
updateLanguage:
InputSignal<(lang?: string) => void>¶
import type { ExtendedRootContent } from '@siemens/element-ng/markdown'; import type { SiMarkdownCitation } from '@siemens/element-ng/markdown';Citation metadata associated with a markdown response.
-
Optional source description.
description?:
stringInherited from SourceReference¶ -
Identifier referenced by bracket notation, such as
[source-1]. -
Source name displayed to the user.
name:
stringInherited from SourceReference¶ -
Zero-based, end-exclusive source range of the citation reference in the markdown source.
-
Optional source quote. Takes precedence over description.
quote?:
stringInherited from SourceReference¶ -
Source URL.
url:
stringInherited from SourceReference¶
import type { Footnotes } from '@siemens/element-ng/markdown';Extra node for collecting all footnotes
-
List of children.
children:
FootnoteDefinition[]Inherited from Parent¶ -
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';Container for one or more adjacent citation nodes.
import type { DirectiveNode } from '@siemens/element-ng/markdown';AST node created by remark-directive.
-
Attributes declared on the directive.
attributes:
Record<string, string | undefined>¶ -
List of children.
children:
RootContent[]Inherited from Parent¶ -
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:
"containerDirective" | "leafDirective" | "textDirective"Inherited from Node¶
import type { SourceReference } from '@siemens/element-ng/source-chip';Definition of a single source
import type { Citation } from '@siemens/element-ng/markdown';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.
Except where otherwise noted, content on this site is licensed under MIT License.