Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions MARKDOWN_FORMATTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,12 @@ The site uses Tailwind Typography for consistent, beautiful text rendering:

Check out these resources for markdown formatting examples:

- **Comprehensive Demo Post** - A complete demonstration of all available formatting features (hidden from blog listings)
- [Rendered version](/blog/markdown-features-demo) - See how the features look on the site
- **Demo Post** - A complete demonstration of all available formatting features (hidden from blog listings)
- [Rendered version](https://ddev.com/blog/markdown-features-demo) - See how the features look on the site
- [Source code](https://github.com/ddev/ddev.com/blob/main/src/content/blog/markdown-features-demo.md) - View the raw markdown
- Any post in `src/content/blog/` that uses the `:::` directive syntax
- Posts using blockquote-style callouts with `> **Label**:` format
- [Mermaid diagram documentation](https://mermaid.js.org/intro/)

## Questions?

Expand Down
100 changes: 100 additions & 0 deletions src/content/blog/markdown-features-demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,106 @@ Videos should be wrapped in a `.video-container` div for responsive sizing:
></iframe>
</div>

## Mermaid Diagrams

Mermaid lets you create diagrams from text using fenced code blocks with the `mermaid` language identifier. See the [Mermaid documentation](https://mermaid.js.org/intro/) for the full list of diagram types and syntax.

### Flowchart

```mermaid
flowchart TD
A[Developer] -->|git push| B[CI Pipeline]
B --> C{Tests pass?}
C -->|Yes| D[Build]
C -->|No| E[Notify developer]
D --> F[Deploy to staging]
F --> G{Approved?}
G -->|Yes| H[Deploy to production]
G -->|No| E
```

### Sequence Diagram

```mermaid
sequenceDiagram
participant Browser
participant Server
participant DB

Browser->>Server: GET /api/users
Server->>DB: SELECT * FROM users
DB-->>Server: rows
Server-->>Browser: 200 OK (JSON)

Browser->>Server: POST /api/users
Server->>DB: INSERT INTO users
DB-->>Server: OK
Server-->>Browser: 201 Created
```

### Class Diagram

```mermaid
classDiagram
class Animal {
+String name
+int age
+speak() String
}
class Dog {
+String breed
+fetch() void
}
class Cat {
+bool indoor
+purr() void
}
Animal <|-- Dog
Animal <|-- Cat
```

### State Diagram

```mermaid
stateDiagram-v2
[*] --> Pending
Pending --> Running: start
Running --> Succeeded: complete
Running --> Failed: error
Failed --> Pending: retry
Succeeded --> [*]
Failed --> [*]: give up
```

### Pie Chart

```mermaid
pie showData
title Operating Systems in Use
"Linux" : 42
"macOS" : 35
"Windows" : 23
```

### Git Graph

```mermaid
gitGraph
commit id: "Initial commit"
branch feature/login
checkout feature/login
commit id: "Add login form"
commit id: "Add validation"
checkout main
branch feature/api
checkout feature/api
commit id: "Add REST endpoints"
checkout main
merge feature/login id: "Merge login"
merge feature/api id: "Merge API"
commit id: "Release v1.0"
```

## Complex Combinations

:::danger[Production Deployment Checklist]
Expand Down
1 change: 1 addition & 0 deletions src/pages/search.astro
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ const title = `Search`
type="search"
class="border rounded px-4 py-2 text-lg w-full dark:bg-transparent dark:border-slate-700 dark:text-white"
autofocus
autocomplete="off"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because autocomplete covered the search results:

image

/>
<div id="results"></div>
</div>
Expand Down
Loading