Skip to content

Commit da58d3b

Browse files
authored
Add info about snipsync to readme (#719)
1 parent 1d645e4 commit da58d3b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,26 @@ settings are:
118118
There are also files in the `history/` subdirectory which contain history files used during run. See the
119119
"History Checking" and "Generating History" sections for more info.
120120

121+
### Writing snippets for documentation
122+
123+
The repo can also be used as a way to author buildable/testable example snippets for our documentation. This is done
124+
using Snipsync as described in the
125+
[documentation repo](https://github.com/temporalio/documentation/blob/main/CONTRIBUTING.md#snipsync).
126+
127+
Snippets may be sourced from normal features, or, if writen purely for usage as a docs snippet they should be placed
128+
in `features/snippets/snippet_name`. Beyond the path prefix, the folder contents should follow the same practices
129+
as for a normal feature.
130+
131+
To define a snippet, use syntax like the following, where hellouniverse is the snippet identifier.
132+
133+
```
134+
// @@@SNIPSTART hellouniverse
135+
func HelloUniverse() {
136+
fmt.Println("Hello Universe!")
137+
}
138+
// @@@SNIPEND
139+
```
140+
121141
### Best Practices
122142

123143
- Try to only demonstrate/test one feature per feature directory.

0 commit comments

Comments
 (0)