# Markdown

A showcase of all Markdown features supported in Trilium's Markdown note type.

## 1. Basic Formatting (Standard Markdown)

Bold text, italic text, strikethrough, and `inline code`.

> A simple blockquote demonstrating standard Markdown.

## 2. GitHub-Flavored Markdown (GFM)

### Tables

Feature | Supported | Notes
--- | --- | ---
Standard Markdown | ✅ | Full support
GFM Tables | ✅ | Like this one
Math Equations | ✅ | Via KaTeX
Mermaid Diagrams | ✅ | Via ```mermaid blocks
Admonitions | ✅ | GitHub-style

### Task Lists

- Create a Markdown note in Trilium
- Add syntax highlighting
- Convert from a Text note
- Export and re-import

## 3. Code Blocks with Syntax Highlighting

> Note: The language must be specified for syntax highlighting to apply.

Sample with no syntax highlighting:

    function greet(name) {

      return `Hello, ${name}!`;

    }

    console.log(greet("Trilium"));

JavaScript with syntax highlighting:

    // JavaScript example

    function greet(name) {

      return `Hello, ${name}!`;

    }

    console.log(greet("Trilium"));

Python example:

    def factorial(n):

        return 1 if n <= 1 else n * factorial(n - 1)

    print(factorial(10))

SQL example:

    SELECT title, dateCreated

    FROM notes

    WHERE type = 'markdown'

    ORDER BY dateCreated DESC;

## 4. Block Quotes & Admonitions

> A standard Markdown blockquote. It can span multiple lines.

This is a note admonition. Useful for neutral side information.

This is a tip admonition. Great for optional improvements or shortcuts.

This is an important admonition. Use it for information the user should not miss.

This is a warning admonition. Indicates something that may cause problems.

This is a caution admonition. Use for destructive or irreversible actions.

## 5. Math Equations

Inline math: \(E = mc^2\)

Block math:

\[\int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi}\] \[\Gamma(n) = (n-1)! \quad \forall n \in \mathbb{N}\]

## 6. Mermaid Diagrams

    graph TD

        A[Start] --> B{Is it a Markdown note?}

        B -- Yes --> C[Render preview]

        B -- No --> D[Use Text note]

        C --> E[Enjoy split view!]

    sequenceDiagram

        participant User

        participant Trilium

        User->>Trilium: Opens Markdown note

        Trilium->>User: Shows split view (source + preview)

        User->>Trilium: Edits source

        Trilium->>User: Syncs scroll & highlights block

## 7. Internal (Reference) Links — Wikilinks Format

Link to a note by its Note ID using the Wikilinks-like format:

[missing note]

Or using HTML syntax for more control:

Internal link via HTML

## 8. Include Note (HTML Syntax)

Included notes using HTML syntax.

## 9. Nested Syntax Highlighting (Code Inside Code Blocks)

Trilium's source pane supports nested syntax highlighting — for example, highlighting HTML inside a Markdown code fence:

    <!DOCTYPE html>

    <html lang="en">

    <head>

      <meta charset="UTF-8">

      <title>Trilium</title>

    </head>

    <body>

      <h1>Hello from HTML inside Markdown!</h1>

    </body>

    </html>

## 10. Lists

### Unordered

- Item one
  - Nested item A
  - Nested item B
    - Deeply nested
- Item two
- Item three

### Ordered

1. First step
2. Second step
   1. Sub-step A
   2. Sub-step B
3. Third step

## 11. Horizontal Rules & Misc

Horizontal rule:

Superscript: X^2^
Subscript: H2O
Footnote reference1

## Footnotes

1. This is the footnote content. ↩