Skip to main content

Text * Markdown

Type: markdown • Category: visualization • Tags: text, markdown

Description

Render markdown text widget

Parameters

NameTypeDescriptionRequiredDefault
widgetIdstringWidget ID (auto-generated if not provided)no
textExprstringExpr -> value (converted to string)no
textstringDirect text (used if no textExpr)no
fontSizestringFont size for markdown rendering (e.g. '14px', '1em'). Leave empty for default.no""

Help

Overview

The Markdown Text Widget worker renders a block of markdown‑styled text that can be displayed within a financial‑markets dashboard. It accepts either a direct text string or an expression that evaluates to a string, and optionally allows you to specify the font size used for rendering. If no widget identifier is supplied, the system will generate one automatically.

Inputs

  • widgetId (string) – Unique identifier for the widget. When omitted, the worker creates an auto‑generated ID.
  • textExpr (string) – An expression that is evaluated to produce the markdown content. The resulting value is converted to a string before rendering.
  • text (string) – Plain markdown text supplied directly. This field is used only when textExpr is not provided.
  • fontSize (string, default = "") – CSS‑compatible font size for the rendered markdown (e.g., 14px, 1em). Leaving this empty lets the widget fall back to its default size.

Minimal Example Usage

Below is a concise example showing how to invoke the worker to display a simple markdown snippet with a custom font size:

{
"widgetId": "marketOverview",
"text": "# Market Summary\n- **S&P 500**: 4,500\n- **NASDAQ**: 14,200",
"fontSize": "16px"
}

In this example:

  1. The widget is explicitly named marketOverview.
  2. The text field contains a markdown heading and a bullet list describing two market indices.
  3. The fontSize is set to 16px, which overrides the default rendering size.

If you prefer to compute the markdown content dynamically, replace the text field with textExpr, for instance:

{
"widgetId": "dynamicMarketInfo",
"textExpr": "generateMarketMarkdown()",
"fontSize": "1.2em"
}

Here, generateMarketMarkdown() is a user‑defined function that returns a markdown string, and the widget will render it using a relative font size of 1.2em.