Skip to content

Commit b874241

Browse files
committed
Add example of snippet
1 parent 75b393d commit b874241

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/contributing/index.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,3 +497,20 @@ However, if you believe it's beneficial to actually repeat the content, consider
497497
Snippets allow including the contents of a text file in multiple places of the documentation.
498498

499499
For example, the recommended NCCL environment variables are defined in a text file (`docs/software/commuinication/nccl_env_vars`) and included on multiple pages because it's essential that users of NCCL notice and use the environment variables.
500+
501+
Snippets are included with `--8<-- path/to/snippet`.
502+
For example, to include the recommended NCCL environment variables, do the following:
503+
504+
=== "Markdown"
505+
506+
````markdown
507+
```bash
508+
;--8<-- "docs/software/communication/nccl_env_vars"
509+
```
510+
````
511+
512+
=== "Rendered"
513+
514+
```bash title="Recommended NCCL environment variables"
515+
--8<-- "docs/software/communication/nccl_env_vars"
516+
```

0 commit comments

Comments
 (0)