The Markdown widget supports rendering text with Markdown formatting. In additional, advanced functionality allows Markdown text to reference Ontology objects and support on-click events. Module builders configuring a Markdown widget can use the following features:
The below screenshot shows an example of a configured Markdown widget including object references, where text anchors that have attached Ontology object references are shown underlined and are selectable:
The screenshot below shows the initial state of an unconfigured Markdown widget alongside its initial configuration panel.
For the Markdown widget, the core configuration options are the following:
The following are some examples of supported Markdown syntax. Note that the highlight syntax ==text==
and tasklist are supported despite not being standard in typical Markdown implementations. A table showing supported Markdown syntaxes and their corresponding examples follows below.
Markdown supports subheaders ranging from level 1 to level 6.
Syntax type | Markdown syntax |
---|---|
Main Header | # Main header |
Subheader | ### sub header |
Italics | I *think* this |
Bold | **sentence** is |
Strikethrough | ~pretty good~ |
Highlight | ==great== |
Inline Code | `share` |
Code Block | ``` \n example code \n ``` |
Blockquote | > This is a blockquote |
Unordered List | - Item 1 - Item 2 |
Ordered List | 1. First item 2. Second item |
Horizontal Rule | --- or *** |
Link | [title](https://palantir.com) |
Image |  |
Task List | - [ ] Task 1 - [x] Task 2 |
Table | See below for syntax |
Table Syntax Example
Copied!1 2 3 4
| Header 1 | Header 2 | |----------|----------| | Row 1 | Data 1 | | Row 2 | Data 2 |
As an advanced feature, the Markdown widget allows builders to tag subsets of Markdown text ("anchors") and then use these anchors to link to specific Ontology objects and trigger Workshop on-click events.
The format for creating one of these anchors is as follows:
:objectreference[$text_to_display]{objectType="$object_type_id" primaryKey="$object_primary_key"}
Let's walk through an example where we're attempting to reference two Flight Alerts objects within a sentence. First, let's look at the desired end-state we'd like to appear on-screen for users. Note: each of the Flight Alert objects reference below is individually selectable by a user and will then become the output selected object set of the Markdown widget.
To achieve the above, the backing Markdown input is the following:
Newark airport has __*rarely*__ seen flight issues in May, but there were two high-priority delays: :objectreference[Alert A00150]{objectType="flight-alert" primaryKey="A00150"} and :objectreference[Alert A00182]{objectType="flight-alert" primaryKey="A00182"}
Beyond the syntax describe above for the Markdown input, builders can also configure the following options for object references:
Object references in Markdown can also have standard Markdown formatting applied. The screenshot below contains a variety of examples of Markdown formatting, such as headings and tables embedded with objects.