Skip to notepad
Typehall

Lesson 7 of 12 · Intermediate

Code that stays exactly as typed

Backticks for fragments, fences for files — plus real highlighting.

In this lesson you will learn inline code, fenced code blocks, language tags, and which languages Typehall actually highlights.

Syntax

Use `git status` to see what changed.

```python
def total(xs):
    return sum(xs)
```

Single backticks mark inline code — commands, filenames, short expressions. Triple backticks open a fenced block; the word right after the opening fence names the language, and the same three backticks close it.

Real highlighting, on your device

In Typehall, naming a supported language highlights the block in Preview — rendered locally, offline after the first visit, with the source text preserved exactly:

```javascript
const retry = (fn, n = 3) => tryOnce(fn, n);
```

```swift
let total = items.reduce(0, +)
```

```sql
SELECT name, COUNT(*) FROM books GROUP BY name;
```

Highlighted languages: JavaScript (js, jsx), TypeScript (ts, tsx), JSON, XML/HTML, CSS, Python (py), Swift, SQL, Bash (sh, shell, zsh), Markdown (md), and YAML (yml). An unknown or missing tag renders as plain code — never an error, never a broken block.

Mistakes that bite

  • Unclosed fence — everything below becomes code. Count your fences: every opening trio needs a closing trio.
  • Four-space indent style — Markdown's oldest code syntax still parses, but fences are explicit and travel better. Prefer fences.
  • Code containing triple backticks — if the snippet itself shows fences, the outer fence must be longer (four backticks) or the block ends early.

Exercise

Write a three-line note: one inline command you use daily, one fenced block in a language you know, and one fenced block with no language tag.

Compare all three in Preview.

Name the language on the opening fence, close every fence, then check that the untagged block still renders as plain code.

Try this exercise in Typehall

New to Typehall? Edit the Markdown in the new note, then choose Preview to see the rendered result, or Split to edit and preview at the same time. How the Markdown editor works. Tip: Split works especially well with Focus enabled, giving the editor and rendered preview more room.

Structured data comes next: Tables.

Learn Markdown course index — all 12 lessons in order.