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
* update docs and debugging info
* Update doc/dev/code_snippets.md
Co-authored-by: Krista Pratico <[email protected]>
---------
Co-authored-by: Krista Pratico <[email protected]>
Copy file name to clipboardExpand all lines: doc/dev/code_snippets.md
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ All code snippets in README should be up to date and runnable. And we want to ha
10
10
11
11
Samples need to store in the samples folder under each service. In each sample file, we use `# [START snippet_name]` & `# [END snippet_name]` to note a code snippet.
12
12
13
+
**Note:** valid characters for a snippet name are [A-Z a-z0-9_]
Instead of copying the code snippet into README which is hard to maintain and validate, we add reference to the sample snippet in README. We use the annotation <!-- SNIPPET:file_name.snippet_name--> to refer the code snippet in README file.
30
+
Instead of copying the code snippet into README which is hard to maintain and validate, we add reference to the sample snippet in README. We use the annotation `\<!-- SNIPPET:file_name.snippet_name-->` to refer the code snippet in README file.
29
31
30
32
It is like:
31
33
32
-
<!-- SNIPPET:test_example_async.asyncio -->
34
+
`\<!-- SNIPPET:test_example_async.asyncio -->`
35
+
33
36
```python
34
37
from azure.core.pipeline.transport import AsyncioRequestsTransport
35
38
36
39
asyncwith AsyncPipeline(AsyncioRequestsTransport(), policies=policies) as pipeline:
37
40
response =await pipeline.run(request)
38
41
```
39
-
<!-- END SNIPPET -->
42
+
43
+
`\<!-- END SNIPPET -->`
44
+
45
+
**Note:** you need to make sure there is
46
+
47
+
\```python
48
+
49
+
\```
50
+
51
+
within `\<!-- SNIPPET:` & `\<!-- END SNIPPET -->` in README.MD to make the annotation valid.
0 commit comments