mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
Merge branch 'develop' into sidv/packet-release
* develop: (266 commits) chore: update E2E timings docs: Update changeset fix: Add useful error message to test chore: Add treemap example chore: Add treemap example chore: Add peerDependency to @mermaid-js/examples Version Packages docs: Update changeset update in changeset updated validaor and tests to use treemap Updated parser to use treemap chore: Fail build in CI on type errors fix text going outside node Version Packages Updated phpbb url to support 403 in lychee Updated lychee for working url phpbb.com resolve PR comment resolve PR comments chore: update E2E timings add changeset ...
This commit is contained in:
@@ -16,13 +16,25 @@ This diagram type is particularly useful for developers, network engineers, educ
|
||||
|
||||
## Syntax
|
||||
|
||||
```md
|
||||
```
|
||||
packet
|
||||
start: "Block name" %% Single-bit block
|
||||
start-end: "Block name" %% Multi-bit blocks
|
||||
... More Fields ...
|
||||
```
|
||||
|
||||
### Bits Syntax (v11.7.0+)
|
||||
|
||||
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 `+<count>` to set the number of bits, thus:
|
||||
|
||||
```
|
||||
packet-beta
|
||||
+1: "Block name" %% Single-bit block
|
||||
+8: "Block name" %% 8-bit block
|
||||
9-15: "Manually set start and end, it's fine to mix and match"
|
||||
... More Fields ...
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
```mermaid-example
|
||||
@@ -76,8 +88,8 @@ packet
|
||||
```mermaid-example
|
||||
packet
|
||||
title UDP Packet
|
||||
0-15: "Source Port"
|
||||
16-31: "Destination Port"
|
||||
+16: "Source Port"
|
||||
+16: "Destination Port"
|
||||
32-47: "Length"
|
||||
48-63: "Checksum"
|
||||
64-95: "Data (variable length)"
|
||||
@@ -86,8 +98,8 @@ title UDP Packet
|
||||
```mermaid
|
||||
packet
|
||||
title UDP Packet
|
||||
0-15: "Source Port"
|
||||
16-31: "Destination Port"
|
||||
+16: "Source Port"
|
||||
+16: "Destination Port"
|
||||
32-47: "Length"
|
||||
48-63: "Checksum"
|
||||
64-95: "Data (variable length)"
|
||||
|
Reference in New Issue
Block a user