# makeSiMarkdownOptions Type documentation

## TypeScript declaration

### [makeSiMarkdownOptions](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L160-L160>)

**Kind:** constant

```
import { makeSiMarkdownOptions } from '@siemens/element-ng/markdown';
```

```
() => SiMarkdownOptions = (): SiMarkdownOptions => new SiMarkdownOptions()
```

```
makeSiMarkdownOptions(): SiMarkdownOptions
```

**Returns:** [SiMarkdownOptions](<index.html#t:SiMarkdownOptions>)

### Types Documentation

### [SiMarkdownOptions](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L47-L158>)

**Kind:** class

```
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:

```ts
import { siMarkdownMathKaTeX } from '@siemens/element-ng/markdown/extensions/math';
import remarkGemoji from 'remark-gemoji';

protected markdownOptions = new SiMarkdownOptions()
  .installExtension(siMarkdownMathKaTeX())
  .installUnifiedPlugin(remarkGemoji);
```

```html
<si-markdown [markdown]="markdownText()" [options]="markdownOptions" />
```

```
undecorated_class SiMarkdownOptions
```

#### Constructor

##### constructor

[Source for constructor](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L54-L61>)

```
constructor(): SiMarkdownOptions
```

**Returns:** [SiMarkdownOptions](<index.html#t:SiMarkdownOptions>)

#### Methods

##### getCodeTypeHandlers

[Source for getCodeTypeHandlers](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L148-L150>)

Returns: All code type handlers

```
getCodeTypeHandlers(): Map<string, TypeHandler>
```

**Returns:** [Map](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map>)`<`[string](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>)`, `[TypeHandler](<index.html#t:TypeHandler>)`>`

##### getHighlighter

[Source for getHighlighter](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L155-L157>)

Returns: The highlighter

```
getHighlighter(): SiMarkdownHighlighter | undefined
```

**Returns:** [SiMarkdownHighlighter](<index.html#t:SiMarkdownHighlighter>)`  |  `[undefined](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined>)

##### getTypeHandlers

[Source for getTypeHandlers](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L141-L143>)

Returns: All type handlers

```
getTypeHandlers(): TypeHandler[]
```

**Returns:** [TypeHandler](<index.html#t:TypeHandler>)`[]`

##### installExtension

[Source for installExtension](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L94-L110>)

Installs a extension which can contain plugins, type handlers

Returns: self for chaining

```
installExtension(extension: SiMarkdownExtension): SiMarkdownOptions
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [extension](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L94-L94>) | `SiMarkdownExtension` |  | • The extension definition |

**Returns:** [SiMarkdownOptions](<index.html#t:SiMarkdownOptions>)

##### installUnifiedPlugin

[Source for installUnifiedPlugin](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L69-L72>)

Installs a plugin into the `unified` chain

Returns: self for chaining

```
installUnifiedPlugin(plugin: UnifiedPlugin, options?: any): SiMarkdownOptions
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [plugin](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L69-L69>) | `UnifiedPlugin` |  | • The `unified` plugin |
| [options](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L69-L69>) (optional) | `any` |  | • Options for the plugin |

**Returns:** [SiMarkdownOptions](<index.html#t:SiMarkdownOptions>)

##### makeProcessor

[Source for makeProcessor](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L125-L136>)

Creates the `unified` processor with all plugins and options

Returns: `unified` processor

```
makeProcessor(meta: SiMarkdownMetadata): Processor<Root, Root, SiMarkdownRoot, undefined, undefined>
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [meta](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L126-L126>) | `SiMarkdownMetadata` |  |  |

**Returns:** [Processor](<https://unifiedjs.com>)`<`[Root](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>)`, `[Root](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>)`, `[SiMarkdownRoot](<index.html#t:SiMarkdownRoot>)`, `[undefined](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined>)`, `[undefined](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined>)`>`

##### registerDirective

[Source for registerDirective](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L79-L87>)

Registers a component used to render a named Markdown directive.

Returns: self for chaining

```
registerDirective(directives: TypeHandler | TypeHandler[]): SiMarkdownOptions
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [directives](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L79-L79>) | `TypeHandler \| TypeHandler[]` |  |  |

**Returns:** [SiMarkdownOptions](<index.html#t:SiMarkdownOptions>)

##### setCodeHighlighter

[Source for setCodeHighlighter](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L116-L119>)

Sets the code highlighter

```
setCodeHighlighter(highlighter?: SiMarkdownHighlighter): SiMarkdownOptions
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [highlighter](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L116-L116>) (optional) | `SiMarkdownHighlighter` |  | • The highlighter |

**Returns:** [SiMarkdownOptions](<index.html#t:SiMarkdownOptions>)

### [UnifiedPlugin](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L64-L64>)

**Kind:** type alias

```
import type { UnifiedPlugin } from '@siemens/element-ng/markdown';
```

```
type UnifiedPlugin = Plugin<any> | Transformer<any> | Preset | PluggableList
```

### [TypeHandler](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L48-L51>)

**Kind:** interface

```
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

```
interface TypeHandler extends ComponentWithOptions<SiMarkdownExtensionComponent>
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [component](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L42-L42>) (inherited) | `Type<SiMarkdownExtensionComponent>` | The component used to render the node<br><br>Inherited from [ComponentWithOptions\<SiMarkdownExtensionComponent\>](<index.html#t:ComponentWithOptions>) |
| [options](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L44-L44>) (optional, inherited) | `any` | Options passed to the component<br><br>Inherited from [ComponentWithOptions\<SiMarkdownExtensionComponent\>](<index.html#t:ComponentWithOptions>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L50-L50>) | `string` | Type name |

### [SiMarkdownExtension](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L77-L86>)

**Kind:** interface

```
import type { SiMarkdownExtension } from '@siemens/element-ng/markdown';
```

An extension to the si-markdown component

```
interface SiMarkdownExtension
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [codeTypes](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L83-L83>) (optional) | `TypeHandler[]` | Special code type handlers to install |
| [directives](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L85-L85>) (optional) | `TypeHandler[]` | Directives |
| [plugins](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L79-L79>) (optional) | `PluginWithOptions[]` | `unified` plugins to install |
| [types](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L81-L81>) (optional) | `TypeHandler[]` | Type handlers to install |

### [SiMarkdownHighlighter](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L62-L62>)

**Kind:** type alias

```
import type { SiMarkdownHighlighter } from '@siemens/element-ng/markdown';
```

```
type SiMarkdownHighlighter = ComponentWithOptions<SiMarkdownHighlighterComponent>
```

### [SiMarkdownRoot](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L127-L133>)

**Kind:** type alias

```
import type { SiMarkdownRoot } from '@siemens/element-ng/markdown';
```

Extended root with references

```
type SiMarkdownRoot = Omit<Root, 'children'> & {
  children: ExtendedRootContent[];
  references?: {
    footnoteDefinitions?: Map<string, FootnoteDefinition>;
    definitions?: Map<string, Definition>;
  };
}
```

### [SiMarkdownMetadata](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L100-L102>)

**Kind:** interface

```
import type { SiMarkdownMetadata } from '@siemens/element-ng/markdown';
```

Options passed to makeProcessor()

```
interface SiMarkdownMetadata
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [citations](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L101-L101>) (optional) | `SiMarkdownCitation[]` |  |

### [SiMarkdownExtensionComponent](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L18-L25>)

**Kind:** interface

```
import type { SiMarkdownExtensionComponent } from '@siemens/element-ng/markdown';
```

Interface an extension component must implement

```
interface SiMarkdownExtensionComponent
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [node](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L20-L20>) | `InputSignal<Node>` | Node to be rendered |
| [options](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L24-L24>) | `InputSignal<any>` | Options passed to the component |
| [parent](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L22-L22>) | `InputSignal<Parent>` | The parent node |

### [ComponentWithOptions](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L40-L45>)

**Kind:** interface

```
import type { ComponentWithOptions } from '@siemens/element-ng/markdown';
```

A combination of a component and options passed to it during run-time

```
interface ComponentWithOptions<T>
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [component](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L42-L42>) | `Type<T>` | The component used to render the node |
| [options](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L44-L44>) (optional) | `any` | Options passed to the component |

### [PluginWithOptions](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L69-L74>)

**Kind:** interface

```
import type { PluginWithOptions } from '@siemens/element-ng/markdown';
```

Combination of unified plugin with options

```
interface PluginWithOptions
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [options](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L73-L73>) (optional) | `any` | Options passed during plugin registration |
| [plugin](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L71-L71>) | `UnifiedPlugin` | The plugin |

### [SiMarkdownHighlighterComponent](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L28-L37>)

**Kind:** interface

```
import type { SiMarkdownHighlighterComponent } from '@siemens/element-ng/markdown';
```

Interface a code highlighter component must implement

```
interface SiMarkdownHighlighterComponent
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [code](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L30-L30>) | `InputSignal<string>` | The code to be highlighted |
| [language](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L32-L32>) | `InputSignal<string>` | The language |
| [options](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L36-L36>) | `InputSignal<any>` | Options passed to the component |
| [updateLanguage](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L34-L34>) | `InputSignal<(lang?: string) => void>` | Function the highlighter can call to updated the displayed language |

### [ExtendedRootContent](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L124-L124>)

**Kind:** type alias

```
import type { ExtendedRootContent } from '@siemens/element-ng/markdown';
```

```
type ExtendedRootContent = RootContent | Footnotes | Citations | DirectiveNode
```

### [SiMarkdownCitation](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L89-L97>)

**Kind:** interface

```
import type { SiMarkdownCitation } from '@siemens/element-ng/markdown';
```

Citation metadata associated with a markdown response.

```
interface SiMarkdownCitation extends SourceReference
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [description](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L13-L13>) (optional, inherited) | `string` | Optional source description.<br><br>Inherited from [SourceReference](<index.html#t:SourceReference>) |
| [identifier](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L91-L91>) (optional) | `string` | Identifier referenced by bracket notation, such as `[source-1]`. |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L9-L9>) (inherited) | `string` | Source name displayed to the user.<br><br>Inherited from [SourceReference](<index.html#t:SourceReference>) |
| [position](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L93-L96>) (optional) | `{ startIndex: number; endIndex: number; }` | Zero-based, end-exclusive source range of the citation reference in the markdown source. |
| [quote](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L15-L15>) (optional, inherited) | `string` | Optional source quote. Takes precedence over [description](<index.html#t:SiMarkdownCitation.description>).<br><br>Inherited from [SourceReference](<index.html#t:SourceReference>) |
| [url](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L11-L11>) (inherited) | `string` | Source URL.<br><br>Inherited from [SourceReference](<index.html#t:SourceReference>) |

### [Footnotes](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L119-L122>)

**Kind:** interface

```
import type { Footnotes } from '@siemens/element-ng/markdown';
```

Extra node for collecting all footnotes

```
interface Footnotes extends Parent
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [children](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L121-L121>) | `FootnoteDefinition[]` | List of children.<br><br>Inherited from [Parent](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>) |
| data (optional, inherited) | `Data` | Info from the ecosystem.<br><br>Inherited from [Node](<https://developer.mozilla.org/docs/Web/API/Node>) |
| position (optional, inherited) | `Position` | Position of a node in a source document.<br><br>Nodes that are generated (not in the original source document) must not have a position.<br><br>Inherited from [Node](<https://developer.mozilla.org/docs/Web/API/Node>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L120-L120>) | `"footnotes"` | Node type.<br><br>Inherited from [Node](<https://developer.mozilla.org/docs/Web/API/Node>) |

### [Citations](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L113-L116>)

**Kind:** interface

```
import type { Citations } from '@siemens/element-ng/markdown';
```

Container for one or more adjacent citation nodes.

```
interface Citations extends Node
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [children](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L115-L115>) | `Citation[]` |  |
| data (optional, inherited) | `Data` | Info from the ecosystem.<br><br>Inherited from [Node](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>) |
| position (optional, inherited) | `Position` | Position of a node in a source document.<br><br>Nodes that are generated (not in the original source document) must not have a position.<br><br>Inherited from [Node](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L114-L114>) | `"citations"` | Node type.<br><br>Inherited from [Node](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>) |

### [DirectiveNode](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L54-L60>)

**Kind:** interface

```
import type { DirectiveNode } from '@siemens/element-ng/markdown';
```

AST node created by `remark-directive`.

```
interface DirectiveNode extends Parent
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [attributes](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L59-L59>) | `Record<string, string \| undefined>` | Attributes declared on the directive. |
| children (inherited) | `RootContent[]` | List of children.<br><br>Inherited from [Parent](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>) |
| data (optional, inherited) | `Data` | Info from the ecosystem.<br><br>Inherited from [Node](<https://developer.mozilla.org/docs/Web/API/Node>) |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L57-L57>) | `string` | The directive name without its leading colons. |
| position (optional, inherited) | `Position` | Position of a node in a source document.<br><br>Nodes that are generated (not in the original source document) must not have a position.<br><br>Inherited from [Node](<https://developer.mozilla.org/docs/Web/API/Node>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L55-L55>) | `"containerDirective" \| "leafDirective" \| "textDirective"` | Node type.<br><br>Inherited from [Node](<https://developer.mozilla.org/docs/Web/API/Node>) |

### [SourceReference](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L7-L16>)

**Kind:** interface

```
import type { SourceReference } from '@siemens/element-ng/source-chip';
```

Definition of a single source

```
interface SourceReference
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [description](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L13-L13>) (optional) | `string` | Optional source description. |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L9-L9>) | `string` | Source name displayed to the user. |
| [quote](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L15-L15>) (optional) | `string` | Optional source quote. Takes precedence over [description](<index.html#t:SourceReference.description>). |
| [url](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L11-L11>) | `string` | Source URL. |

### [Citation](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L105-L110>)

**Kind:** interface

```
import type { Citation } from '@siemens/element-ng/markdown';
```

Inline node that references an item in the source citation array.

```
interface Citation extends Node
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [citationIndex](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L107-L107>) | `number` |  |
| data (optional, inherited) | `Data` | Info from the ecosystem.<br><br>Inherited from [Node](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>) |
| position (optional, inherited) | `Position` | Position of a node in a source document.<br><br>Nodes that are generated (not in the original source document) must not have a position.<br><br>Inherited from [Node](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>) |
| [text](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L109-L109>) (optional) | `string` | Text replaced by a position-based citation. |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L106-L106>) | `"citation"` | Node type.<br><br>Inherited from [Node](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>) |
