SiMarkdownComponent documentation¶
selector
si-markdownComponent to display markdown text
This component is built using concepts from ngx-remark, namely using Angular templates to render the AST produced by remark .
Unlike ngx-remark , it features a configuration based approach of extensibility so that multiple instances of the component can be used with the same configuration, e.g. inside a chat component w/o repeating templates.
Input Properties¶
| Name | Type | Default | Description |
|---|---|---|---|
| citations ¶ | SiMarkdownCitation[] | Citation metadata used to create citations. | |
| debug ¶ | boolean | false | Debug mode. When true, unknown node types will be displayed along with the node as JSON. |
| markdown ¶ | string | '' | The markdown text to transform and display |
| options ¶ | SiMarkdownOptions | Options to control rendering. Can be shared across multiple instances. |
Output Properties¶
| Name | Type | Description |
|---|---|---|
| extensionEvent ¶ | { data: any, name: string } | Emitted by extension components. |
Attributes and Methods¶
| Name | Type | Default | Description |
|---|---|---|---|
| (readonly) meta ¶ | Signal<SiMarkdownMetadata> | ... | Gives access to metadata in extension components |
Types Documentation¶
| Citation metadata associated with a markdown response. | |||||||
|---|---|---|---|---|---|---|---|
|
| 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: | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||
|
| Options passed to makeProcessor() | ||
|---|---|---|
|
| Definition of a single source | |||||
|---|---|---|---|---|---|
|
| Type handler for a named type. This can be an AST node type, a code type, a directive name | ||||
|---|---|---|---|---|
|
| Combination of unified plugin with options | |||
|---|---|---|---|
|
| A combination of a component and options passed to it during run-time | |||
|---|---|---|---|
|
| Interface an extension component must implement | ||||
|---|---|---|---|---|
|
| Interface a code highlighter component must implement | |||||
|---|---|---|---|---|---|
|
Processor import imported from unified |
|---|
import imported from @types/mdast |
|---|
| Extended root with references |
|---|
| An extension to the si-markdown component | |||||
|---|---|---|---|---|---|
|
import imported from @types/mdast |
|---|
import imported from @types/mdast |
|---|
Plugin import imported from unified |
|---|
Transformer import imported from unified |
|---|
Preset import imported from unified |
|---|
PluggableList import imported from unified |
|---|
import imported from @types/mdast |
|---|
| Extra node for collecting all footnotes | |||||
|---|---|---|---|---|---|
|
| Container for one or more adjacent citation nodes. | |||||
|---|---|---|---|---|---|
|
| AST node created by remark-directive . | |||||||
|---|---|---|---|---|---|---|---|
|
import imported from @types/mdast |
|---|
import imported from @types/mdast |
|---|
import imported from @types/mdast |
|---|
import imported from @types/unist |
|---|
| Inline node that references an item in the source citation array. | ||||||
|---|---|---|---|---|---|---|
|
Except where otherwise noted, content on this site is licensed under MIT License.