Display string formatted as Markdown.

Supported :

  • Emoji shortcodes, such as :+1: and :sunglasses:. For a list of all supported codes, see https://www.webfx.com/tools/emoji-cheat-sheet/.
  • Tables
  • Strikethrough
  • Autolink: turns plain links such as URLs and email addresses into links

Method Signatures and Parameters

Jt.markdown(String body)

body (String)

The text to display as Markdown.

Chainable builder methods

help(String help)

A tooltip that gets displayed next to the text. If this is null (default), no tooltip is displayed.

width(String width)

The width of the element. This can be one of the following:

  • content (default): The width of the element matches the width of its content, but doesn't exceed the width of the parent container.
  • stretch: The width of the element matches the width of the parent container.
  • An integer specifying the width in pixels: The element has a fixed width. If the specified width is greater than the width of the parent container, the width of the element matches the width of the parent container.

width(int widthPixels)

The width of the element in pixels. The element will have a fixed width. If the specified width is greater than the width of the parent container, the width of the element matches the width of the parent container.

key(String key)

A string to use as the unique key for the widget. If this is omitted, a key will be generated for the widget based on its content. No two widgets may have the same key.

No description

use()

Put the widget in the app, in the MAIN container.

use(JtContainer container)

Put the widget in the app, in the provided container.

Examples

Basic markdown formatting and colored text styling

 import tech.catheu.jeamlit.core.Jt;

 public class MarkdownApp {
     public static void main(String[] args) {
         // Basic text formatting
         Jt.markdown("*Jeamlit* is **really** ***cool***.").use();

         // Divider
         Jt.markdown("---").use();

         // Emoji and line breaks
         Jt.markdown("Here's a bouquet — :tulip::cherry_blossom::rose::hibiscus::sunflower::blossom:").use();
     }
 }

forum

Still have questions?

Go to our discussions forum for helpful information and advice from Jeamlit experts.