Skip to content

Commit aa6a2af

Browse files
patshaughnessyheckj
authored andcommitted
Include a full markdown example containing @snippet
1 parent 860e516 commit aa6a2af

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Sources/docc/DocCDocumentation.docc/adding-code-snippets-to-your-content.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,22 @@ The `path` argument has three parts:
102102

103103
3. The name of your snippet file without the `.swift` extension
104104

105-
In the example package above, the `YourProject.md` file could reference `example-snippet.swift` like this:
105+
In the example package above, the `YourProject.md` file might contain this markdown:
106106

107107
```markdown
108+
# ``YourProject``
109+
110+
Add a single sentence or sentence fragment, which DocC uses as the page’s abstract or summary.
111+
112+
## Overview
113+
114+
Add one or more paragraphs that introduce your content overview.
115+
116+
This paragraph appears before the snippet.
117+
108118
@Snippet(path: "YourProject/Snippets/example-snippet")
119+
120+
This paragraph appears after the snippet.
109121
```
110122

111123
Without any additional annotations in your snippet, Docc includes the entirety of your code example as the snippet.

0 commit comments

Comments
 (0)