Skip to content

Commit 5afe482

Browse files
respencer-nclclaude
andcommitted
Fix metadata pages to show correct with { } placement
Metadata items (terms, options, author references, descriptions, attachments) belong in `with { }` blocks after a definition's closing brace, not inside the body. These pages incorrectly showed them as body definitions. - metadata.md: Complete rewrite with correct placement examples, fixed term syntax, option syntax, and author def vs ref split - author.md: Clarify definitions (Module/Domain only) vs references (any definition's with { } block) - term.md: Move all examples into with { } blocks, fix Occurs In - option.md: Add `option is` syntax, fix Occurs In to metadata Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0c1af97 commit 5afe482

4 files changed

Lines changed: 286 additions & 111 deletions

File tree

docs/riddl/concepts/author.md

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,67 @@ title: "Author"
33
draft: false
44
---
55

6-
An author definition merely describes one of the authors that wrote the
7-
encapsulating definition. An author definition contains the usual profile
6+
An author definition describes one of the authors who wrote the
7+
enclosing model. An author definition contains the usual profile
88
information for a human including:
9+
910
* full name
1011
* email address
1112
* name of an organization (optional)
1213
* title at that organization (optional)
1314
* url for more information (optional)
1415

16+
## Syntax
17+
18+
```riddl
19+
domain ECommerce is {
20+
author Reid is {
21+
name is "Reid Spencer"
22+
email is "reid@ossum.com"
23+
}
24+
25+
// ... domain body definitions ...
26+
}
27+
```
28+
29+
## Author Definitions vs. Author References
30+
31+
**Author definitions** can only appear in the body of a **Module**
32+
or a **Domain**. They are not permitted inside contexts, entities,
33+
or other processors.
34+
35+
To associate an author with any other definition, use an **author
36+
reference** in that definition's `with { }` metadata block:
37+
38+
```riddl
39+
domain ECommerce is {
40+
author Reid is {
41+
name is "Reid Spencer"
42+
email is "reid@ossum.com"
43+
}
44+
45+
context Catalog is {
46+
???
47+
} with {
48+
by author Reid
49+
}
50+
}
51+
```
52+
53+
The `by author` reference uses a path identifier that resolves to
54+
an author definition in an enclosing Module or Domain.
55+
1556
## Occurs In
16-
All [vital definitions](vital.md)
57+
58+
Author **definitions** occur in:
59+
60+
* [Root](root.md) (via Module)
61+
* [Domains](domain.md)
62+
63+
Author **references** (`by author`) occur in:
64+
65+
* [Metadata](metadata.md) blocks (`with { }`) on any definition
1766

1867
## Contains
19-
No other definitions
68+
69+
No other definitions.

docs/riddl/concepts/metadata.md

Lines changed: 123 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,48 @@ title: "Metadata"
33
draft: false
44
---
55

6-
Metadata in RIDDL provides supplementary information about definitions that
7-
doesn't affect the core semantics but aids documentation, organization, and
8-
tooling.
6+
Metadata in RIDDL provides supplementary information about
7+
definitions—documentation, terminology, attribution, and
8+
implementation hints—without affecting core semantics. All metadata
9+
lives in a `with { }` block that follows the definition's closing
10+
brace.
911

10-
## Common Metadata
12+
## Placement
1113

12-
All definitions support these metadata elements:
14+
Metadata appears **after** a definition's body, not inside it:
1315

14-
### Brief Description
16+
```riddl
17+
context OrderManagement is {
18+
// body definitions go here (entities, types, handlers, etc.)
19+
???
20+
} with {
21+
// metadata goes here
22+
briefly "Manages the order lifecycle"
23+
term Fulfillment is {
24+
|The complete process of receiving, processing, and
25+
|delivering an order to the customer.
26+
}
27+
option is technology("Kafka")
28+
}
29+
```
30+
31+
## Brief Description
1532

16-
A short, one-line description using `briefly`:
33+
A short, one-line summary using `briefly`:
1734

1835
```riddl
19-
entity Customer is {
36+
entity Customer is { ??? } with {
2037
briefly "A person or organization that purchases products"
21-
// ...
2238
}
2339
```
2440

25-
### Extended Description
41+
## Extended Description
2642

27-
Longer documentation using `described by` (or `described as`, `explained by`,
28-
`explained as`):
43+
Longer documentation using `described by` (or `described as`,
44+
`explained by`, `explained as`):
2945

3046
```riddl
31-
entity Customer is {
47+
entity Customer is { ??? } with {
3248
described by {
3349
|Customers are the primary actors in our e-commerce system.
3450
|They can browse products, place orders, and manage their
@@ -37,52 +53,116 @@ entity Customer is {
3753
}
3854
```
3955

40-
The `|` prefix indicates lines of documentation text (Markdown format).
56+
The `|` prefix indicates lines of documentation text in Markdown
57+
format.
4158

42-
### Terms
59+
## Terms
4360

44-
Domain-specific terminology with definitions:
61+
Domain-specific terminology defined as glossary entries. The syntax
62+
is `term` *identifier* `is` *doc_block*:
4563

4664
```riddl
4765
domain ECommerce is {
48-
term "SKU" is described by "Stock Keeping Unit - unique product identifier"
49-
term "Cart" is described by "Temporary collection of items before checkout"
66+
context Catalog is {
67+
???
68+
} with {
69+
term Listing is {
70+
|A product's presence in the catalog, including its
71+
|description, images, pricing, and availability.
72+
}
73+
}
74+
} with {
75+
term SKU is {
76+
|Stock Keeping Unit—a unique identifier for a specific
77+
|product variant, including size, color, and other
78+
|attributes.
79+
}
5080
}
5181
```
5282

53-
### Authors
83+
## Options
5484

55-
Attribution for definitions:
85+
Options are instructions to translators about how a definition
86+
should be implemented or interpreted. The syntax is `option is`
87+
*option_name* with optional string arguments:
5688

5789
```riddl
58-
author Reid is {
59-
name "Reid Spencer"
60-
email "reid@example.com"
90+
entity Order is {
91+
???
92+
} with {
93+
option is event-sourced
94+
option is aggregate
95+
option is technology("Akka")
96+
option is kind("core")
6197
}
98+
```
99+
100+
See [Options](option.md) for the full list of available options
101+
per definition type.
102+
103+
## Author Definitions vs. Author References
104+
105+
RIDDL distinguishes between **author definitions** and **author
106+
references**. They serve different purposes and appear in different
107+
places.
108+
109+
### Author Definitions (Body)
110+
111+
Author definitions declare who created or maintains a model. They
112+
can **only** appear in the body of a **Module** or **Domain**—not
113+
in contexts, entities, or other definitions:
114+
115+
```riddl
116+
domain ECommerce is {
117+
author Reid is {
118+
name is "Reid Spencer"
119+
email is "reid@ossum.com"
120+
}
62121
63-
domain MyDomain by author Reid is { ... }
122+
context Catalog is { ??? }
123+
}
64124
```
65125

66-
## Options
126+
See [Author](author.md) for full details.
67127

68-
Options modify the behavior of definitions. Common options include:
128+
### Author References (Metadata)
69129

70-
- `technology("x")`: Implementation technology hints
71-
- `kind("x")`: Classification of the definition
72-
- `css("x")`: Styling hints for documentation
73-
- `faicon("x")`: Font Awesome icon for documentation
130+
Author references use `by author` to associate an existing author
131+
definition with any definition's metadata:
74132

75133
```riddl
76-
context OrderManagement is {
77-
option technology("Akka")
78-
option kind("core")
79-
// ...
134+
domain ECommerce is {
135+
author Reid is {
136+
name is "Reid Spencer"
137+
email is "reid@ossum.com"
138+
}
139+
140+
context Catalog is {
141+
???
142+
} with {
143+
by author Reid
144+
}
145+
}
146+
```
147+
148+
## Attachments
149+
150+
Attachments associate external files (diagrams, spreadsheets,
151+
images) with a definition:
152+
153+
```riddl
154+
entity Order is {
155+
???
156+
} with {
157+
attachment StateChart is "diagrams/order-states.png"
158+
as "image/png"
80159
}
81160
```
82161

83162
## Occurs In
84163

85-
Metadata can appear in any definition, including:
164+
Metadata (`with { }` blocks) can appear on any definition,
165+
including:
86166

87167
* [Domains](domain.md)
88168
* [Contexts](context.md)
@@ -92,8 +172,12 @@ Metadata can appear in any definition, including:
92172

93173
## Contains
94174

95-
Metadata does not contain other definitions; it contains:
175+
Metadata blocks contain:
96176

97-
* Literal strings (descriptions, term definitions)
98-
* Options with parameters
99-
* Author references
177+
* Brief descriptions (`briefly`)
178+
* Extended descriptions (`described by`)
179+
* [Terms](term.md) — glossary entries
180+
* [Options](option.md) — translator instructions
181+
* Author references (`by author`)
182+
* Attachments
183+
* Comments

docs/riddl/concepts/option.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,43 @@ title: "Options"
33
draft: false
44
---
55

6-
Options are instructions to translators on how a particular
6+
Options are instructions to translators on how a particular
77
definition should be regarded. Any translator can make use of any
8-
option. Options can take a list of string arguments much like the
9-
options and arguments to a program. If none are specified, the option is
10-
considered to be a Boolean value that is `true` if specified.
8+
option. Options can take a list of string arguments much like the
9+
options and arguments to a program. If none are specified, the
10+
option is considered to be a Boolean value that is `true` if
11+
specified.
1112

12-
Every [vital definition](vital.md) in RIDDL allows a
13-
`technology` option that takes any number of string arguments. These can
14-
specify the technologies intended for the implementation. This idea was
13+
Options appear in `with { }` metadata blocks, not inside a
14+
definition's body. The syntax is `option is` *option_name* with
15+
optional string arguments:
16+
17+
```riddl
18+
entity Order is {
19+
???
20+
} with {
21+
option is event-sourced
22+
option is technology("Akka")
23+
}
24+
```
25+
26+
Every [vital definition](vital.md) in RIDDL allows a `technology`
27+
option that takes any number of string arguments. These can specify
28+
the technologies intended for the implementation. This idea was
1529
adapted from a similar idea in
1630
[Simon Brown's](https://www.linkedin.com/in/simonbrownjersey/)
1731
[C4 Model For Software Architecture](https://c4model.com/#Notation).
1832

19-
Other options are specific to the kind of vital definition. See the
20-
vital definition's page for details on the options they take. Non-vital
21-
definitions do not allow options.
33+
Other options are specific to the kind of vital definition. See the
34+
vital definition's page for details on the options they take.
35+
Non-vital definitions do not allow options.
2236

2337
## Occurs In
24-
All [vital definitions](vital.md)
38+
39+
[Metadata](metadata.md) blocks (`with { }`) on any
40+
[vital definition](vital.md).
2541

2642
## Contains
27-
Option values which are simple identifiers with an optional set of string
28-
arguments.
43+
44+
Option values which are simple identifiers with an optional set of
45+
string arguments.

0 commit comments

Comments
 (0)