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: Sources/docc/DocCDocumentation.docc/adding-structure-to-your-documentation-pages.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Adding Structure to Your Documentation Pages
2
2
3
-
Arrange symbols into groups and collections that make them easy to find.
3
+
Make symbols easier to find by arranging them into groups and collections.
4
4
5
5
## Overview
6
6
@@ -24,9 +24,10 @@ For more information, see
24
24
### Customize Your Documentation's Landing Page
25
25
26
26
A landing page provides an overview of your framework, introduces important
27
-
terms, and organizes the resources within your documentation catalog to ease
28
-
the reader's learning path. It's an opportunity for you to discuss key features
29
-
of your framework and offer motivation for when the reader might want to use
27
+
terms, and organizes the resources within your documentation catalog — the
28
+
files that enrich your source documentation comments. The landing page is an
29
+
opportunity for you to ease the reader's learning path, discuss key features of
30
+
your technology, and offer motivation for the reader to return to when they need
30
31
it.
31
32
32
33
For projects that don't include a documentation catalog, DocC generates a
@@ -40,7 +41,7 @@ of your framework.
40
41
If you need to manually add a landing page to your documentation catalog, use your text editor to create a file to match the name of the framework. For example, for the
41
42
`SlothCreator` framework, the filename is `SlothCreator.md`.
42
43
43
-
The first line of content in a landing page is the name of the framework, which
44
+
The first line of content in a landing page is an H1 heading containing the framework's product module name, which
44
45
you precede with a single hash (`#`) and encapsulate in a set of double backticks (\`\`).
45
46
46
47
```markdown
@@ -61,18 +62,18 @@ Catalog sloths you find in nature and create new adorable virtual sloths.
61
62
62
63
After the summary, add another blank line and then one or more paragraphs that
63
64
introduce your framework to form the Overview section of the landing
64
-
page. Keep the Overview brief — typically less than a screen's worth of
65
+
page. Try to keep the Overview brief — typically less than a screen's worth of
65
66
content. Avoid detailing every feature in your framework. Instead,
66
67
provide content that helps the reader understand what problems the framework
67
68
solves.
68
69
69
-
Write your Overview using _documentation markup_; a lightweight markup language
70
+
Write your Overview using _documentation markup_, a lightweight markup language
70
71
that allows you to include images, lists, and links to
71
72
symbols and other content. For more information, see
72
73
<doc:formatting-your-documentation-content>.
73
74
74
-
In addition to presenting rich content, a custom landing page provides organization of the top-level symbols and other content in your
75
-
documentation hierarchy.
75
+
In addition to presenting rich content, a custom landing page organizes the top-level
76
+
symbols and other content in your documentation hierarchy.
76
77
77
78
### Arrange Top-Level Symbols Using Topic Groups
78
79
@@ -84,7 +85,7 @@ between those symbols.
84
85
To help readers more easily navigate your framework, arrange symbols into
85
86
groups with meaningful names. Place important symbols higher on the page, and
86
87
nest supporting symbols inside other symbols. Use group names that are unique,
87
-
mutually exclusive, and have clear meaning. Experiment with different
88
+
mutually exclusive, and clear. Experiment with different
88
89
arrangements to find what works best for you.
89
90
90
91

@@ -125,16 +126,16 @@ symbol's type information and summary. For more information, see
125
126
<doc:formatting-your-documentation-content>.
126
127
127
128
When you rebuild your documentation, the documentation viewer reflects these
128
-
organizational changes in the navigation pane and on the framework's
129
+
organizational changes in the navigation pane and on the
129
130
landing page, as the image above shows.
130
131
131
132
### Arrange Nested Symbols in Extension Files
132
133
133
-
Not all public symbols appear at the top-level of a framework. For example,
134
+
Not all symbols appear on the top-level landing page. For example,
134
135
classes and structures define methods and properties, and in some cases, nested
135
136
classes or structures introduce additional levels of hierarchy.
136
137
137
-
As with the framework's landing page, DocC generates default topic groups for
138
+
As with the top-level landing page, DocC generates default topic groups for
138
139
nested symbols according to their type. Use extension files to override this
139
140
default organization and provide a more appropriate structure for your symbols.
140
141
@@ -143,15 +144,14 @@ default organization and provide a more appropriate structure for your symbols.
143
144
To add an extension file to your documentation catalog for a specific symbol, use a text editor to create a new file named `Extension.md`.
144
145
145
146
In the `Extension.md` file, replace the `Symbol` placeholder
146
-
with the name of the symbol you're organizing and rename the file accordingly.
147
+
with the symbol path of the symbol you're organizing and rename the file accordingly.
147
148
148
149
```markdown
149
150
# ``SlothCreator/Sloth``
150
151
```
151
152
152
-
> Important: You must use the symbol's absolute path for the page title of an
153
-
extension file and include the name of the framework or package. DocC doesn't
154
-
support relative symbol paths in this context.
153
+
> Important: The symbol path for the page title of an extension file need to start
154
+
with the name of a top-level symbol or the name of the framework.
155
155
156
156
The Extension File template includes a `Topics` section with a single named
157
157
group, ready for you to fill out. Alternatively, if your documentation catalog
@@ -222,4 +222,4 @@ they can also confuse a reader if you create too many levels of hierarchy.
222
222
Avoid using a collection when a topic group at a higher level can achieve the
223
223
same result.
224
224
225
-
<!-- Copyright (c) 2021 Apple Inc and the Swift Project authors. All Rights Reserved. -->
225
+
<!-- Copyright (c) 2021-2023 Apple Inc and the Swift Project authors. All Rights Reserved. -->
### Add Extension Files to Append to or Override Source Documentation Comments
@@ -95,9 +95,8 @@ In cases like these, DocC supports supplementing or completely replacing source
95
95
documentation comments with content in extension files. To add an extension file to your
96
96
documentation catalog, create a file within the documentation catalog, then modify the first line of the file to identify the symbol that the file relates to.
97
97
98
-
> Important: You must use the symbol's absolute path for the page title of an
99
-
extension file and include the name of the framework or package. DocC doesn't
100
-
support relative symbol paths in this context.
98
+
> Important: The symbol path for the page title of an extension file need to start
99
+
with the name of a top-level symbol or the name of the framework.
101
100
102
101
If the symbol already has source documentation comments, add a
103
102
`DocumentationExtension` directive to specify whether the content of the
@@ -151,7 +150,7 @@ This overrides the in-source summary.
151
150
This content overrides in-source content.
152
151
````
153
152
154
-
For additional details about `Metadata` and other directives, see
153
+
For more information on `Metadata` and other directives, see
155
154
<doc:Metadata>.
156
155
157
-
<!-- Copyright (c) 2021 Apple Inc and the Swift Project authors. All Rights Reserved. -->
156
+
<!-- Copyright (c) 2021-2023 Apple Inc and the Swift Project authors. All Rights Reserved. -->
Create rich and engaging documentation from your in-source comments, and add a
4
-
documentation catalog to your code base to provide additional content.
3
+
Create developer documentation from in-source comments, add articles with code snippets,
4
+
and add tutorials for a guided learning experience.
5
5
6
6
## Overview
7
7
8
-
DocC, or _Documentation Compiler_, makes it easy for you to produce
9
-
documentation for your Swift frameworks and packages. The compiler builds your
10
-
documentation by combining comments that you write in-source with extension files,
8
+
DocC, or _Documentation Compiler_, makes it easy to produce
9
+
rich and engaging developer documentation for your Swift frameworks and packages.
10
+
The compiler builds documentation by combining in-source comments with extension files,
11
11
articles, and other resources,
12
12
allowing you to create rich and engaging documentation for developers.
13
13
14
14
With DocC, you provide a combination of reference and conceptual content, and
15
15
connect it together using powerful organization and linking capabilities. Because you write
16
16
documentation directly in source, you can use the tools you're already familiar
17
-
with, such as Git, to track changes you make.
17
+
with, like Git, to track changes.
18
18
19
19
### Build Simple Documentation from Your Source Comments
20
20
21
21
For DocC to compile your documentation, the Swift compiler first builds your Swift framework
22
22
or package, and stores additional information about its public APIs alongside
23
-
the compiled artifacts. It then consumes that information and compiles your
24
-
documentation into a DocC Archive. This process repeats for every Swift
25
-
framework or package that your target depends on.
23
+
the compiled artifacts. DocC consumes that information and compiles the documentation into a DocC Archive. This process repeats for every Swift framework or package your target depends on.
26
24
27
25

28
26
29
27
To build documentation for your Swift framework or package, use the DocC command-line interface in preview mode and specify a location. On macOS, DocC monitors the files in the location and recompiles when you make changes. On other platforms, you need to quit and restart DocC to recompile the documentation.
30
28
31
29

32
30
33
-
DocC uses the comments that you write in your source code as the content for the
31
+
> Tip: You can also use the Swift-DocC Plugin to
32
+
[build a documentation archive for a Swift package][plugin-docs].
By default, DocC compiles only your in-source symbol documentation and then
46
+
By default, DocC compiles only in-source symbol documentation and then
44
47
groups those symbols together by their kind, such as protocols, classes,
45
48
enumerations, and so forth. When you want to provide additional content or
46
-
customize the organization of your framework's symbols, use a documentation
49
+
customize the organization of symbols, use a documentation
47
50
catalog.
48
51
49
52
DocC combines the public API information from the Swift compiler with the
50
-
contents of the documentation catalog to generate a richer DocC Archive.
53
+
contents of the documentation catalog to generate a much richer DocC Archive.
51
54
52
55

53
56
54
-
Use a documentation catalog when you want to include:
57
+
Use a documentation catalog when you want to include any of the following:
55
58
56
-
* A landing page that introduces your framework and arranges its top-level
57
-
symbols, as well as extension files that provide custom organization for your
59
+
* A landing page that introduces a framework and arranges its top-level
60
+
symbols, as well as extension files that provide custom organization for the
58
61
symbols' properties and methods. For more information, see
0 commit comments