You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/elixir/pages/getting-started/writing-documentation.md
+27-2Lines changed: 27 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,11 @@ end
61
61
62
62
## Documentation metadata
63
63
64
-
Elixir allows developers to attach arbitrary metadata to the documentation. This is done by passing a keyword list to the relevant attribute (such as `@moduledoc`, `@typedoc`, and `@doc`). A commonly used metadata is `:since`, which annotates in which version that particular module, function, type, or callback was added, as shown in the example above.
64
+
Elixir allows developers to attach arbitrary metadata to the documentation. This is done by passing a keyword list to the relevant attribute (such as `@moduledoc`, `@typedoc`, and `@doc`).
65
+
66
+
Metadata can have any key. Documentation tools often use metadata to provide more data to readers and to enrich the user experience. The following keys already have a predefined meaning used by tooling:
67
+
68
+
### `:deprecated`
65
69
66
70
Another common metadata is `:deprecated`, which emits a warning in the documentation, explaining that its usage is discouraged:
67
71
@@ -75,7 +79,28 @@ Note that the `:deprecated` key does not warn when a developer invokes the funct
75
79
@deprecated"Use Foo.bar/2 instead"
76
80
```
77
81
78
-
Metadata can have any key. Documentation tools often use metadata to provide more data to readers and to enrich the user experience.
82
+
### `:group`
83
+
84
+
The group a function, callback or type belongs to. This is used in `iex` for autocompleting and also to automatically by [ExDoc](https://github.com/elixir-lang/ex_doc/) to group items in the sidebar:
85
+
86
+
```elixir
87
+
@docgroup:"Query"
88
+
defall(query)
89
+
90
+
@docgroup:"Schema"
91
+
definsert(schema)
92
+
```
93
+
94
+
### `:since`
95
+
96
+
It annotates in which version that particular module, function, type, or callback was added:
0 commit comments