Markdown

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:

  • Basic Markdown text formatting such as bold, italic, strikethrough, and highlighting
  • More advanced Markdown formatting such an headers, tables, block styling, code styling, and URLs
  • Embedded references from specific highlighted anchor text to Ontology objects
  • Triggering on-click Workshop events from specific highlighted anchor text

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:

markdown_object_references_simple_example

Configuration Options

The screenshot below shows the initial state of an unconfigured Markdown widget alongside its initial configuration panel.

markdown_empty_state

For the Markdown widget, the core configuration options are the following:

  • Input Data: Text / Variable
    • Text: If the text option is chosen, a builder can directly enter the input Markdown text they'd like to display into the configuration panel.
    • Variable: If the variable option is chosen, a string variable can be chosen as the input Markdown text to be displayed.
  • Display Options: Standard Markdown/Object References
    • Standard Markdown: By default this option is enabled and displays the input with standard Markdown formatting.
    • Object References: If enabled, references to Ontology objects and trigger-on-click Workshop events can be embedded in the text. This is a custom extension of the Markdown syntax; see the documentation below for more information about this advanced feature.

Object references in the Markdown widget

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.

markdown_object_references_config

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:

  • Selected Object Set: Required for using object references. This is the output object set of the Markdown widget. When a user selects an object reference within the Markdown widget, that object will be output into this object set variable.
  • Object Types: Required for using object references. Builder should select all object types which will be referenced within the Markdown widget. Once an object type is added, builders can additional configured conditional formatting rules within the inner configuration panel. If an object type is referenced in the Markdown widget but not configured in this list, the object reference will not appear in the Markdown widget.
    • Object Type: Specify the object type to configure further color and event options.
    • Highlight Color: Select a static color, inherit colors from a property with Ontology formatting, or define custom rules to determine color.
    • Override Event on Selection: Configure Workshop events to trigger for the specified object type. These will override any other event on selection.
  • Selection Behavior: Controls the selection behavior within the Markdown widget.
    • If No highlight is chosen, selecting an object reference within the Markdown widget will not result in a selection state.
    • If Highlight last selected is chosen, selecting an object reference within the Markdown widget will result in the most recently selected anchor text being highlighted.
    • If Highlight selected reference is chosen, highlighting within the Markdown widget is based on the contents of the selected object set. This option works best when object references in the Markdown are 1:1 with the objects from another widget, and the selected object set of both widgets are the same.
  • Event on Selection: This option enables module builders to configure Workshop events to trigger when an object reference is selected in the Markdown widget (for example, causing a drawer with a more detailed object view to appear).

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.

markdown_additional_formatting