Skip to content

Commit b66252f

Browse files
add block annotation to docs
1 parent 8ebea93 commit b66252f

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

src/documentation/language/tags.malloynb

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,35 @@ Annotations which start `##` are collected with the file or "model" and annotati
1717
view: how_many is things -> { aggregate: total_count is count() }
1818
```
1919

20+
## Block Annotations
21+
22+
For longer annotations that span multiple lines, use block annotation syntax. Object block annotations start with `#|` and end with `|#`. Model block annotations start with `##|` and end with `|##`.
23+
24+
```malloy
25+
source: flights is duckdb.table('flights.parquet') extend {
26+
#|
27+
bar_chart
28+
size=xl
29+
color=blue
30+
|#
31+
dimension: carrier_name is carrier
32+
}
33+
```
34+
35+
The closing `|#` (or `|##`) must be at the same indentation level as the opening `#|` (or `##|`). Indentation is automatically stripped based on the column position of the opener — so the content above is equivalent to writing three separate annotations `# bar_chart`, `# size=xl`, and `# color=blue`. Tabs in the indentation area are not allowed — use spaces.
36+
37+
Block annotations can also include a routing prefix, just like single-line annotations:
38+
39+
```malloy
40+
#|(docs)
41+
This is a multi-line documentation annotation.
42+
It can contain as much text as needed.
43+
|#
44+
source: my_source is duckdb.table('my_table')
45+
```
46+
47+
## Annotation Distribution
48+
2049
An object annotation which happens before a definition list is distributed to each member of the list, but each member can also have their own unique annotations
2150

2251
```malloy

0 commit comments

Comments
 (0)