Modo Markup

modo Markup (introduced in 12.2) is a simplified text markup feature that exposes rich text styling for tooltips and other strings commonly displayed to the user. It borrows features from other systems like Markdown and Slack’s markup, but tailored to modo.

Syntax

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
    *text*                          Bold
    _text_                          Italics
    `text`                          Fixed Width Font
    ~text~                          Small Font
    ==text==                        Heading (bold and centered)
    * text                          Bullet (note the space after the asterisk; must be at the beginning of a line)
    ![icon][iconResource]           Icon Resource
    ![inputevent][eventHash]        Key assigned to the an event hash (hash format is the same as is stored in the config)
    ![inputcommand][commandString]  Key assigned to the command string in the global input map
    \                               Escape character.  Any character typed after this is not parsed, and inserted directly
    {{{...}}}                       Everything inside the curly braces is not parsed.

Icon Resources

Icons can actually come from multiple sources. There are a few special definitions that are mostly internal to the application, which means that you’ll primarily be using the prefix iconresource_. For example:

1
 ![icon][iconresource_yourIconResourceHere]

Where only the “yourIconResourceHere” part is replaced with your icon resource name.

Restrictions

  • Font styles cannot be nested. You can’t do _text_ to get a bold italics. This is a limitation of the underlying rich text system.

  • The ![…][…] inserts can be wrapped in the font styles, for situations where you want to display input mappings or icons with bold or italic text, for example.

  • Fixed width fonts are slightly offset, due to the underlying implementation. This isn’t expected to be used very often, so it will likely stay this way for the time being.

  • inputcommand key assignments are always found in the global map, not in view-specific maps.

  • Special hidden rich text codes are inserted into parsed strings, which means that they can be parsed a second time without causing problems. However, these hidden codes can result in unprintable characters being displayed for clients that don’t support rich text (window titles, edit fields, OpenGL, etc). Most internal code detects and deletes these codes where necessary, but plug-in code in particular may not and may have to strip them with ILxMessageService::StripRichText().

  • Any Message_Tables.

  • Tooltips in command dialogs and forms also support markup.

  • Dialog example with markup:

# python import lx

lx.command(“dialog.setup”, style=”info”) lx.command(“dialog.msg”, msg=”@common@TestMarkup@”) lx.command(“dialog.open”) </syntaxhighlight>