Myne
Markdown Code blocks

Code blocks

Updated June 11, 2026

How to write inline code and fenced code blocks with language hints, and how Myne applies syntax highlighting to the code you write.

For anything longer than a word of code, use a fenced code block. Myne renders it as a card with syntax highlighting and a copy button.

Writing a code block

Open and close the block with three backticks, and put the language after the opening fence:

```python
def greet(name):
    return f"Hello, {name}"
```

The language label appears on the card, and the code is highlighted for that language. If you start a fence and don’t close it, Myne keeps the rest of the note as code until you add the closing fence. Typing the opening fence offers to auto-close it for you.

Supported languages

Syntax highlighting is available for these languages. The name is case-insensitive, and any of the listed aliases works:

LanguageTagAliases
JavaScriptjavascriptjs, node, mjs, cjs
JSXjsxnone
TypeScripttypescriptts
TSXtsxnone
Pythonpythonpy, py3, python3
Rustrustrs
JSONjsonnone
HTMLhtmlhtm, xhtml
CSScssnone
YAMLyamlyml
Shellbashsh, shell, zsh, shellscript, console
Diffdiffpatch

A block with no language, or one Myne doesn’t recognize, renders as a plain monospace card with no coloring; Myne does not guess. The language set is curated by the maintainers; you can’t add more yourself.

The copy button

The card’s copy button copies the code inside the block: the lines between the fences, without the backticks or the language label, so you can paste it straight into a terminal or editor.

Limits

Markdown special characters inside a code block are inert: a [[wikilink]] or a #tag written inside code stays as literal code text, not a link or a tag. Code blocks are for showing code, not running it; Myne never executes what’s in them.