Cheatsheet

Quick reference with live previews for Markdown, shortcodes, and front matter.

Cheatsheet

Each section shows the syntax followed by a live preview.

Alerts

> [!NOTE]
> General info the reader should not miss.

[!NOTE] General info the reader should not miss.

> [!TIP]
> Helpful suggestion.

[!TIP] Helpful suggestion.

> [!IMPORTANT]
> Must-know info.

[!IMPORTANT] Must-know info.

> [!WARNING]
> Could cause problems.

[!WARNING] Could cause problems.

> [!CAUTION]
> Risk of harm or data loss.

[!CAUTION] Risk of harm or data loss.

Details

{{</* details title="Click to expand" */>}}
Hidden content revealed on click.
{{</* /details */>}}

{{< details title="Click to expand" >}} Hidden content revealed on click. {{< /details >}}

{{</* details title="Open by default" open=true */>}}
Visible immediately.
{{</* /details */>}}

{{< details title="Open by default" open=true >}} Visible immediately. {{< /details >}}

Tabs

{{</* tabs */>}}
{{</* tab "Go" */>}}
```go
fmt.Println("hello")
```
{{</* /tab */>}}
{{</* tab "Python" */>}}
```python
print("hello")
```
{{</* /tab */>}}
{{</* tab "Rust" */>}}
```rust
println!("hello");
```
{{</* /tab */>}}
{{</* /tabs */>}}

{{< tabs >}} {{< tab "Go" >}}

fmt.Println("hello")

{{< /tab >}} {{< tab "Python" >}}

print("hello")

{{< /tab >}} {{< tab "Rust" >}}

println!("hello");

{{< /tab >}} {{< /tabs >}}

Steps

{{</* steps */>}}

1. **Install Hugo**

   Download the extended binary from gohugo.io.

2. **Clone the repo**

   `git clone git@github.com:tamnd/brain.git`

3. **Run locally**

   `hugo server`

{{</* /steps */>}}

{{< steps >}}

  1. Install Hugo

    Download the extended binary from gohugo.io.

  2. Clone the repo

    git clone git@github.com:tamnd/brain.git

  3. Run locally

    hugo server

{{< /steps >}}

Badge

{{</* badge content="stable" type="info" */>}}
{{</* badge content="beta" type="warning" */>}}
{{</* badge content="deprecated" type="error" */>}}
{{</* badge content="tag" */>}}

{{< badge content="stable" type="info" >}} {{< badge content="beta" type="warning" >}} {{< badge content="deprecated" type="error" >}} {{< badge content="tag" >}}

Mermaid diagrams

```mermaid
graph LR
    A[Write note] --> B[brain_on.sh detects change]
    B --> C[git commit + push]
    C --> D[GitHub Actions builds]
    D --> E[Live on GitHub Pages]
```
graph LR
    A[Write note] --> B[brain_on.sh detects change]
    B --> C[git commit + push]
    C --> D[GitHub Actions builds]
    D --> E[Live on GitHub Pages]
```mermaid
sequenceDiagram
    Client->>Server: GET /api/notes
    Server-->>Client: 200 OK + JSON
```
sequenceDiagram
    Client->>Server: GET /api/notes
    Server-->>Client: 200 OK + JSON

KaTeX math

Inline:

$E = mc^2$

$E = mc^2$

Block (centered):

$$
\int_0^\infty e^{-x^2}\,dx = \frac{\sqrt{\pi}}{2}
$$

$$ \int_0^\infty e^{-x^2},dx = \frac{\sqrt{\pi}}{2} $$

Code blocks

```go
package main

import "fmt"

func main() {
    fmt.Println("hello, brain")
}
```
package main

import "fmt"

func main() {
    fmt.Println("hello, brain")
}
def greet(name: str) -> str:
    return f"hello, {name}"
SELECT title, date
FROM notes
WHERE tags @> ARRAY['go']
ORDER BY date DESC;
hugo server --buildDrafts --buildFuture

Markdown quick reference

Text

Syntax Result
**bold** bold
*italic* italic
`code` code
~~strike~~ strike
[external](https://gohugo.io)
[internal]({{</* relref "cheatsheet.md" */>}})

external

Task list

- [x] Published cheatsheet
- [x] Added dark mode toggle
- [ ] Write more notes
  • Published cheatsheet
  • Added dark mode toggle
  • Write more notes

Table

| Left | Center | Right |
|:-----|:------:|------:|
| a    |   b    |     c |
| 1    |   2    |     3 |
Left Center Right
a b c
1 2 3

Footnote

This is a claim.[^source]

[^source]: The source for this claim.

This is a claim.[^source]

[^source]: The source for this claim.

Front matter reference

title: "Note title"
date: 2026-05-02
weight: 1                    # sidebar order, lower = higher
tags: ["go", "db"]
draft: false

math: true                   # enable KaTeX on this page