Widgets: terminal & code

Two of the most common card embellishments: a styled terminal window for command-line snippets, and fenced code blocks with syntax highlighting.

Terminal widget

Wrap commands in a <terminal> tag for a macOS-style window with traffic-light dots and a title bar.

<terminal title="My Terminal">
git init
git add .
</terminal>

Renders as:

My Terminal
git init git add .

The title attribute defaults to terminal if omitted.

Code highlighting

Wrap a block in triple backticks with a language hint and you get syntax highlighting for free.

```python
def hello():
    print("Hello!")
    return 42
```

Renders as:

def hello():
    print("Hello!")
    return 42

Supported languages include Python, JavaScript, HTML, CSS, Bash, JSON, and many more — anything in the highlight.js common bundle will work.

Code blocks adapt to dark mode automatically: light theme uses GitHub, dark mode uses Atom One Dark.

Prefer raw Markdown? View this page as .md