mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-22 09:46:42 +02:00
add documentation
This commit is contained in:
@@ -23,6 +23,17 @@ start-end: "Block name" %% Multi-bit blocks
|
|||||||
... More Fields ...
|
... More Fields ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Bits Syntax (v\<MERMAID_RELEASE_VERSION>+)
|
||||||
|
|
||||||
|
Using start and end bit counts can be difficult, especially when modifying a design. For this we add a bit count field, which starts from the end of the previous field automagically. Use `bit` or `bits` interchangeably to set the number of bits, thus:
|
||||||
|
|
||||||
|
````md
|
||||||
|
packet-beta
|
||||||
|
1bit: "Block name" %% Single-bit block
|
||||||
|
8bits: "Block name" %% 8-bit block
|
||||||
|
9-15: "Manually set start and end, it's fine to mix and match"
|
||||||
|
... More Fields ...
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
```mermaid-example
|
```mermaid-example
|
||||||
@@ -30,32 +41,8 @@ start-end: "Block name" %% Multi-bit blocks
|
|||||||
title: "TCP Packet"
|
title: "TCP Packet"
|
||||||
---
|
---
|
||||||
packet-beta
|
packet-beta
|
||||||
0-15: "Source Port"
|
16bits: "Source Port"
|
||||||
16-31: "Destination Port"
|
16bits: "Destination Port"
|
||||||
32-63: "Sequence Number"
|
|
||||||
64-95: "Acknowledgment Number"
|
|
||||||
96-99: "Data Offset"
|
|
||||||
100-105: "Reserved"
|
|
||||||
106: "URG"
|
|
||||||
107: "ACK"
|
|
||||||
108: "PSH"
|
|
||||||
109: "RST"
|
|
||||||
110: "SYN"
|
|
||||||
111: "FIN"
|
|
||||||
112-127: "Window"
|
|
||||||
128-143: "Checksum"
|
|
||||||
144-159: "Urgent Pointer"
|
|
||||||
160-191: "(Options and Padding)"
|
|
||||||
192-255: "Data (variable length)"
|
|
||||||
```
|
|
||||||
|
|
||||||
```mermaid
|
|
||||||
---
|
|
||||||
title: "TCP Packet"
|
|
||||||
---
|
|
||||||
packet-beta
|
|
||||||
0-15: "Source Port"
|
|
||||||
16-31: "Destination Port"
|
|
||||||
32-63: "Sequence Number"
|
32-63: "Sequence Number"
|
||||||
64-95: "Acknowledgment Number"
|
64-95: "Acknowledgment Number"
|
||||||
96-99: "Data Offset"
|
96-99: "Data Offset"
|
||||||
@@ -72,6 +59,7 @@ packet-beta
|
|||||||
160-191: "(Options and Padding)"
|
160-191: "(Options and Padding)"
|
||||||
192-255: "Data (variable length)"
|
192-255: "Data (variable length)"
|
||||||
```
|
```
|
||||||
|
````
|
||||||
|
|
||||||
```mermaid-example
|
```mermaid-example
|
||||||
packet-beta
|
packet-beta
|
||||||
|
@@ -17,6 +17,17 @@ start-end: "Block name" %% Multi-bit blocks
|
|||||||
... More Fields ...
|
... More Fields ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Bits Syntax (v<MERMAID_RELEASE_VERSION>+)
|
||||||
|
|
||||||
|
Using start and end bit counts can be difficult, especially when modifying a design. For this we add a bit count field, which starts from the end of the previous field automagically. Use `bit` or `bits` interchangeably to set the number of bits, thus:
|
||||||
|
|
||||||
|
````md
|
||||||
|
packet-beta
|
||||||
|
1bit: "Block name" %% Single-bit block
|
||||||
|
8bits: "Block name" %% 8-bit block
|
||||||
|
9-15: "Manually set start and end, it's fine to mix and match"
|
||||||
|
... More Fields ...
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
```mermaid-example
|
```mermaid-example
|
||||||
@@ -24,8 +35,8 @@ start-end: "Block name" %% Multi-bit blocks
|
|||||||
title: "TCP Packet"
|
title: "TCP Packet"
|
||||||
---
|
---
|
||||||
packet-beta
|
packet-beta
|
||||||
0-15: "Source Port"
|
16bits: "Source Port"
|
||||||
16-31: "Destination Port"
|
16bits: "Destination Port"
|
||||||
32-63: "Sequence Number"
|
32-63: "Sequence Number"
|
||||||
64-95: "Acknowledgment Number"
|
64-95: "Acknowledgment Number"
|
||||||
96-99: "Data Offset"
|
96-99: "Data Offset"
|
||||||
@@ -42,6 +53,7 @@ packet-beta
|
|||||||
160-191: "(Options and Padding)"
|
160-191: "(Options and Padding)"
|
||||||
192-255: "Data (variable length)"
|
192-255: "Data (variable length)"
|
||||||
```
|
```
|
||||||
|
````
|
||||||
|
|
||||||
```mermaid-example
|
```mermaid-example
|
||||||
packet-beta
|
packet-beta
|
||||||
|
Reference in New Issue
Block a user