Markdown
The Markdown widget displays Markdown-formatted text in a Mercury App. It converts Markdown to HTML and renders it as a first-class widget with full Mercury layout support.
The Markdown rendering dependency is installed automatically with the mercury
package, so no additional setup is required.
The widget supports Mercury layout placement via the position argument:
"inline"— render in the main notebook flow (default)"sidebar"— render in the sidebar"bottom"— render after all notebook cells
Basic Usage
Section titled “Basic Usage”Render Markdown in the main view:
import mercury as mr
mr.Markdown( "# Hello\nThis is **Markdown** rendered in Mercury.")Layout
Section titled “Layout”Use position to control where the Markdown is displayed:
import mercury as mr
mr.Markdown( "## Sidebar note\nYou can put documentation or hints here.", position="sidebar")import mercury as mr
mr.Markdown( "_Footer-style text_ shown at the bottom.", position="bottom")Basic Markdown Syntax
Section titled “Basic Markdown Syntax”The Markdown widget supports standard Markdown syntax.
Headings
Section titled “Headings”# Heading 1## Heading 2### Heading 3Emphasis
Section titled “Emphasis”*italic***bold*****bold and italic***Unordered list:
- Item A- Item B- Item COrdered list:
1. First2. Second3. Third[Mercury documentation](https://mljar.com/mercury)Inline code:
Use `print()` to display output.Markdown Props
Section titled “Markdown Props”type: string
Markdown content to render.
position
Section titled “position”type: "inline" | "sidebar" | "bottom"
Controls where the widget is rendered.
Default: "inline"
type: string
Unique identifier used to reuse the same widget instance.