We recommend using draw.io or similar if you want to create your diagrams manually, or mermaid to declare the diagrams in markdown files.
It is recommended to document every zome in your happ separately, to improve readability and reusability.
For every type of entry in your zome, specify the rust struct with its fields and types and the links from and to your entry:
Entry "<entry_type_name>" {
struct <StructName> {
<struct_fields>: <struct_field_types>
}
Links: {
<base_entry_type_name>-><target_entry_type_name>
}
}
Identifiers (entry_type_name, base_entry_type_name…) should match the names in your zome. These are important for holochain to know which entries is your code linking.
Try to create just enough example entries to represent all the relationships. If there are too little of them, you may be missing some types of relationships. If there are too many, the diagram can get difficult to grasp at first glance.
Note: if your diagram is starting to get out of hand, it could be a sign that your zome has too much complexity, as zomes should be small and easy to reason about. It may be time to consider splitting its functionality.
Ok(())
, specify the conditions in which each entry is valid. Try to be as precise as possible.Entry "anchor" {
struct Anchor {
anchor_type: String,
anchor_text: String
}
Links: {
hashtag->tweet
}
}
Entry "tweet" {
struct Tweet {
author_address: Address,
timestamp: u64,
content: String
}
Links: {
agent_id->tweet
}
}
graph TD
subgraph Clutter zome
subgraph tweets
Tweet1
Tweet2
end
subgraph handles
Tweet1 -.creator_address.-> alice_handle
Tweet2 -.creator_address.-> bob_handle
bob_handle --> Tweet2
alice_handle --> Tweet1
end
subgraph anchors
hashtag1 --> Tweet1
all_tweets
all_tweets --> Tweet1
all_tweets --> Tweet2
end
end
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing