Skip to content

Commit 83d4c71

Browse files
authored
Merge pull request #7 from mdn/http-mermaid
feat: check in HTTP sequence diagrams
2 parents 24b35f8 + 8313391 commit 83d4c71

11 files changed

+665
-0
lines changed

images/diagrams/http/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Mermaid sequence diagrams
2+
3+
This directory includes SVG diagrams which are generated from [Mermaid](https://mermaid.js.org/) syntax.
4+
For example, the source `.mmd` file is a sibling of the generated SVG:
5+
6+
```plain
7+
├── content-negotiation.mmd
8+
└── content-negotiation.svg
9+
```
10+
11+
## Converting to SVG
12+
13+
For any `.mmd` file, you may visit <https://www.mermaidchart.com/> and export as SVG.
14+
Alternatively, see the [CLI](https://github.com/mermaid-js/mermaid-cli) and other tools under <https://github.com/mermaid-js>.
15+
16+
## Discussions, issues and pull requests
17+
18+
For information about Mermaid diagrams and context of their inclusion in MDN repos, see:
19+
20+
- [Using SVG format instead of .png images](https://github.com/orgs/mdn/discussions/631) GitHub discussion
21+
- [feat: Add SVG diagrams for HTTP sequences](https://github.com/mdn/content/pull/31812) `mdn/content` pull request
22+
- [Support Mermaid in MDN Markdown](https://github.com/orgs/mdn/discussions/358)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
%%{init: { "sequence": { "wrap": true, "width": 175, "noteAlign": "center" }} }%%
2+
3+
sequenceDiagram
4+
participant Client
5+
participant Node1 as Node
6+
participant Node2 as Node
7+
participant Server
8+
9+
Note over Client: Request message
10+
Client->>Node1: GET /doc HTTP/1.1
11+
12+
Note over Node1: Shows support for compression while forwarding message.
13+
Node1->>Node2: GET /doc HTTP/1.1<br/>TE: gzip, br
14+
15+
Note over Node2: Forwards message
16+
Node2->>Server: GET /doc HTTP/1.1
17+
18+
Note over Server: Returns resource in an uncompressed body.
19+
Server->>Node2: HTTP/1.1 200 OK
20+
21+
22+
Note over Node2: Compresses body and forwards message.
23+
Node2->>Node1: HTTP/1.1 200 OK<br/>Transfer-Encoding: br
24+
25+
Note over Node1: Uncompresses resource and returns message to Client.
26+
Node1->>Client: HTTP/1.1 200 OK
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
%%{init: { "sequence": { "wrap": true, "width":380, "noteAlign": "center", "messageAlign": "left" }} }%%
2+
3+
sequenceDiagram
4+
participant Client
5+
participant Server
6+
7+
Note over Client: The client signifies its ability to understand two compression algorithms.
8+
Client->>Server: GET /doc HTTP/1.1<br/>Accept-Encoding: br, gzip
9+
Note over Server: The resource is sent compressed. The Vary header indicates that content negotiation has been used to select the algorithm.
10+
Server->>Client: HTTP/1.1 200 OK<br/>Content-Encoding: br<br/>Vary: Accept-Encoding

0 commit comments

Comments
 (0)