Code Blocks¶
Basic Code Block¶
def hello_world():
print("Hello, World!")
return Truedef hello_world():
print("Hello, World!")
return TrueThis is a caption for my code block!
Code Block with Line Numbers¶
1 2 3def calculate_sum(a, b): result = a + b return result
Wide Code Block¶
This code block has long lines and should be horizontally scrollable. Keyboard users should be able to tab to it and scroll with arrow keys.
def print_a_really_long_string():
print("MyST is really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really neat!")Blockquotes¶
Basic blockquote for quoted text.
The best way to predict the future is to invent it.
Alan Kay
Cards¶
Basic card with content.
First card.
Second card.
Card content below the image.
Grids¶
Column 1
Column 2
Column 3
Dropdowns¶
Click to Expand
Hidden content inside dropdown.
Tabs¶
Content for tab 1
Content for tab 2
Math¶
Mermaid¶
IFrame¶
Here’s an iframe with a title
Topics¶
Regular content continues after the topic block.
Containers¶
You can add classes to a div using inline syntax:
This is a div with an inline class.
Or using the :class: option:
This is a div with a class specified via option.
Table of Contents¶
The {toc} directive generates a table of contents from headings that follow it on the page. The :depth: option controls how many heading levels to include.
With :depth: 1, only top-level headings are shown:
- myst-theme documentation
- User Interface Components
- Authorship Metadata
- Widgets
- Permalinks and URLs
- Visual Reference
- Developer Guide
With :depth: 2, subheadings are also included:
- myst-theme documentation
- User Interface Components
- Authorship Metadata
- Widgets
- Permalinks and URLs
- Visual Reference
- Developer Guide
With :context: section, only the section is included:
Glossary¶
- Term One
- Definition of the first term in the glossary.
- Term Two
- Definition of the second term with more detail.
- Term Three
- Another term with its definition.