@@ -106,7 +106,7 @@ The parser excludes these list item patterns:
106106| ---------| ---------| --------|
107107| Checkboxes | ` - [ ] Todo item ` , ` - [x] Done ` , ` - [-] Cancelled ` | Task list syntax |
108108| Markdown links | ` - [text](url) ` | URL link syntax |
109- | Bare wiki links | ` - [[Target]] ` | Treated as a relation instead |
109+ | Bare wiki links | ` - [[Target]] ` | Treated as a ` links_to ` relation instead |
110110
111111A list item with ` #tags ` but no ` [category] ` is still parsed — the tags are extracted and the category defaults to ` Note ` .
112112
@@ -116,47 +116,65 @@ Relations connect documents to form the knowledge graph. There are two kinds.
116116
117117### Explicit Relations
118118
119- Written as list items with a relation type and a ` [[wiki link]] ` target.
119+ Written as list items with a relation type and a ` [[wiki link]] ` target. Unquoted
120+ relation types are single tokens. Quote relation types that contain spaces.
120121
121122** Syntax:**
122123
123124```
124125- relation_type [[Target Entity]] (context)
126+ - "multi word relation type" [[Target Entity]] (context)
127+ - 'multi word relation type' [[Target Entity]] (context)
125128```
126129
127130| Part | Required | Description |
128131| ------| ----------| -------------|
129- | ` relation_type ` | No | Text before ` [[ ` . Defaults to ` relates_to ` if omitted . |
132+ | ` relation_type ` | Yes | Single unquoted token before ` [[ ` , or quoted text for multi-word labels . |
130133| ` [[Target]] ` | Yes | Wiki link to the target entity. Matched by title or permalink. |
131134| ` (context) ` | No | Parenthesized text after ` ]] ` . Supporting details. |
132135
133136### Examples
134137
138+ Explicit relations:
139+
135140``` markdown
136141- implements [[ Search Design]]
137142- depends_on [[ Database Schema]]
138143- works_at [[ Y Combinator]] (co-founder)
144+ - "based on" [[ Customer Interview]]
145+ - 'in response to' [[ Incident Review]]
146+ ```
147+
148+ Bare wiki links and prose list items create implicit ` links_to ` relations:
149+
150+ ``` markdown
139151- [[ Some Entity]]
152+ - some other thing [[ Some Entity]]
140153```
141154
142- The last example — a bare ` [[wiki link]] ` in a list item — gets relation type ` relates_to ` .
155+ Both examples above create ` links_to [[Some Entity]] ` . Use quotes when the words before
156+ ` [[ ` are meant to be a multi-word relation type.
143157
144158Common relation types:
145159- ` implements ` , ` depends_on ` , ` relates_to ` , ` inspired_by `
146160- ` extends ` , ` part_of ` , ` contains ` , ` pairs_with `
147161- ` works_at ` , ` authored ` , ` collaborated_with `
148162
149- Any text works as a relation type. These are conventions, not a fixed set.
163+ Any single-token text or quoted text works as a relation type. These are conventions,
164+ not a fixed set.
150165
151166### Inline References
152167
153- Wiki links appearing in regular prose (not as list items) create implicit ` links_to ` relations.
168+ Wiki links appearing in regular prose create implicit ` links_to ` relations. This includes
169+ list items that do not match the explicit relation grammar above.
154170
155171``` markdown
156172This builds on [[ Core Design]] and uses [[ Utility Functions]] .
173+ - We should revisit [[ Search Design]] after the API changes.
157174```
158175
159- This creates two relations: ` links_to [[Core Design]] ` and ` links_to [[Utility Functions]] ` .
176+ This creates three relations: ` links_to [[Core Design]] ` , ` links_to [[Utility Functions]] ` ,
177+ and ` links_to [[Search Design]] ` .
160178
161179### Forward References
162180
0 commit comments